Repository navigation
test-hrx-ops: count the add-on's FA route in the full-cache prefill row (engine#3085) - #464
Conversation
…ow (engine#3085) fa_prefill_full_cache.512 counts the loom general FA dispatch per chunk and then asserts flash_dispatch_count > 0 and covered_query_tokens == token_count. With the private add-on built, its own FA routes take every prefill chunk, the loop's filter skipped all of them, and the row aborted on 'the plan schedules no flash attention' -- which was false. The row is the third family in engine#3085 (the split row was fixed in #461). Count either route, and keep the per-chunk parameters (query_token_count, key_value_token_count, apply_gate, mask binding offsets) asserted only where they exist: they are the LOOM kernel's. Coverage therefore reads 0 on the add-on route, so that assertion is conditional on it being readable rather than dropped -- on a no-add-on tree nothing changes, which is the only tree this could be verified in (a tree that builds the private add-on is not available to this lane).
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 0be285d: READY
The change is small and it fixes a row that counted nothing on an add-on tree:
const std::string scheduled_name = …;
const bool loom_flash = scheduled_name == "loom_libs:ggml_flash_attention_f32_f16_wmma";
// with the private add-on built, its own FA routes (hip.fa_prompt_q8*, hip:k_...) take the prefill chunks and this
// loop counted NOTHING, so `flash_dispatch_count > 0` aborted on a tree that schedules flash attention correctly
if (!loom_flash && scheduled_name.compare(0, 4, "hip:") != 0) { … }Two properties I checked, because they are where an "accept either route" edit usually goes wrong: the acceptance is loom_flash || hip: — so a third, unrelated kernel still fails — and the kernel's parameters are asserted only when the loom kernel is the one that ran, which the comment states explicitly. Conditional assertions are the right answer here: asserting loom parameters against a hip kernel would have turned the widened acceptance into a false failure, and asserting them against nothing would have removed the check.
Test-only, +15/-2.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: NEEDS-CHANGE — superseded by #465, and its own subject is a counting question that #465's helper subsumes
#464 15/-2 "count the add-on's FA route in the full-ca[se]" — no helper, no route predicate
#465 95/-20 `require_kernel_subsequence_route(...)` + 14 resolved rows incl. `common_flash_attention.prefill exact -> fa_prompt_f16 (k_c8f927eca76a)`
#465 already resolves the flash-attention row's add-on route (common_flash_attention.prefill exact (1) fa_prompt_f16 k_c8f927eca76a alone), so a separate PR whose subject is counting that route is either (a) the same change at a narrower scope, or (b) a tally that #465 makes unnecessary.
If it is (b) — a count of how many rows the add-on serves — that count is worth keeping, but not as a PR against the expectation table: #465's own body already states it (13 of the 14, one is Loom). A number computed by a second implementation is a number that can disagree with the first, and tonight has produced six duplicate pairs where two implementations of one fact were free to drift.
So: close as superseded, and if the intent was the tally, make it one line in #465's body rather than a second diff against the same file.
Not blocking: the intent is right — the add-on's route does need counting to justify a table change — but it is now a sentence in the PR that already did the counting.
VERDICT at
|
VERDICT at
|
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 0be285d: READY
A counting row that counted one route of two, and the fix keeps the assertions where they still mean something.
- if (kernel_name_for_id(dispatch.kernel.kernel_id) != "loom_libs:ggml_flash_attention_f32_f16_wmma") {
+ const bool loom_flash = scheduled_name == "loom_libs:ggml_flash_attention_f32_f16_wmma";
+ if (!loom_flash && scheduled_name.compare(0, 4, "hip:") != 0) { … }
+ if (!loom_flash) { continue; } // per-chunk parameters are the LOOM kernel's
- REQUIRE(covered_query_tokens == token_count);
+ if (covered_query_tokens > 0) { REQUIRE(covered_query_tokens == token_count); }The defect is exactly what the body says: "its own FA routes take every prefill chunk, the loop's filter skipped all of them, and the row aborted on 'the plan schedules no flash attention' — which was false." A row that says "the plan schedules no flash attention" when the plan schedules the add-on's flash attention is a false abort, and flash_dispatch_count > 0 was checking a filter, not a fact.
Why the conditional assertions are the right call, not a weakening
Two assertions stay unconditional and two become conditional, and the split follows what each one knows:
REQUIRE(flash_dispatch_count > 0)— stays for both routes, because both scheduling flash attention is the fact under test.REQUIRE(chunk_tokens > 0)andkey_value_token_count == kFullCacheRowCount— readdispatch.kernel.integer_parameters, which are the loom kernel's parameters; on the add-on route the dispatch carries its own set, so asserting the loom's there would be asserting a different kernel's contract.covered_query_tokens == token_count— gated on> 0because the counter is only filled from the loom route. "on the add-on route the loop above contributes 0 and asserting equality would re-introduce the abort this change removes."
The one thing to be clear about is what the row loses: on an add-on tree it now asserts "some FA kernel is scheduled at least once" and nothing about coverage. That is a real reduction, and it is the correct one — the coverage claim belongs to the kernel whose parameter carries it. The row already has a sibling for the add-on's own coverage (#461's cap row and #465's per-row route acceptance), so the coverage of the add-on path is not unasserted, just asserted elsewhere.
Worth one line in the comment
covered_query_tokens > 0 is doing double duty: "the loom route ran" and "there is something to compare". A reader of the diff sees a guard that disables an assertion and has to reconstruct why. // only the loom route reports per-chunk counts; on hip: the coverage claim is not this row's would say it. (The body says it; the code should too, since the body does not travel with the file.)
Relationship to the sibling PRs
#463/#465 accept the add-on's route per row with a recorded name mapping; this fixes a row that counted dispatches per chunk rather than a name, so it is orthogonal and lands cleanly in either order. All three come from the same 397-case add-on run, which is the useful property: one measurement, three fixes, each with the evidence for its own shape.
Refs 1bit-MONSTER/engine#3085 — the third family in that issue, after #461 fixed the split row.
What was wrong
fa_prefill_full_cache.512counts the loom general FA dispatch per chunk, then asserts:With the private add-on built its own FA routes (
hip.fa_prompt_q8w/…q8, both priority 90) take every prefill chunk, so the filter skipped all dispatches and the row aborted claiming "the plan schedules no flash attention" — which is false; the plan scheduled plenty, under other names.The change
Count either route, and keep the per-chunk parameters —
query_token_count,key_value_token_count,apply_gate, the mask binding offsets/lengths — asserted only where they exist, i.e. on the loom kernel:Coverage is the one invariant that cannot be read on the add-on route (it comes from the loom kernel's
query_token_count), so it is made conditional on being readable rather than deleted — a row that silently stopped checking coverage would be worse than one that says why it cannot.Verified, and what is not
compile_commands.jsonfrom a configured HRX build,-fsyntax-only): rc 0, 0 errors.if (!loom_flash) continue;is never taken and both assertions run exactly as before.The two
fa_decode_next_q8.*rows in the same issue are not touched here: that row's subject is the loom next_q8 route, so accepting an add-on route would make it vacuous — the honest resolution there is a tree-shape skip, and I have asked on engine#3085 for the one datum that decides it (what the add-on schedules for that shape) rather than writing it blind.