Skip to content

Commit

Permalink
Enable ruff-pre-commit for third_party/nvidia (#5587)
Browse files Browse the repository at this point in the history
Signed-off-by: Anatoly Myachev <[email protected]>
  • Loading branch information
anmyachev authored Jan 13, 2025
1 parent ebb2716 commit 6aa2df9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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)
_ = 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(
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

0 comments on commit 6aa2df9

Please sign in to comment.