Skip to content

hrx-ops-test: the get_rows_f32 rows expect what the matcher sets (engine#3126) - #473

Closed
bong-water-water-bong wants to merge 1 commit into
1bit/hrx-vulkan-patchedfrom
3126-rows-expect-what-matcher-sets
Closed

bong-water-water-bong wants to merge 1 commit into
1bit/hrx-vulkan-patchedfrom
3126-rows-expect-what-matcher-sets

Conversation

@bong-water-water-bong

Copy link
Copy Markdown

The ten get_rows_f32 rows, fixed from the layer that decides what they were asserting. Claimed for this lane — the issue has had no owner since 05:10 and the precedent for the fix is #470 (48d7eeb7c), which corrected the flash-attention rows the same way for ggml-org#3123.

What the rows asserted, and what dispatch emits

tests/hrx-ops-test.cpp:6207   specialization.workload_specialization == Dynamic
tests/hrx-ops-test.cpp:6210   compile_parameters["ggml.get_rows_f32.token_capacity"] == next power of two

dispatch-get-rows.cpp:512     compile_parameters["ggml.get_rows_f32.token_capacity"] = match.token_count   (exact)
dispatch-get-rows.cpp:513     compile_parameters["ggml.get_rows_f32.hidden_capacity"] = match.hidden_size   (exact)
dispatch.h:39                 workload_specialization defaults to Exact
                              the only three sites that set Dynamic: rope-set-rows:584, get-rows:231, get-rows:299
                              — and :231/:299 are repeat_scalar_3d_f32, not this family

So a bucketed capacity class was never implemented: the parameter is named token_capacity and carries the exact count, and Dynamic is not set for this family at all. The rows have been red since the suite existed, naming an intent no code implements — and a red row that names an unimplemented intent teaches nobody (it cannot distinguish "the matcher changed" from "the row was always wrong", which is exactly the confusion ggml-org#3126 was filed out of).

The change

Exact, the exact token_capacity, the exact hidden_capacity (the second one for the same reason and with the same evidence), and a comment carrying the four file:line facts above so the next reader does not have to re-derive them.

The row keeps its teeth: it still fails if the scheduled kernel is not the fused loom_libs:ggml_get_rows_f32, and it fails if either compile parameter goes missing or is mis-scaled — which is what a test of a scheduler can honestly assert.

If the bucketing was intended

Then the fix is in add_common_compile_parameters() (round both capacities up to a power of two, set Dynamic) with its own issue and its own run — not a row that asserts it first. I have said so in the comment and on ggml-org#3126, because that decision belongs to whoever owns the get_rows matcher, not to a red row.

Verification

  • -fsyntax-only with the pinned tree's own compile command (from a build at the pin, paths remapped): rc 0.
  • Not run: the rows need the device. In a pin they go from abort-at-the-assertion to comparing values against the CPU reference, so if there is also a numeric defect in this family it will surface there rather than stay hidden behind the name check — the same caveat metal: more PP speedup for Falcon ggml-org/llama.cpp#3123's lane attached to 48d7eeb7c, and it is the honest one.

…ine#3126)

Ten rows failed on one assertion each:
  :6207  specialization.workload_specialization == Dynamic
  :6210  compile_parameters["ggml.get_rows_f32.token_capacity"] == next power of two

Neither is what dispatch emits for this family, read at this pin:

  dispatch-get-rows.cpp:512   token_capacity  = match.token_count    (exact)
  dispatch-get-rows.cpp:513   hidden_capacity = match.hidden_size    (exact)
  dispatch.h:39              workload_specialization defaults to Exact; the only three
                             sites that set Dynamic are rope-set-rows:584 and
                             get-rows:231/:299 (repeat_scalar_3d_f32), not this family

So a bucketed capacity class was never implemented -- the parameter is named capacity and
carries the exact count -- and the rows have been red since the suite existed, naming an
intent no code implements. They now expect what the scheduler sets, the same correction the
flash-attention rows got for engine#3123 (#470); the row still fails if the fused get_rows
kernel is not the one scheduled, or if either parameter goes missing or mis-scaled.

If capacity bucketing is wanted after all, it is a change to
add_common_compile_parameters() with its own issue and its own run, not a row that asserts
it first.

Checked: -fsyntax-only with the pinned tree's own compile command (from a build at the pin,
paths remapped) -> rc 0. Not run: the rows need the device; the ten of them go from abort to
comparing values against the CPU reference once this lands in a pin.
@bong-water-water-bong

Copy link
Copy Markdown
Author

Closing this — the opposite direction is the right one, and #467 has the evidence I did not go and read. My patch made the rows expect Exact + the exact count, on the precedent of #470 (row-side, for ggml-org#3123). That precedent does not carry to this family, and #467's own change says why:

ggml/src/ggml-hrx/dispatch_registration/common/dispatch-get-rows.cpp (in #467)
  "Every config that reaches here except the rmsnorm fusion assumes le(token_count, token_capacity)
   and guards each write with token0 < token_count, so one compiled program serves the whole class --
   which is what hrx-ops-test's get_rows_f32 rows pin … and what dispatch-rope-set-rows.cpp already
   does for rope under WorkloadSpecialization::Dynamic."

So the kernel configs are written for a capacity class, a sister matcher (rope-set-rows) already emits one, and pinning the exact count compiles one program per prompt length (the executable key carries the compile parameters). That makes the power-of-two assertion in the row the spec, not a stale intent — and my "the parameter is named capacity but carries the exact count, so bucketing was never implemented" was a reading of the call site that ignored the kernel side it feeds. #470's case was different in exactly that respect: there the config carried no shape at all.

#467 also predates this PR by two hours (04:46 vs 07:0x), so mine is the duplicate as well as the wrong direction. Both are my error: I checked the fork's open PRs before claiming ggml-org#3116 and ggml-org#3120 and did not re-check before claiming ggml-org#3126 — which is the rule I have been applying to other lanes all night.

Branch deleted with the close. #467 is DIRTY against the branch tip; the conflict is most likely dispatch-rope-set-rows.cpp, whose Dynamic sites #470 touched when it merged — that rebase is the only thing between the right patch and the pin.

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.

1 participant