Skip to content

npu-lax: state the parity protocol (NPU routing adopted) - #81

Merged
bong-water-water-bong merged 1 commit into
mainfrom
lax-parity-protocol
Sep 25, 2026
Merged

bong-water-water-bong merged 1 commit into
mainfrom
lax-parity-protocol

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

The engine said "parity against fp64" for the 35B NPU decode without saying how the reference was run.

make_decode.py (OpenFlowLM-Next, at the engine's pin 2490fa6) re-uses the NPU's expert choice wherever a previous NPU run's router disagrees with the reference's own top-8. It prints each disagreement, and --strict-routing opts out. That's the right protocol for checking the arithmetic, because a near-tie in the 8th slot can't then look like a numerical error. But it doesn't measure the routing decisions themselves.

This PR says so in the README and docs/npu-lax.md. A --strict-routing run, which measures routing agreement, is a separate number and isn't recorded yet. No code change.

🤖 Generated with Claude Code

… adopts the NPU's routing)

make_decode.py re-uses the NPU's expert choice where the two routers disagree (--strict-routing
opts out), so the engine's corr / argmax numbers measure the arithmetic given the same experts.
The README and docs/npu-lax.md now say so; routing agreement is a separate measurement.

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

context7 Bot commented Sep 25, 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 0143c7e

@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Ambiguous Parity Claim

The documentation states that the NPU's arithmetic matches an fp64 reference "given the same routed experts" and that the reference adopts the NPU's expert choice where they differ. However, it does not clearly specify how the "same routed experts" are ensured or whether this is consistently applied across all test cases. This ambiguity could lead to inconsistent interpretation of what constitutes a valid parity check, especially when the NPU and reference disagree on expert selection.

It matches an fp64 reference given the same routed experts (the reference adopts the NPU's
expert choice where they differ; "Parity" below), and it decodes at 16.3-16.5 tok/s.
Missing Routing Agreement Measurement

The documentation notes that make_decode.py --strict-routing measures routing agreement, which is a separate metric from arithmetic parity. However, it also states that this routing agreement number is "not yet recorded here." This creates a disconnect between the documented protocol and the actual tracking of performance metrics, potentially leading to confusion about the completeness of the benchmarking effort.

decisions. `make_decode.py --strict-routing` keeps the reference's own top-8. A run with it
measures routing agreement, which is a separate number, not yet recorded here.

