Skip to content

Commit 6aa2df9

Browse files
authored
Enable ruff-pre-commit for third_party/nvidia (triton-lang#5587)
Signed-off-by: Anatoly Myachev <[email protected]>
1 parent ebb2716 commit 6aa2df9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ repos:
2121
rev: v0.7.1
2222
hooks:
2323
- id: ruff
24-
files: '(^python|^third_party/proton|^third_party/amd)/.*'
24+
files: '(^python|^third_party/proton|^third_party/amd|^third_party/nvidia)/.*'
2525
args: ["--fix", "--exit-non-zero-on-fix"]
2626
exclude: |
2727
(?x)(

third_party/nvidia/backend/compiler.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def make_ttgir(mod, metadata, opt, capability):
232232
# Set up Diagnostic
233233
if os.environ.get("MLIR_ENABLE_REMARK", "0") == "1":
234234
srcMgr = llvm.source_mgr()
235-
diag = ir.source_mgr_diag(srcMgr, mod.context)
235+
_ = ir.source_mgr_diag(srcMgr, mod.context)
236236
mod.context.printOpOnDiagnostic(True)
237237
# TTIR -> TTGIR
238238
pm = ir.pass_manager(mod.context)
@@ -286,7 +286,7 @@ def make_llir(src, metadata, options, capability):
286286
# Set up Diagnostic
287287
if os.environ.get("MLIR_ENABLE_REMARK", "0") == "1":
288288
srcMgr = llvm.source_mgr()
289-
diag = ir.source_mgr_diag(srcMgr, mod.context)
289+
_ = ir.source_mgr_diag(srcMgr, mod.context)
290290
mod.context.printOpOnDiagnostic(True)
291291
passes.ttgpuir.add_combine_tensor_select_and_if(pm)
292292
passes.convert.add_scf_to_cf(pm)
@@ -306,7 +306,7 @@ def make_llir(src, metadata, options, capability):
306306
llvm.init_targets()
307307
context = llvm.context()
308308
if os.environ.get("TRITON_ENABLE_ASAN", "0") == "1":
309-
raise ASANError(
309+
raise RuntimeError(
310310
"Address Sanitizer Error: Address sanitizer is currently only supporteedd on the AMD backend")
311311
llvm_mod = llvm.to_module(mod, context)
312312
proc = 'sm_90a' if capability == 90 else f'sm_{capability}'

0 commit comments

Comments
 (0)