Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ repos:
rev: v0.7.1
hooks:
- id: ruff
files: '(^python|^third_party/proton|^third_party/amd)/.*'
files: '(^python|^third_party/proton|^third_party/amd|^third_party/nvidia)/.*'
args: ["--fix", "--exit-non-zero-on-fix"]
exclude: |
(?x)(
Expand Down
6 changes: 3 additions & 3 deletions third_party/nvidia/backend/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def make_ttgir(mod, metadata, opt, capability):
# Set up Diagnostic
if os.environ.get("MLIR_ENABLE_REMARK", "0") == "1":
srcMgr = llvm.source_mgr()
diag = ir.source_mgr_diag(srcMgr, mod.context)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not used

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test failure looks real, probably the lifetime of this variable controls the diagnostics setting.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will take a look

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you rerun CI?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything seems to be fine now :)

Copy link
Copy Markdown
Contributor

@sfzhu93 sfzhu93 Jan 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I refactored this in my PR as well #5581. I guess it doesn't depend on the lifetime of the variable. Previously it calls a constructor for the SourceMgrDiagnosticHandler, which registers the handler into the MLIRContext.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I refactored this in my PR as well #5581...

Hi @sfzhu93!

I see you are removing these sections in your PR. My changes, I think, will just introduce a small conflict (if they are merged earlier) that will have to be fixed, but that should be easy.

_ = ir.source_mgr_diag(srcMgr, mod.context)
mod.context.printOpOnDiagnostic(True)
# TTIR -> TTGIR
pm = ir.pass_manager(mod.context)
Expand Down Expand Up @@ -286,7 +286,7 @@ def make_llir(src, metadata, options, capability):
# Set up Diagnostic
if os.environ.get("MLIR_ENABLE_REMARK", "0") == "1":
srcMgr = llvm.source_mgr()
diag = ir.source_mgr_diag(srcMgr, mod.context)
_ = ir.source_mgr_diag(srcMgr, mod.context)
mod.context.printOpOnDiagnostic(True)
passes.ttgpuir.add_combine_tensor_select_and_if(pm)
passes.convert.add_scf_to_cf(pm)
Expand All @@ -306,7 +306,7 @@ def make_llir(src, metadata, options, capability):
llvm.init_targets()
context = llvm.context()
if os.environ.get("TRITON_ENABLE_ASAN", "0") == "1":
raise ASANError(
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ASANError is not defined

raise RuntimeError(
"Address Sanitizer Error: Address sanitizer is currently only supporteedd on the AMD backend")
llvm_mod = llvm.to_module(mod, context)
proc = 'sm_90a' if capability == 90 else f'sm_{capability}'
Expand Down