From 20fb38b8d376a2b78985d757a81c525232d341c4 Mon Sep 17 00:00:00 2001 From: Renat Idrisov <4032256+parsifal-47@users.noreply.github.com> Date: Thu, 2 Jan 2025 16:55:28 -0800 Subject: [PATCH] Do not strip locations for better debugging experience (#204) We getting locations as a part of Triton IR and from the inductor, however we strip them because that is the default behavior of mlir-opt. This information is useful and I think the overhead is tolerable, especially because any subsequent run is cached. Co-authored-by: Renat Idrisov --- backend/compiler.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/compiler.py b/backend/compiler.py index 6894b432..0dc38fc3 100644 --- a/backend/compiler.py +++ b/backend/compiler.py @@ -33,7 +33,8 @@ def _ttir_to_ttsharedir(mod): dst_path = os.path.join(tmpdir, "ttshared.mlir") Path(src_path).write_text(ttir_code) triton_shared_opt_path = _get_triton_shared_opt_path() - subprocess.check_call([triton_shared_opt_path, src_path, "--triton-to-linalg-experimental", "-o", dst_path]) + subprocess.check_call([triton_shared_opt_path, src_path, + "--triton-to-linalg-experimental", "--mlir-print-debuginfo", "-o", dst_path]) return Path(dst_path).read_text() @@ -80,6 +81,7 @@ def _ttsharedir_to_llir(ttsharedir: str): "--convert-arith-to-llvm", # Remove all unrealized casts created "--reconcile-unrealized-casts", + "--mlir-print-debuginfo", "-o", llmlir_path])