Skip to content

Commit

Permalink
Do not strip locations for better debugging experience (#204)
Browse files Browse the repository at this point in the history
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 <parsifal-47@users.noreply.github.com>
  • Loading branch information
parsifal-47 and parsifal-47 authored Jan 3, 2025
1 parent d0c41ab commit 20fb38b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion backend/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()


Expand Down Expand Up @@ -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])

Expand Down

0 comments on commit 20fb38b

Please sign in to comment.