diff --git a/src/nncf/common/graph/graph.py b/src/nncf/common/graph/graph.py index 2c14f52b0de..5eef43ab576 100644 --- a/src/nncf/common/graph/graph.py +++ b/src/nncf/common/graph/graph.py @@ -622,7 +622,11 @@ def get_graph_for_structure_analysis(self, extended: bool = False) -> nx.DiGraph """ out_graph = nx.DiGraph() for node_name, node in self._nx_graph.nodes.items(): - attrs_node = {"id": str(node[NNCFNode.ID_NODE_ATTR]), "type": node[NNCFNode.NODE_TYPE_ATTR]} + attrs_node = {"id": str(node[NNCFNode.ID_NODE_ATTR])} + # Filter types which have a reference to a memory in its name. + # Relevant for torchFX dynamic graphs since torch==2.8.0 + if "0x" not in node[NNCFNode.NODE_TYPE_ATTR]: + attrs_node["type"] = node[NNCFNode.NODE_TYPE_ATTR] for attr in ["color", "label", "style"]: if attr in node: attrs_node[attr] = node[attr] diff --git a/tests/torch2/data/fx/dynamic_shapes/post_quantization_compressed/swin_v2_t.dot b/tests/torch2/data/fx/dynamic_shapes/post_quantization_compressed/swin_v2_t.dot index bba10066172..53090878051 100644 --- a/tests/torch2/data/fx/dynamic_shapes/post_quantization_compressed/swin_v2_t.dot +++ b/tests/torch2/data/fx/dynamic_shapes/post_quantization_compressed/swin_v2_t.dot @@ -252,7 +252,7 @@ strict digraph { "250 pow_2" [id=250, type=]; "251 mul_48" [id=251, type=]; "252 eq_74" [id=252, type=]; -"253 sym_not" [id=253, type=]; +"253 sym_not" [id=253]; "254 _assert_scalar_default_5" [id=254, type="_assert_scalar"]; "255 mod_58" [id=255, type=]; "256 add_45" [id=256, type=]; @@ -309,7 +309,7 @@ strict digraph { "307 pow_4" [id=307, type=]; "308 mul_61" [id=308, type=]; "309 eq_80" [id=309, type=]; -"310 sym_not_1" [id=310, type=]; +"310 sym_not_1" [id=310]; "311 _assert_scalar_default_13" [id=311, type="_assert_scalar"]; "312 mod_64" [id=312, type=]; "313 add_55" [id=313, type=]; @@ -366,7 +366,7 @@ strict digraph { "364 pow_6" [id=364, type=]; "365 mul_74" [id=365, type=]; "366 eq_86" [id=366, type=]; -"367 sym_not_2" [id=367, type=]; +"367 sym_not_2" [id=367]; "368 _assert_scalar_default_21" [id=368, type="_assert_scalar"]; "369 mod_70" [id=369, type=]; "370 add_65" [id=370, type=]; diff --git a/tests/torch2/data/fx/dynamic_shapes/quantized/swin_v2_t.dot b/tests/torch2/data/fx/dynamic_shapes/quantized/swin_v2_t.dot index b5a360c808d..38af2f72f8f 100644 --- a/tests/torch2/data/fx/dynamic_shapes/quantized/swin_v2_t.dot +++ b/tests/torch2/data/fx/dynamic_shapes/quantized/swin_v2_t.dot @@ -252,7 +252,7 @@ strict digraph { "250 pow_2" [id=250, type=]; "251 mul_48" [id=251, type=]; "252 eq_74" [id=252, type=]; -"253 sym_not" [id=253, type=]; +"253 sym_not" [id=253]; "254 _assert_scalar_default_5" [id=254, type="_assert_scalar"]; "255 mod_58" [id=255, type=]; "256 add_45" [id=256, type=]; @@ -309,7 +309,7 @@ strict digraph { "307 pow_4" [id=307, type=]; "308 mul_61" [id=308, type=]; "309 eq_80" [id=309, type=]; -"310 sym_not_1" [id=310, type=]; +"310 sym_not_1" [id=310]; "311 _assert_scalar_default_13" [id=311, type="_assert_scalar"]; "312 mod_64" [id=312, type=]; "313 add_55" [id=313, type=]; @@ -366,7 +366,7 @@ strict digraph { "364 pow_6" [id=364, type=]; "365 mul_74" [id=365, type=]; "366 eq_86" [id=366, type=]; -"367 sym_not_2" [id=367, type=]; +"367 sym_not_2" [id=367]; "368 _assert_scalar_default_21" [id=368, type="_assert_scalar"]; "369 mod_70" [id=369, type=]; "370 add_65" [id=370, type=];