Skip to content

Laya: proof on the HRX engine; route tests read the build's candidates - #285

Merged
bong-water-water-bong merged 2 commits into
mainfrom
laya-proof-hrx-2026-10-02
Oct 2, 2026
Merged

bong-water-water-bong merged 2 commits into
mainfrom
laya-proof-hrx-2026-10-02

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Proof that Laya routing works in the engine as it ships now (HRX only). Measured on Strix Halo in balanced power mode (85 W), engine main 6f324e4, fork pin d60cc4f, built with -DONEBIT_HRX=ON -DONEBIT_LAYA_GGML=ON. The tables are in the new docs/laya.md section "Proof on the HRX engine (2026-10-02)".

Results

  • laya_gate: PASS on root and on typed-decisions/ (max logit diff 2.6e-6 / 3.1e-6).
  • Classifier on the 200 labelled cases: 95.5% on the C++ CPU scorer (687 ms a decision under thermal-run) and 95.5% on the GGUF scorer on HRX0 (p50 23.7 ms). The two confusion matrices are identical. Determinism is 12/12 on each.
  • serve --laya with Qwen3-4B on HRX, 48 requests (12 a class) over 3 rounds: 48/48 classes right, all routed to hrx, and +31 ms added to time to first token (pooled medians). A long_doc adds 0 ms. The route cache reused the decision on 16/16 later turns.
  • Agent dispatch with 1bit route --classify: 24/40 right (60%). Out of domain; the details are in the doc.

Two stale test expectations (fixed here)

  1. tests/laya_route_e2e.sh got its expected device from --devices vulkan,hrx,zinc. In an HRX build, serve offers hrx,zinc (plus rocm with lean ROCm), so short correctly fell back to hrx and the test failed. The test now reads the candidates from the build's CMakeCache.txt, the same way gguf_devices() picks them.
  2. tests/laya_gguf_route.sh checked the error for "--laya-model FILE.gguf without ggmlc's laya". A -DONEBIT_LAYA_GGML=ON build always finds its own laya, so serve tried to start it on the empty test GGUF. In that build the check now prints skip ... (skipped: built-in laya present).

Before:

laya_route_e2e.sh
FAIL [What is 17*23?] class short -> vulkan, reply from vulkan
FAIL   X-1bit-Route header (short 0.24 hrx)
(9 other checks ok) -> FAIL, rc=1
laya_gguf_route.sh
FAIL --laya-model FILE.gguf without ggmlc's laya says how to build it
(9 other checks ok) -> FAIL, rc=1

After:

laya_route_e2e.sh
candidates: hrx,zinc
ok   [What is 17*23?] class short -> hrx, reply from hrx
ok     X-1bit-Route header (short 0.24 hrx)
11/11 ok, rc=0
laya_gguf_route.sh
skip --laya-model FILE.gguf without ggmlc's laya says how to build it (skipped: built-in laya present)
9/9 ok, rc=0

Builds without HRX or ggmlc's laya, as in CI, keep the old expectations.

Leftover Vulkan names (not changed here)

These route nothing under the current policy:

  • 1bit route defaults to --devices npu,hrx,vulkan,zinc.
  • laya/route.cpp still lists vulkan in its device descriptions.
  • In docs/laya.md, the usage example shows vulkan output, and the "Why every class goes to Vulkan today" paragraph predates the HRX-only build.

🤖 Generated with Claude Code

docs/laya.md gains "Proof on the HRX engine (2026-10-02)": gates, 95.5% on
the CPU scorer and the GGUF scorer on HRX0 with the same confusion matrix,
determinism, serve --laya end to end on Qwen3-4B (48/48 to hrx, +31 ms time
to first token, route cache), what still names Vulkan or ROCm, and agent
dispatch (60%, out of domain).

tests/laya_route_e2e.sh took the expected device from --devices
vulkan,hrx,zinc; an HRX build offers hrx and zinc (rocm with lean ROCm), so it
now reads them from the build. tests/laya_gguf_route.sh skips, and says so,
the "without ggmlc's laya" check in a -DONEBIT_LAYA_GGML=ON build, which
always finds its own laya.

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

