Repository navigation
[Triton/Gluon] [Bench] bench_mla: pass the output buffer to mla_prefill_fwd - #6251
Conversation
The prefill branch passed 'out', which is not assigned yet at that point, so
any prefill run (--decode_qlen 0) failed with:
UnboundLocalError: cannot access local variable 'out'
Pass 'output', as the decode branch does.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
There was a problem hiding this comment.
🟡 Changes recommended
The documented prefill command still passes a default shuffled-cache flag that the wrapper rejects.
1 open finding
What changed in this PR
Fixes output-buffer handling in the MLA prefill benchmark.
Changes:
- Passes the preallocated
outputbuffer to both the initial and timed prefill calls, eliminating the unboundoutreference.
| File | Description |
|---|---|
op_tests/op_benchmarks/triton/bench_mla.py |
Corrects the output argument at both prefill call sites. |
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
Both calls inside fn() bound their result to 'out' only for it to be discarded; the kernels write into 'output'. Ruff flagged it (F841) once the prefill call stopped reading 'out'.
There was a problem hiding this comment.
🔵 Needs a closer look
The documented prefill invocation still enables shuffled KV caching by default, which the prefill wrapper rejects.
1 open finding
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

Problem
In
bench_mla.py, both prefill calls passouttomla_prefill_fwdbeforeoutis assigned (it is the call's own return value), so every prefill run (--decode_qlen 0) fails:Fix
Pass the preallocated
outputbuffer, as the decode branch does. Both prefill call sites, lines 219 and 281.Inside the timed
fn(), neither call's result is used (the kernels write intooutput), so both calls there no longer bind it toout. Ruff flagged the prefill one (F841) once it stopped readingout.Testing
bench_mla --decode_qlen 0now runs the prefill kernel instead of raising.