已合并
[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
已合并
共 5 个文件变更+10-6
| @@ -6,7 +6,7 @@ import torch.nn.functional as F | |||
| 6 | from torch.autograd import Function | 6 | from torch.autograd import Function |
| 7 | from torch.library import Library, impl | 7 | from torch.library import Library, impl |
| 8 | import torch_npu | 8 | import torch_npu |
| 9 | -from torch_npu._inductor.npu_fusion_attention_graph import NpuGraphAttentionFunction | 9 | +from torch_npu._inductor.fx_passes.pattern_match.npu_fusion_attention_graph import NpuGraphAttentionFunction |
| 10 | from torch_npu.testing.testcase import TestCase, run_tests | 10 | from torch_npu.testing.testcase import TestCase, run_tests |
| 11 | 11 | ||
| 12 | 12 | ||
| @@ -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", |
| @@ -33,7 +33,7 @@ else: | |||
| 33 | 33 | ||
| 34 | from . import config as npu_config | 34 | from . import config as npu_config |
| 35 | from . import codegen | 35 | from . import codegen |
| 36 | - from .npu_fusion_attention_graph import register_fa_pass | 36 | + 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_num | 39 | disable_comprehensive_padding, max_precompiled_thread_num |
| @@ -0,0 +1,3 @@ | |||
| 1 | +from .npu_fusion_attention_graph import npu_fusion_attention_graph | ||
| 2 | + | ||
| 3 | +__all__ = ["npu_fusion_attention_graph"] | ||