From a282a75c499ec84b10a7da2cf0691126dd514949 Mon Sep 17 00:00:00 2001 From: "Zhijing Li (Accelerator Enablement)" Date: Fri, 21 Jul 2023 12:11:01 -0700 Subject: [PATCH] Rename reshape to avoid acc tracer collision MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: There is an AIT bug See this acc_graph: P795462043, and model-generated.h: P795461857 When the node name is the same as function name - in this case, reshape_14 we will have ``` expression preceding parentheses of apparent call must have (pointer-to-) function type ``` This is because reshape_14 is both tensor and function (see model-generated.h: P795461857) The fix can be either add func name to MEMO set (D47657410), or name our reshape function so that it would cause any name collision to the name produced by the acc tracer (this diff). We probably chose the latter because the former may might end up with a very large name set and long compilation time. The later approach isn't general but I guess we don’t have many cases where we name our kernel launchers the same way as what the acc tracer names tensors. Differential Revision: D47675840 fbshipit-source-id: 21395181fb7610cc5feaccf953dbee0dfc900f51 --- python/aitemplate/compiler/transform/name_graph.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/aitemplate/compiler/transform/name_graph.py b/python/aitemplate/compiler/transform/name_graph.py index b2a13b359..65e96eb4c 100644 --- a/python/aitemplate/compiler/transform/name_graph.py +++ b/python/aitemplate/compiler/transform/name_graph.py @@ -98,7 +98,7 @@ def name_graph(sorted_graph: List[Tensor]) -> None: else: for func in funcs: if func._attrs["name"] is None: - func_name = "{op_kind}_{idx}".format( + func_name = "ait_{op_kind}_{idx}".format( op_kind=func._attrs["op"], idx=func_cnt ) func_name = unique_name(func_name)