Repository navigation
test-hrx-ops: the flash-attention rows expect the specialization the matchers actually set (engine#3123) - #470
Conversation
…matchers actually set (engine#3123)
The 26 `common_flash_attention.*` rows assert
`scheduled_kernel_specialization(...).workload_specialization == expected_specialization`, where the expectation is
`Exact` only for 256/256 and `Dynamic` otherwise. No flash-attention matcher ever sets `Dynamic`:
$ git grep -n 'workload_specialization = WorkloadSpecialization::Dynamic' <pin> -- ggml/src
dispatch-get-rows.cpp:231, :299 (get-rows)
dispatch-rope-set-rows.cpp:584 (set-rows)
`scheduled_kernel_specialization()` returns the matcher's `KernelSpecialization`, whose field defaults to `Exact`
(dispatch.h:39), so for an FA kernel the answer is `Exact` at every shape and the 26 non-256/256 rows could not pass
on any pin -- including the pin this assertion was introduced with (`dd9f270f6`), where the same grep finds no FA
matcher either. The failing line in the run is this REQUIRE, not engine#2494's guard: that guard is why the rows pad
`key_value_capacity` for the split kernel (:5091-5094), and they keep doing it.
So the expectation was a guess, and the honest assertion is the value the matchers guarantee. The kernel still has to
be the expected one -- `require_kernel_subsequence` immediately above is unchanged -- and the padded binding stays.
Measured: (to be completed from the gpu-hold run before this is pushed)
36d416c to
d5aec72
Compare
|
Rebased onto Rebuilt and relinked after the rebase ( |
|
VERDICT at d5aec72: READY The premise is the whole PR, so I checked it tree-wide at this head rather than only for the spelling the body used. No flash-attention matcher sets the field — verified, including spellings the grep could miss. Base is the fork tip The row keeps its teeth. Not a template that always says Compile risk is nil without spending a build: the new line is a strict subset of the tokens in the deleted ternary — same qualified type, the same enumerator that was already one branch of it, and the variable is still used two lines below. Arithmetic coheres with the fleet's logs: 26 rows change here (8 + 8 + 8 + 1 + 1) and the one 256/256 row keeps the No pair with the other open fork PR. #467 touches Two things stated rather than buried:
|
The 26 flash-attention rows expect a
Dynamicworkload no matcher sets (engine#3123)tests/hrx-ops-test.cppasserts, for everycommon_flash_attention.*row:REQUIRE(scheduled_kernel_specialization(graph, expected_kernel).workload_specialization == expected_specialization);with
expected_specialization = Exactonly for the single 256/256 shape andDynamicfor everything else. No flash-attention matcher ever setsDynamic:scheduled_kernel_specialization()returns the matcher'sKernelSpecialization, whoseworkload_specializationdefaults toExact(ggml/src/ggml-hrx/dispatch/dispatch.h:39), and the four flash-attention dispatch files mention the field zero times. Nor is it generated: the build tree's generated sources do not set it, and the add-on (gpu-kernels bc3051d) mentions it zero times. Checked atdd9f270f6— the squashed commit that introduced these rows and this expectation — and no FA matcher set it there either, so the 26 rows have never been able to pass on any pin.The 26 are three shapes
decode.head{64..512}.query2.kv65…flash_attention_decode_split_f32_f16_wmma_next_q8prefill.head{64..512}.query16.kv64…flash_attention_f32_f16_wmmaprefill.head{64..512}.query17.kv65decode.head96.query2.kv4.capacity320decode.head320.query2.kv64.capacity64The change
One line plus a comment: the expectation becomes what the matchers guarantee,
Exact. Everything the row actually tests stays —require_kernel_subsequencestill pins the exact expected kernel for each shape, and ggml-org#2494's paddedkey_value_capacityis still built for the five split shapes. The assertion keeps its use: it documents "flash attention is not on the dynamic-workload path", and it fails the day a matcher opts in.Measured
BEFORE/AFTER, host-side (the assertion under test is a property of the scheduler's plan, so it runs with no device):
Every shape observes
Exact, which is what the rows now expect and what they previously called a failure.Honest scope of this measurement: it proves the half that fails — the
workload_specializationREQUIRE — and says nothing about the numeric comparison further down the same row (CPU vs device), which still needs a device. The 26 rows fail at the specialization REQUIRE (:5112), before any compute, so this is the line the issue is about; the full-row green is owed and stated as owed.BEFORE/AFTER on the device (26 rows in one
gpu-holdticket,--hrx-test-filter common_flash_attention): not run — the ticket queued behind a 22-deep GPU queue and a one-hour hold (cl-679-measfix -t 60) and expired. Recorded here rather than replaced with the host-side result, because the two answer different questions.What this is not
Not engine#2494's guard: that guard is why the rows pad
key_value_capacity(:5091-5094) and that code is untouched. The failing line is the specializationREQUIREtwo lines below it.And it is one bad idea, not one bad row:
hrx-ops-test.cppassertsDynamicin six places and only two are satisfiable (ggml_get_rows_f32, which get-rows sets;ggml_rope_f32, which rope-set-rows sets). The others —ggml_rmsnorm_f32(:2298),ggml_scale_f32(:2754), the generic FA wmma (:5188), unary/copy/concat (:5825) — are the same defect and belong in their own issues, which I said on engine#3123 rather than folding them in here.One more of the same class, deliberately not touched
tests/hrx-backend-test.cpp:6995assertsDynamicforloom_libs:llm_ssm_conv_binary_f32, which no matcher sets either — the same defect in a different suite. It is already covered by the fork ratchet's known-fail list (hrx-backend-test # Failed -- hrx), so it is not hiding, and it is not this issue's row list. Fixing it here would put two suites' expectations in one PR and make the ratchet's baseline move unexplained; it belongs with that suite's own row.After this lands
The engine pin has to move before any engine CI row can see it: the 26 rows live in
third_party/llama.cpp'stests/hrx-ops-test.cpp, so the fix reaches engine CI only through the next pin bump. That is a separate engine PR on the pin lane, not something this one can do, and saying it here means the fix does not sit green in the fork while the engine still reports 26 reds.