context7 Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Docs7 for 1bit-monster/engine

Result Status Action
Deployment ➖ Not used —
Content review ➖ Did not run. This site has no agent runs available this month. Wait for the monthly reset or check your Docs7 plan. —

Commit 0105ec5

@bong-water-water-bong
bong-water-water-bong merged commit 702dc3c into main Oct 2, 2026
10 of 11 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the laya-proof-hrx-2026-10-02 branch October 2, 2026 12:44
bong-water-water-bong added a commit that referenced this pull request Nov 10, 2026
… in all-NaN logits (fixes #1539) (#1987)

Carries fork #284 and #285 (the routed-expert and dense matmul kernels
keep their activations inside the half-precision range) and #283. Adds
the docs/hrx.md section for the fix; the first part of #1962.

Co-authored-by: bong-water-water-bong <[email protected]>
Co-authored-by: Claude Fable 5.2 <[email protected]>
bong-water-water-bong added a commit that referenced this pull request Nov 13, 2026
…uted GEMM fit (#572) and the registration guard (#2316)

* gpu-kernels: pin eb0f3839, which carries the 2^-6 prefill prescale (#2159), the routed GEMM fit (#572) and the
registration guard

Upstream merged three kernel fixes today and the engine still pinned the commit before them:

  gpu-kernels main   eb0f383972039bb2292f0d9f740b1020fcd3a1e1
  gpu-kernels#68     the prefill GEMM keeps activations inside the f16 range (2^-6 prescale, the llama.cpp #285/#288 shape)
  gpu-kernels#67     the routed-expert prefill GEMM fitted to Qwen3.8-Flash-Next
  gpu-kernels#66     registration fails when a HipKernel has no launch
  engine pin was     fd69590c6c471507f6d804751f38473261436350

So the engine now builds the kernels that carry them. The sha is advertised by the remote (checked with `git ls-remote`, not
assumed) and the config's format is unchanged: `scripts/fetch-private.sh` checks out exactly this commit at build time.

This changes the compiled kernels in every HRX build, which is the point and also the risk: the code objects the release
ships come from this checkout, so the first HRX build after this PR is the one that proves the bump. #2159's fix was measured
by the kernel lane on these kernels (the MUL_MAT_ID rows and the 12 dense magnitude rows in #2293), so the prescale is not a
guess.

One doc line had to change with it: docs/hetero-prefill.md said "`origin/main`'s `config/gpu-kernels.config` pins fd69590c…",
which stops being true the moment this lands. It now says "at the time of this capture pinned", which keeps the argument
(the pin carried the fix then; the capture's runtime was stale) without asserting anything about today's pin.

* gpu-kernels: pin b0ed206, which carries both f16-range fixes (#2159, #2293) and the QSA/mask work behind them

Two commits past the previous bump, and both are the ones the issue threads are waiting on:

  #68  aa25474  the prefill GEMM keeps activations inside the f16 range (2^-6 prescale, undone before the epilogue)
  #70  dccd024  dense prefill and small-batch K-quant activations finite above the f16 range (engine #2293)

#70 is #2293's part 2 -- the 12 dense magnitude rows that had no fix when the issue was filed. Its comment in
hrx_dense_prefill.hip names the issue and the rows: "an activation above 65504 became inf in the narrowing and the result
NaN (engine #2293: test-backend-ops MUL_MAT magnitude=91000 on q8_0 / iq4_xs / q5_K / q6_K)". #68's comment in
hrx_prefill_gemm.hip names #2159's failure the same way.

Verified by fetching the pin with this branch's config (1.4 s, shallow sparse checkout) and reading the two files, not by
trusting the PR titles: both carry kXs = 0.015625f / kXsInv = 64.0f with those comments.

The range is TEN commits, not the three the previous body named -- the full inventory is in the PR body, because the review
at bd8fe4b was right that a count of three understated what a reader is being asked to accept.

---------

Co-authored-by: bong-water-water-bong <[email protected]>
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