Skip to content

[ROCm] Enable Triton MLIR verifier by default on ROCm#786

Open
nurmukhametov wants to merge 1 commit intomainfrom
anurmukh/rocm-enable-triton-verifier-tmp
Open

[ROCm] Enable Triton MLIR verifier by default on ROCm#786
nurmukhametov wants to merge 1 commit intomainfrom
anurmukh/rocm-enable-triton-verifier-tmp

Conversation

@nurmukhametov
Copy link
Copy Markdown
Member

Add a new flag xla_gpu_rocm_triton_verifier (default true) that enables the MLIR pass verifier in the Triton compilation pipeline on ROCm. This turns invalid IR from miscompiling passes into graceful compilation errors that the autotuner can skip, instead of crashing the process.

Submission Checklist

Add a new flag xla_gpu_rocm_triton_verifier (default true) that enables
the MLIR pass verifier in the Triton compilation pipeline on ROCm. This
turns invalid IR from miscompiling passes into graceful compilation
errors that the autotuner can skip, instead of crashing the process.
@nurmukhametov nurmukhametov added the claude-review Request a Claude AI code review for this PR label Apr 8, 2026
@nurmukhametov nurmukhametov requested a review from i-chaochen April 8, 2026 23:54
Comment thread xla/xla.proto
Comment thread xla/backends/gpu/codegen/triton/xtile_compiler.cc
@claude
Copy link
Copy Markdown

claude bot commented Apr 9, 2026

Review Summary

Clean, low-risk change that enables the MLIR pass verifier by default on ROCm to catch invalid IR early. Code logic is correct — the OR condition, flag registration, and default value are all properly wired up.

Two minor documentation nits left inline:

  1. Proto/flag description — "Only consulted when…" is slightly misleading; "only has an observable effect when…" would be more precise.
  2. Flag scope — the flag also gates LLVM IR verification (not just MLIR), and has no effect in debug builds. Worth clarifying in the description.

No functional concerns.

🤖 Generated with Claude Code

@github-actions github-actions bot removed the claude-review Request a Claude AI code review for this PR label Apr 9, 2026
Comment on lines +2946 to +2953
flag_list->push_back(tsl::Flag(
"xla_gpu_rocm_triton_verifier",
bool_setter_for(&DebugOptions::set_xla_gpu_rocm_triton_verifier),
debug_options->xla_gpu_rocm_triton_verifier(),
"If true, enables MLIR pass verification in the Triton compilation "
"pipeline on ROCm. Catches invalid IR early so the autotuner can skip "
"bad configs instead of crashing. Only consulted when "
"xla_gpu_llvm_verification_level is 0 and the target is ROCm."));
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why do we need a new flag for this? Couldn’t we just use the existing xla_gpu_llvm_verification_level flag? (Perhaps we could add another level (e.g. 2) if you don’t want to enable the verifier in emitter_base.cc).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I was concerned to anyhow change xla_gpu_llvm_verification_level flag's behaviour especially bringing to it ROCm specific one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants