From 78e10ff09b78ba14c4c97100360205550c36669e Mon Sep 17 00:00:00 2001 From: Aart Bik <39774503+aartbik@users.noreply.github.com> Date: Fri, 16 Feb 2024 20:56:42 -0800 Subject: [PATCH] [torch-mlir][sparse] inline sparse helper methods (#2918) Even though the reference compiler is not about performance, inlining the generated sparse helper methods has a rather big positive impact on performance, leaving a much better first impression. Therefore, we added this inlining pass (which leaves all other PyTorch modules unaffected, since they tend to be one big main() method to start with). testing: $./tools/e2e_test.sh --config linalg Summary: Passed: 1164 Expectedly Failed: 8 $ python -m e2e_testing.main --config=torchdynamo Summary: Passed: 976 Expectedly Failed: 162 --- .../torch_mlir_e2e_test/linalg_on_tensors_backends/refbackend.py | 1 + 1 file changed, 1 insertion(+) diff --git a/projects/pt1/python/torch_mlir_e2e_test/linalg_on_tensors_backends/refbackend.py b/projects/pt1/python/torch_mlir_e2e_test/linalg_on_tensors_backends/refbackend.py index 9c33d8fd504d..ad2669c51d50 100644 --- a/projects/pt1/python/torch_mlir_e2e_test/linalg_on_tensors_backends/refbackend.py +++ b/projects/pt1/python/torch_mlir_e2e_test/linalg_on_tensors_backends/refbackend.py @@ -139,6 +139,7 @@ def invoke(*args): "sparse-assembler", "sparsification-and-bufferization", "sparse-storage-specifier-to-llvm", + "inline", # inline sparse helper methods where useful # Bufferize. "func.func(scf-bufferize)", "func.func(tm-tensor-bufferize)",