@bong-water-water-bong
bong-water-water-bong merged commit 8313ce0 into main Sep 25, 2026
5 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the lax-parity-protocol branch September 25, 2026 13:31
bong-water-water-bong added a commit that referenced this pull request Oct 5, 2026
…-Next) (#311)

* Bump HRX: llama.cpp e57beb9721af (fork #81-#83, #86-#88)

Moves third_party/llama.cpp (1bit-MONSTER/llama.cpp 1bit/hrx-vulkan-patched)
2e5fcf56a24d -> e57beb9721af; hrx-system stays at 51b1739ae5fd.
Registry regenerated at the new pin: 290 -> 292 architectures (qwen4exp).

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* Bump HRX: registry at the committed pin; qwen4exp is mapped now

registry/architectures.json was generated against the previous gitlink
(registry_pins failed). tests/device_route.sh used qwen4exp as its
"not built" example; at this pin Flash-Next runs on HRX, so the test now
checks it takes the plain route and keeps zamba2 as the refused example.
Docs that listed qwen4exp as unbuilt say it is back.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

---------

Co-authored-by: bong-water-water-bong <[email protected]>
Co-authored-by: Claude Fable 5.1 <[email protected]>
bong-water-water-bong added a commit that referenced this pull request Nov 14, 2026
… swiglu tile registered, Q4K_STORED opt-out) (#2449)

* config: gpu-kernels pin 965936607 -> 260115d6d (27B Q4_K prefill on the HIP dense-prefill kernels, +26 %; the m64 swiglu tile registered)

gpu-kernels 96593660..260115d6d is four PRs:
- #79 / #80: the plain m64 swiglu tile is built and swiglu_tile() asks for it below 256 tokens;
- #81, reverted by #83: no net change (the HIP MoE down kernels stay opt-in);
- #84: 256-aligned Q4_K prefill on a weight decode reads stored goes to the HIP dense-prefill
  kernels instead of Loom's q8_1_x4 kernel (69 % of a 27B Q4_K_M ubatch), and the plain m64
  swiglu tile #79 built is registered. Without that registration, every HIP swiglu batch under
  256 tokens fails on gpu-kernels main ("cataloged kernel ... is not available in the active
  corpus", 1bit serve's warm-up returns 500), so #79 must not be pinned without #84.

Measured on Qwen3.8-27B Q4_K_M, gfx1151 (gpu-kernels#84, issuecomment-6882820957): paired
interleaved A/B x3, 2,200-token prefill +25.6 % warm / +26.0 % cold (medians.py: disjoint);
KLD 32 x 512 vs the old routing 0.000277, same top p 99.29 %.

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

* config: gpu-kernels pin -> 6105368c5 (adds #85: probe fix, tile-completeness check, GGML_HRX_HIP_DENSE_PREFILL_Q4K_STORED=0 opt-out)

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

---------

Co-authored-by: bong-water-water-bong <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
bong-water-water-bong added a commit that referenced this pull request Nov 24, 2026
…its upstream bound is now the hold window plus the resume (#3484)

engine#3478 (found while closing #3350). A held turn waits inside Lemonade's load path with NO bytes on the wire until
the hold ends (Router::wait_for_slot_clearance, third_party/lemonade src/cpp/server/router.cpp:783/:829; the hold is
taken by 1bit-heavy, POST /api/v1/hold), and the appliance page's fetch has no timeout of its own
(os/v3/puppy/embed/opt/1bit/webapp/index.html:232). So 1bit-webapp-proxy's upstream socket timeout was the only
deadline a held turn had: 900 s (os/v3/puppy/embed/usr/local/bin/1bit-webapp-proxy:91), while 1bit-heavy's default
hold window is 3600 s (os/v3/puppy/embed/usr/local/bin/1bit-heavy: maxs=3600, --help "(default 3600)"). A hold
between 15 and 60 minutes cut the page's turn - the socket timeout lands in the proxy's OSError arm, so the page got
502 "Lemonade is not answering" - while the hold was healthy.

- the proxy's bound is now UPSTREAM_TIMEOUT = HOLD_WINDOW + RESUME_GRACE = 3600 + 900 = 4500 s: the window a held turn
  can wait (Lemonade ends the hold at max_seconds even if the wrapper is alive, heavy_work_hold.cpp:120-130) plus the
  reload of the captured models before the waiting request runs (measured first loads: 93 s stick / 154 s disk,
  docs/releases.md). 900 s was the proxy's previous whole-request bound, so nothing that fitted inside one socket
  timeout before gets a shorter one after a hold.
- ONEBIT_WEBAPP_UPSTREAM_TIMEOUT overrides the bound (the test drives it in seconds; an operator can raise it).
- tests/webapp_proxy_hold_timeout_test.sh: the window in 1bit-heavy and the proxy's HOLD_WINDOW are one number (CI fails
  if they drift), the bound is window + resume, and a fake silent (held) Lemonade is forwarded inside the bound and
  answers 502 AT the bound, not at the stall. CMake row webapp_proxy_hold_timeout.
- os/v3/puppy/README.md's 1bit-heavy row now carries the contract - a held turn waits up to 3600 s, the page's proxy
  4500 s - and the streaming caveat: a held streaming turn is silent, there is no ": held" keepalive yet (the
  Lemonade-fork half of #3478, not this lane).

Not done here: the ": held" keepalive needs the Lemonade fork plus a pin bump. A hold taken with --max-seconds above
3600 can still outlast the page's proxy; that is the operator opting past the appliance's default window, and the
README says so.

Evidence:
$ sh tests/webapp_proxy_hold_timeout_test.sh                  # branch
ok   1bit-heavy carries the hold window (maxs=3600)
ok   the proxy's hold window (3600 s) is 1bit-heavy's --max-seconds default (3600 s)
ok   the upstream timeout (4500 s) is the window plus the resume (3600 + 900)
ok   the resume does not go below the 900 s the socket allowed before (900 s)
ok   the bound outlasts a whole default hold (4500 s > 3600 s)
ok   a silent (held) upstream inside the bound is forwarded: HTTP 200 after 1 s, {"answered": true}
ok   a stall past the bound answers 502 at the bound (HTTP 502 after 1 s for a 3 s stall, bound 1 s)
webapp_proxy_hold_timeout_test: ok

Control: the same test file in a throwaway worktree at origin/main (ad10a17), scripts untouched, test copied in:
ok   1bit-heavy carries the hold window (maxs=3600)
FAIL the proxy derives its bound from the hold window (HOLD_WINDOW/RESUME_GRACE/UPSTREAM_TIMEOUT: none) - it still hardcodes 900 s, shorter than the 3600 s hold window
ok   a silent (held) upstream inside the bound is forwarded: HTTP 200 after 1 s, {"answered": true}
FAIL a stall past the bound answers 502 at the bound (HTTP 200 after 3 s for a 3 s stall, bound 1 s)
webapp_proxy_hold_timeout_test: FAIL (exit 1)

$ ctest --test-dir build -R 'webapp_proxy_hold_timeout|heavy_wrapper|release_check_hold_cycle' --output-on-failure
1/3 Test  #80: heavy_wrapper ....................   Passed   31.18 sec
2/3 Test  #81: webapp_proxy_hold_timeout ........   Passed    2.39 sec
3/3 Test #160: release_check_hold_cycle .........   Passed    0.02 sec
100% tests passed, 0 tests failed out of 3

Gate: scripts/pre-pr-checks.sh --tree-only --base origin/main
pre-pr-checks: all 15 check(s) green, 3 skipped, 0 could not be told, 2 open-PR row(s) not run (--tree-only)

Refs #3478.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant