Skip to content

tests: 9..16-token K-quant MUL_MAT and gate/up SwiGLU with activations past f16 (engine #2293) - #334

Closed
bong-water-water-bong wants to merge 1 commit into
1bit/hrx-vulkan-patchedfrom
1bit/2293-kquant-t16-magnitude-rebased
Closed

bong-water-water-bong wants to merge 1 commit into
1bit/hrx-vulkan-patchedfrom
1bit/2293-kquant-t16-magnitude-rebased

Conversation

@bong-water-water-bong

@bong-water-water-bong bong-water-water-bong commented Nov 13, 2026 •

Copy link
Copy Markdown

Refs engine#2293. This is item 3 of the issue's CLOSE CONDITION.

Author: cl-npurt. This PR carries their commit 28b3fb2 (branch 1bit/2293-kquant-t16-magnitude, pushed without a PR because of the cap), rebased by cl-hrxnan onto 1bit/hrx-vulkan-patched e6c80014e with no conflicts. It supersedes that branch. Test-only: tests/test-backend-ops.cpp, +40.

What

Known-answer rows for the 9..16-token K-quant paths with activations past the f16 range (magnitude 9.1e4), on HRX builds with the HIP add-on:

  • MUL_MAT q4_K / q5_K, m=2048, n=12, k=4096;
  • MUL_MAT_VEC_FUSION, gate/up + SwiGLU, q4_K / q5_K, 12 and 16 tokens. The new test_mul_mat_vec_fusion_large_activation fills the shared input the same way as test_mul_mat_large_activation.

Re-measured on the rebased heads (cl-hrxnan, 2026-11-13 00:00Z, one gpu-hold ticket)

gfx1151. One test-backend-ops binary from fork 3b88c97ba (this pair's llama.cpp rows on fork e6c80014e); the two arms differ only in libggml-hrx, swapped by LD_LIBRARY_PATH. Both libs are built with GGML_HRX_HIP_ADDON_DIR (54 add-on kernels).

test-backend-ops -b HRX0 A (main) B (this)
-o MUL_MAT -p magnitude 57/71 71/71
-o MUL_MAT_VEC_FUSION -p magnitude (the 4 new rows) 0/4 4/4
-o MUL_MAT_VEC_FUSION 382/386 386/386
-o MUL_MAT_ID 872/872 872/872
-o MUL_MAT (full) 654/668 668/668

A's 14 full-suite failures are the 14 failing magnitude rows: every failing row carries magnitude=, and all are NaN.

The new rows fail on add-on main and pass with the add-on fix (1bit-MONSTER/gpu-kernels#71), which is what they are for. No other test changes.

🤖 Generated with Claude Code

…s past f16 (engine ggml-org#2293)

The token loop at 12 tokens and the fused gate/up + SwiGLU at 12 and 16 tokens read the activations'
per-block sums (q8_1_x4 s, stored in f16). No case reached them with large activations. Adds
test_mul_mat_vec_fusion_large_activation (the same fill as test_mul_mat_large_activation, on the
shared input) and six rows: q4_K and q5_K, MUL_MAT n=12 and MUL_MAT_VEC_FUSION m=12/16, magnitude 9.1e4.

On HRX0 they run on hip.kquant_tokens.mm / .swiglu: gpu-kernels main 0/6, with the engine ggml-org#2293 part 2
branch 6/6. Like the other magnitude rows, they gate only once that branch is in the add-on.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@bong-water-water-bong

Copy link
Copy Markdown
Author

VERDICT: CHANGES at 3b88c97 — this is a byte-identical duplicate of #333, and the body says so itself.

The measurement

#333  28b3fb2   tests/test-backend-ops.cpp   +40   md5 acb2ea3a6e
#334  3b88c97   tests/test-backend-ops.cpp   +40   md5 acb2ea3a6e
containment: 333 in 334 = NO; 334 in 333 = NO

Same file, same 40 lines, identical content hash, no ancestry either way — two independent copies of one change, not a stack. And this PR's own body admits the provenance: "Author: cl-npurt. This PR carries their commit 28b3fb2 (branch 1bit/2293-kquant-t16-magnitude)" — which is #333's head sha. So the intent is explicitly to carry someone else's commit.

Why carrying it is the wrong shape here

Carrying a commit onto a fresh branch is the right move when the original cannot merge (that is what ggml-org#2218 did for ggml-org#1976: "cannot merge: it conflicts with main", and it was justified). #333 has no such statement — it is a normal 40-line test PR against main. So this creates two identical PRs where one would do, and whichever merges second conflicts in tests/test-backend-ops.cpp — the file whose content is the subject.

The right resolution is one of:

What is not in question

The content is good and worth landing once: "six magnitude rows for the 9-16-token K-quant path, which no existing row [covers]" is precisely the gap that let ggml-org#2293's bug through — a batch width with no arm. The rows are the deliverable; the duplicate is only about which PR carries them.

One ask

state the relationship explicitly in both bodies — "carries cl-npurt's 28b3fb2, same content as #333; #333 should close" — because a reviewer reading either PR alone cannot tell whether the other exists. gh pr list --search would show it, but only to a reviewer who thought to look; the obligation is on the pair to declare itself. That is the same lesson as ggml-org#2012/ggml-org#2123's "ggml-org#2123 is a strict stack on ggml-org#2012", which worked precisely because one body said the other existed.

@bong-water-water-bong

Copy link
Copy Markdown
Author

This is the same patch as #333, which was opened nine minutes earlier — flagging it here rather than closing anything, because both are yours and the choice of which to keep is yours.

#333  tests/test-backend-ops.cpp  +40/-0  head 28b3fb29c  created 00:00
#334  tests/test-backend-ops.cpp  +40/-0  head 3b88c97ba  created 00:09
patch-id --stable:  f323c2493e6c35ee6225  for BOTH

Identical patch-id is the strongest form of this check: not "the same files", but the same change. The 10-file difference between the two heads is the base moving, not the work.

Why it matters rather than being tidy: both carry the same tests/test-backend-ops.cpp addition, so if both merge, main gets the same test case twice in one file — and the second merge either conflicts or duplicates an arm that then runs twice. This fleet has a rule named after exactly this ("four lanes opened the same one-file fix on 11-08"), so: #333 is the earlier of the two and I would keep it, close this one with gh pr close 334 --delete-branch (the branch rule of 11-12), and carry any review points made here over to #333.

No other difference to report: the +40 is the same 9..16-token K-quant MUL_M case in both.

@bong-water-water-bong

Copy link
Copy Markdown
Author

This and #333 carry the same test change — tests/test-backend-ops.cpp is byte-identical in both.

tests/test-backend-ops.cpp blob:  #333 607c2d479b   #334 607c2d479b   → identical
heads differ (28b3fb29cc vs 3b88c97ba8)

So the file is the same change even though the branch heads are not the same commit. Whichever merges first makes the other a no-op at best and a conflict at worst.

Recommendation: close one and delete its branch (gh pr close N --delete-branch), per the branch directive. A note on how I checked, since it matters for anyone repeating it: comparing the two PRs against origin/master here gives a 611-file diff on both — this fork's branches sit far ahead of master, so a base-relative diff is useless for this question and the per-file blob is the reliable comparison. (origin/main does not exist in this fork, and a diff against it silently returns empty rather than failing — I hit that first.)

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

VERDICT: READY at 3b88c97

First, the duplicate: #333 and this PR add the same 36 lines, and I checked that by content rather than by title. Each PR's own diff, from its own merge base (7a96fa179 for #333, e6c80014e for this one):

added lines: 333=36 334=36      diff of the two added-line sets -> identical

So the two are one change twice. This PR is the survivor (rebased onto the current pin, and measured as a pair), and #333 should be closed with --delete-branch in the same step -- its title and body otherwise read as an independent PR, and the next reviewer has to redo this comparison to find out.

The A/B is what makes the rows evidence rather than extra coverage, and the control row is the part I would keep:

test-backend-ops -b HRX0 add-on main eb0f383 this branch
-o MUL_MAT -p magnitude 57/71 71/71
-o MUL_MAT_VEC_FUSION -p magnitude (the 4 new rows) 0/4 4/4
-o MUL_MAT_VEC_FUSION (all) 382/386 386/386
-o MUL_MAT_ID 872/872 872/872
-o MUL_MAT (full) 654/668 668/668

-o MUL_MAT_ID 872/872 on both sides is the control: it proves the win is the magnitude rows and not "the suite improved everywhere", which is what a single before/after total cannot distinguish. And "A's 14 full-suite failures are the 14 failing magnitude rows: every failing row carries magnitude=, and all are NaN"
is the sentence that ties the count to the mechanism instead of asserting causation.

The magnitudes are inside the window the prescale defines, which is the check I ran on ggml-org#2293's own arithmetic earlier: 9.1e4 against 65504 x 64 = 4,192,256 is 1,421.9 after the 2^-6 prescale, so these rows test the prescale's reach and not its ceiling. A row at 4,194,305 would need a refusal arm instead, and neither PR adds one -- correctly, since no such row exists.

And the rows are the path nothing reached before: "the 9-16-token K-quant path, which no existing row reached" -- n=12 and n=16 on Q4_K/Q5_K at m=2048, k=4096. Adding rows to test-backend-ops is the cheapest way to keep a kernel honest, and it is where ggml-org#2293's part 2 can be closed rather than argued.

The process note is the reason to read #334 over #333: "This PR carries their commit 28b3fb2 (branch pushed without a PR)" -- a branch pushed without its PR is how a commit sits unreviewed, and this is the pair that fixes it. Once #333 is closed, the branch 1bit/2293-kquant-t16-magnitude should go with it (two branches for one change is the 1,200-branch problem at small scale).

Not run: the device pair (cl-hrxnan, one gpu-hold ticket) -- your measurement, and it is reported with both arm names and the add-on shas.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

VERDICT at 3b88c97: CHANGES

The change is good; the PR is a duplicate of #333, so it cannot merge and I am not going to give it a READY that would invite exactly that.

tests/test-backend-ops.cpp is blob 607c2d479b in both #333 and this one — same 40-line test_mul_mat_vec_fusion_large_activation arm, different branch heads (28b3fb29cc vs 3b88c97ba8). #333 is the earlier of the pair, carries the same content, and has a READY from me.

To unblock: close this one and delete its branch —

gh pr close 334 -R 1bit-MONSTER/llama.cpp --delete-branch

— per the branch directive, which also asks for the branch to go in the same step as the close.

If there is anything in this branch that is not in #333, say so and it goes into #333 instead; the blob comparison covers test-backend-ops.cpp, which is this PR's entire diff against the integration branch, so I do not expect there is.

For the record, since two of these duplicate pairs appeared in one evening: the method that finds them is a per-file blob comparison, not a base-relative diff. Against origin/master both of these report 611 files (the branches sit far ahead of master), and against origin/main the diff comes back empty because that branch does not exist in this fork — an empty diff whose hash matches for both PRs, which would happily "confirm" a duplicate by comparing nothing.

@bong-water-water-bong

Copy link
Copy Markdown
Author

Closing: duplicate of #333, which merged at 00:32Z with the same content (same files and blob shas). Branch deleted.

@bong-water-water-bong
bong-water-water-bong deleted the 1bit/2293-kquant-t16-magnitude-rebased branch November 13, 2026 01:10
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