已合并
[inductor][refactor] move npu_fusion_attention_graph to fx_passes/pattern_match #33269
jimmycao9929创建于 4月7日
[inductor][refactor] move npu_fusion_attention_graph to fx_passes/pattern_match #33269
已合并
jimmycao9929创建于 4月7日
5 个文件变更+10-6
Mtest/_inductor/test_npu_fusion_attention_graph.py+1-1
@@ -6,7 +6,7 @@ import torch.nn.functional as F
6from torch.autograd import Function6from torch.autograd import Function
7from torch.library import Library, impl7from torch.library import Library, impl
8import torch_npu8import torch_npu
9-from torch_npu._inductor.npu_fusion_attention_graph import NpuGraphAttentionFunction9+from torch_npu._inductor.fx_passes.pattern_match.npu_fusion_attention_graph import NpuGraphAttentionFunction
10from torch_npu.testing.testcase import TestCase, run_tests10from torch_npu.testing.testcase import TestCase, run_tests
11 11 
12 12 
Mtest/npu/test_public_bindings.py+5-4
@@ -561,7 +561,6 @@ class TestPublicBindings(TestCase):
561 "torch_npu._inductor.lowering_fx",561 "torch_npu._inductor.lowering_fx",
562 "torch_npu._inductor.npu_choices",562 "torch_npu._inductor.npu_choices",
563 "torch_npu._inductor.npu_device",563 "torch_npu._inductor.npu_device",
564- "torch_npu._inductor.npu_fusion_attention_graph",
565 "torch_npu._inductor.npu_triton_helpers",564 "torch_npu._inductor.npu_triton_helpers",
566 "torch_npu._inductor.npu_triton_heuristics",565 "torch_npu._inductor.npu_triton_heuristics",
567 "torch_npu._inductor.npu_static_kernel",566 "torch_npu._inductor.npu_static_kernel",
@@ -610,7 +609,6 @@ class TestPublicBindings(TestCase):
610 "torch_npu._inductor.tools.fallback_list_tool",609 "torch_npu._inductor.tools.fallback_list_tool",
611 "torch_npu._inductor.codecache",610 "torch_npu._inductor.codecache",
612 "torch_npu._inductor.cpp_builder",611 "torch_npu._inductor.cpp_builder",
613- "torch_npu._inductor.fx_passes.joint_graph",
614 "torch_npu._inductor.ir",612 "torch_npu._inductor.ir",
615 "torch_npu._inductor.graph",613 "torch_npu._inductor.graph",
616 "torch_npu._inductor.lowering_fallback_list",614 "torch_npu._inductor.lowering_fallback_list",
@@ -654,16 +652,19 @@ class TestPublicBindings(TestCase):
654 "torch_npu._inductor.dvm.op_emitter",652 "torch_npu._inductor.dvm.op_emitter",
655 "torch_npu.npu.npugraph_ex.inference._cache_compiler",653 "torch_npu.npu.npugraph_ex.inference._cache_compiler",
656 "torch_npu._inductor.fx_passes",654 "torch_npu._inductor.fx_passes",
655+ "torch_npu._inductor.fx_passes.graph_match_pass",
656+ "torch_npu._inductor.fx_passes.joint_graph",
657 "torch_npu._inductor.fx_passes.post_grad",657 "torch_npu._inductor.fx_passes.post_grad",
658+ "torch_npu._inductor.fx_passes.ascend_custom_passes",
658 "torch_npu._inductor.fx_passes.ascend_custom_passes.ascend_graph_pass",659 "torch_npu._inductor.fx_passes.ascend_custom_passes.ascend_graph_pass",
659 "torch_npu._inductor.fx_passes.ascend_custom_passes.register_custom_pass",660 "torch_npu._inductor.fx_passes.ascend_custom_passes.register_custom_pass",
660- "torch_npu._inductor.fx_passes.graph_match_pass",661+ "torch_npu._inductor.fx_passes.pattern_match",
662+ "torch_npu._inductor.fx_passes.pattern_match.npu_fusion_attention_graph",
661 "torch_npu._inductor.fx_passes.utils.check_mode",663 "torch_npu._inductor.fx_passes.utils.check_mode",
662 "torch_npu._inductor.fx_passes.utils.check_op_util",664 "torch_npu._inductor.fx_passes.utils.check_op_util",
663 "torch_npu._inductor.fx_passes.utils.fx_check_utils",665 "torch_npu._inductor.fx_passes.utils.fx_check_utils",
664 "torch_npu._inductor.fx_passes.utils.fx_pass_level",666 "torch_npu._inductor.fx_passes.utils.fx_pass_level",
665 "torch_npu._inductor.fx_passes.utils.get_binary_fold_result",667 "torch_npu._inductor.fx_passes.utils.get_binary_fold_result",
666- "torch_npu._inductor.fx_passes.ascend_custom_passes",
667 "torch_npu._inductor.fasta_autotune",668 "torch_npu._inductor.fasta_autotune",
668 "torch_npu._inductor.profiler",669 "torch_npu._inductor.profiler",
669 "torch_npu._inductor.kernel.flex_attention",670 "torch_npu._inductor.kernel.flex_attention",
Mtorch_npu/_inductor/__init__.py+1-1
@@ -33,7 +33,7 @@ else:
33 33 
34 from . import config as npu_config34 from . import config as npu_config
35 from . import codegen35 from . import codegen
36- from .npu_fusion_attention_graph import register_fa_pass36+ from .fx_passes.pattern_match.npu_fusion_attention_graph import register_fa_pass
37 from .config import (37 from .config import (
38 aggresive_autotune, num_vector_core, set_compile_threads, 38 aggresive_autotune, num_vector_core, set_compile_threads,
39 disable_comprehensive_padding, max_precompiled_thread_num39 disable_comprehensive_padding, max_precompiled_thread_num
Atorch_npu/_inductor/fx_passes/pattern_match/__init__.py+3-0
@@ -0,0 +1,3 @@
1+from .npu_fusion_attention_graph import npu_fusion_attention_graph
2+ 
3+__all__ = ["npu_fusion_attention_graph"]
Rtorch_npu/_inductor/npu_fusion_attention_graph.pytorch_npu/_inductor/fx_passes/pattern_match/npu_fusion_attention_graph.py+0-0
文件重命名但无更改。