Repository navigation
1bit serve --embedding / --reranking (Lemonade checklist #4) - #70
Conversation
…role Lemonade loads embedding and reranking models as models of their own; 1bit serve only served them as companions of a chat model (--embed, --rerank). The role runs llama-server on the device asked for (vulkan, hrx, rocm) with --embedding / --reranking and serves /v1/embeddings or /v1/rerank. Strix Halo: embeddings on Vulkan and HRX, rerank on Vulkan; rerank on HRX hits an HRX JIT link failure (fp32 mul_mat+bias), documented. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Docs7 for 1bit-monster/engine
Commit |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
…512 tokens, deterministic flash attention llama.cpp fork since cebcd70 (balanced mode, figures from each PR): - #66 MUL_MAT_ID at multiples of 32 plus a decode-loader stride fix; #67 ADD_ID and SWIGLU_OAI on HRX; #73 a placement guard for the CPU/HRX split bug (engine #286). gpt-oss-20b MXFP4: pp512 25.8 -> ~1000, tg128 12.6 -> ~35 tok/s, text correct, KLD vs CPU 0.029. - #69 TQ1_0/TQ2_0 on HRX: Ternary-Bonsai-1.7B KLD vs CPU 0.000523; pp512/tg128 3542/113 and 4100/156. - #70 MLA V transpose: GLM-4.7-Flash prompts of 512+ tokens gave garbage (PPL 315,664), now 5.916 (CPU 5.959). - #71 llama-hadamard folds qwen3next's ssm_ba and refuses unfoldable stamped files. - #72 masked flash-attention keys reach P*V as V = +0: identical requests now give identical logits (Qwen3-0.6B and Qwen3.8-27B bit-identical repeats); pp512 -4.7% on Qwen3-0.6B. Docs: docs/hrx.md "Our patches". Registry regenerated (no mapping changes). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…tic FA, attention sinks) (#295) * Pin llama.cpp 2bd7f58: gpt-oss on HRX, TQ1_0/TQ2_0, MLA prompts past 512 tokens, deterministic flash attention llama.cpp fork since cebcd70 (balanced mode, figures from each PR): - #66 MUL_MAT_ID at multiples of 32 plus a decode-loader stride fix; #67 ADD_ID and SWIGLU_OAI on HRX; #73 a placement guard for the CPU/HRX split bug (engine #286). gpt-oss-20b MXFP4: pp512 25.8 -> ~1000, tg128 12.6 -> ~35 tok/s, text correct, KLD vs CPU 0.029. - #69 TQ1_0/TQ2_0 on HRX: Ternary-Bonsai-1.7B KLD vs CPU 0.000523; pp512/tg128 3542/113 and 4100/156. - #70 MLA V transpose: GLM-4.7-Flash prompts of 512+ tokens gave garbage (PPL 315,664), now 5.916 (CPU 5.959). - #71 llama-hadamard folds qwen3next's ssm_ba and refuses unfoldable stamped files. - #72 masked flash-attention keys reach P*V as V = +0: identical requests now give identical logits (Qwen3-0.6B and Qwen3.8-27B bit-identical repeats); pp512 -4.7% on Qwen3-0.6B. Docs: docs/hrx.md "Our patches". Registry regenerated (no mapping changes). Co-Authored-By: Claude Opus 5.5 <[email protected]> * Pin llama.cpp 4485916: attention sinks on HRX (gpt-oss) #68 runs gpt-oss's sink logits on HRX as an exact post-correction of the flash-attention output. Docs: docs/hrx.md "Our patches". Registry pin updated. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Pin llama.cpp f5b7f4a: PrismML tile bytes (PQ2_0 small-model decode) #74: the low-token SwiGLU read every PQ2_0 / PTQ1_0 row from row 0; Ternary-Bonsai-1.7B PQ2_0 now matches the CPU. Found by the release format matrix. 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]>
…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.
…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]>
Found while reading my own PRs with `--state` (which #2400 added): it reported npu-kernels#70 as held by a CHANGES at 14:51Z. That "verdict" was **my own reconciliation comment**, which quotes the verdict it disagrees with: `VERDICT: NEEDS-CHANGE` at `8a27d70c5` measured: `VERDICT_LINE` allows markdown decoration before VERDICT (bold, list bullets), and a backtick is decoration too - so a quotation of someone else's verdict at the head read as a verdict by the author. The same applies to a comment that quotes the *format* (`Write it as \`VERDICT: READY at <head>\``). A verdict does not begin inside an inline code span: VERDICT_LINE ^(?![^A-Za-z0-9]*`[^`]*VERDICT)[^A-Za-z0-9]*VERDICT\b VERDICT_KIND same exclusion -- `--state` classifies through it Measured on the real comment: `verdict_kind` -> None, `reviewed_at` -> False; and it is not a one-way narrowing - the house forms still read (bold `**VERDICT: READY at \`abc1234\`**`, bare, list-decorated). After the fix `--state --repos npu-kernels` reports #70 as `newest=READY 2026-11-13T06:40:19Z`, the reviewer's actual verdict. Two arms added (quoted verdict, quoted format); removing the exclusion fails **4** arms.
…the queue crashed at 07:13Z) (#2408) * pr_review_queue: a non-list page is an error, not a list of strings The queue crashed outright at 07:13Z: body = r.get('body') or '' AttributeError: 'str' object has no attribute 'get' `gh()` paginated does `out.extend(json.loads(chunk))`. A list endpoint answers with a list, but an error object (`{"message":"API rate limit exceeded"}`, a 404, a renamed repo) is a **dict**, and `extend(dict)` extends with the dict's **keys** - strings - which then explode in `reviewed_at`. So one transient API error took out the whole queue. Now a non-list page raises, naming the endpoint and the message, and `main` returns 2: pr_review_queue: gh api repos/OWNER/REPO/pulls?state=open did not answer with a list: Not Found rc=2 Reported rather than skipped, because a failed read must not come out as "every open PR has a verdict" - that is the same false negative this tool exists to prevent (a verdict that exists read as absent). Arm drives the real `gh` path through a stub that answers an error object; disabling the guard fails it (1 FAIL). Verified end to end against a repository that does not exist: rc 2 with the message above. * pr_review_queue: a QUOTED verdict is not a verdict Found while reading my own PRs with `--state` (which #2400 added): it reported npu-kernels#70 as held by a CHANGES at 14:51Z. That "verdict" was **my own reconciliation comment**, which quotes the verdict it disagrees with: `VERDICT: NEEDS-CHANGE` at `8a27d70c5` measured: `VERDICT_LINE` allows markdown decoration before VERDICT (bold, list bullets), and a backtick is decoration too - so a quotation of someone else's verdict at the head read as a verdict by the author. The same applies to a comment that quotes the *format* (`Write it as \`VERDICT: READY at <head>\``). A verdict does not begin inside an inline code span: VERDICT_LINE ^(?![^A-Za-z0-9]*`[^`]*VERDICT)[^A-Za-z0-9]*VERDICT\b VERDICT_KIND same exclusion -- `--state` classifies through it Measured on the real comment: `verdict_kind` -> None, `reviewed_at` -> False; and it is not a one-way narrowing - the house forms still read (bold `**VERDICT: READY at \`abc1234\`**`, bare, list-decorated). After the fix `--state --repos npu-kernels` reports #70 as `newest=READY 2026-11-13T06:40:19Z`, the reviewer's actual verdict. Two arms added (quoted verdict, quoted format); removing the exclusion fails **4** arms. --------- Co-authored-by: bong-water-water-bong <[email protected]>
Engine half of item 4 on the Lemonade checklist. Lemonade loads embedding and reranking models as models of their own, but
1bit serveonly served them as companions of a chat model (--embed,--rerank).The change:
--embeddingand--rerankingserve the model itself in that role. llama-server runs on the device asked for (vulkan,hrx,rocm) with that flag, and1bit serveexposes/v1/embeddings(+/embeddings) or/v1/rerank(+/rerank,/v1/reranking,/reranking).Measured on Strix Halo:
docs/serve.mddocuments this.onebit-embed), Lemonade's LLM suite throughonebit:🤖 Generated with Claude Code