Repository navigation
Conversation
Reuse ashhart#1764's existing kernel, resource records and required symbol bindings for the Qwen dense/MoE and Nemotron ModelOpt port. Keep one six-entry numerical/replacement/control set. Cache the serving choice: TF_CUDA_PROMPT_BF16=0 restores the lane but leaves required symbols bound. The threshold is fixed at 1024 rows. Host ABI and fixture-lifetime checks pass; fresh CUDA contract and checkpoint A/B receipts remain required on this rebased tree. Refs ashhart#1762, ashhart#1764. Co-authored-by: Armin <2369138+Arminova@users.noreply.github.com>
Dory packs its unquantized projections in the shared BF16 lane layout and runs prompt chunks through Linear. Opt it into ashhart#1764's existing tile at the fixed 1024-row threshold; TF_CUDA_PROMPT_BF16=0 restores the lane. The required symbols stay bound and decode stays on its existing path. Exercise the actual family projection at the CUDA ABI without a device. Fresh greedy and seeded token equality and a 2K prompt timing on a GB10 remain required. Refs ashhart#1762, ashhart#1764.
Adapt ashhart#1764's staged chain-warp gated norm to Qwen dense and MoE. Retain the old recurrence and post kernels and each BF16 boundary; TF_CUDA_GDN_CHAIN_NORM=0 restores their separate launches. Register byte replacements for rows, state, sums and chunk seams with source controls. Host ABI checks pass; device and compiler gates are pending. Refs ashhart#1762, ashhart#1764. Co-authored-by: Armin <2369138+Arminova@users.noreply.github.com>
Adapt ashhart#1764's expert-first grid to Qwen MoE's 16-row router. Retain each original FP32 FMA chain and the row-first kernel; TF_CUDA_MOE_EXPERT_FIRST=0 restores its symbol and launch grid. Add FP64 and byte-replacement contracts, padded/live-row cases and a source row-coupling control. Complete shared contract image routing, keep callback tables static, and compile GDN controls with the production chain so their compiler flags match. Device qualification is pending. Refs ashhart#1762, ashhart#1764. Co-authored-by: Armin <2369138+Arminova@users.noreply.github.com>
|
Qualification update on Hosted format passed. The No GPU run was cancelled before completion, as was the previous head's run. There has been no subsequent push to supersede this head. The macOS Could a maintainer confirm whether the repeated cancellation is intentional and how to obtain the remaining hosted checks? I have not changed workflow policy or repeatedly retried cancelled runs. The outstanding checks remain explicitly unchecked. |
|
The complete strict CUDA run is now retained in the receipt, including its full text output and binary identity: The numerical gates and every planted control passed their intended checks; six existing NaN findings reproduce. All four new function records pass live sm_120 checks, and all 20 new function/SM records are current in the five-SM asset audit. The remaining failure is 188 registry problems plus 154 live record/device mismatches. The separate parent/candidate five-SM audits both exit 1 with 637 problems and identical diagnostic multisets; the comparison retains those diagnostics. The parent's full/live-only run was not run, so this is not presented as a matching parent live SUMMARY or a clean qualification. Could the maintainer advise the appropriate catalog-resolution scope for these existing records? The PR stays draft. Native serving measurements have resumed, with performance, lifecycle, cold-prefill and existing-format receipts still pending. |
|
Thank you, @akol1. This is careful work: the dense BF16 path keeps every existing checkpoint on main's code, the |
(cherry picked from commit d8f5efb)
|
Your callback fix ( |
Load the dense Qwen3.5-27B checkpoint from its stored BF16 safetensors and serve per-token prompt logprobs from the rows the prompt path scores. Dense attention and MoE projections keep the checkpoint's BF16 weights and activations; FP32 sums and the stored GDN scales are unchanged, and no tolerance moves. Score the served rows locally: `prompt_logprobs` follows `/v1/completions`, `top` accepts 0/1/20, the first entry stays null, and an unknown `top` or an input id at the vocabulary sentinel is a 400. The head accumulates in FP32 and takes its logsumexp over the full vocabulary. Add an independent FP32 head over the same captured BF16 normalized rows, with its own build, a FP64 dot/logsumexp tool and planted controls, so a score can be checked without trusting the production head. Register the new function/SM and record identities with byte replacements; existing declarations and tolerances stay as they are. The CUDA contract still fails 342 launch limits, so this is qualification input, not a passed contract. Refs ashhart#1762, ashhart#2020.
…erence The receipt tree carried 3.26 MB of per-request dumps and the complete CUDA contract log beside the summaries. Remove the per-request dumps, the two per-request concurrency bodies and the cold replay bodies; asset.json pins the sha256 and byte count of every removed file, and of the transformers payload and run log kept out of the tree with them, so the tracked receipts stay auditable against what was removed. The removed files themselves stay with the author and are not published. Add tools/zig/qwen35_transformers_reference.py, which runs the pinned checkpoint on CPU in two arms, stored BF16 and every decoder layer's stored parameters and buffers promoted to FP32, and transformers-comparison.json, which compares the served prompt scores against that forward and adds the tables to the receipt. The transformers arm's own BF16-to-FP32 distance bounds the comparison: 18/18 rows stay inside their bound, the worst tracked native-to-transformers difference is 0.830 on one prompt row at position 255, the other 17 rows are at or under 0.018, and 408/415 argmax rows agree. The BF16 arm's hidden states are bitwise equal to a plain library forward, and extending a prompt by the served continuation tokens leaves the prompt rows bitwise unchanged. Also name the existing GPU lock and admission guard, with one model process per test machine, in the recipe's serving line, and re-pin the commit ids the topic rewrite changed in the required checksum records. Refs ashhart#1762, ashhart#2020.
b651e8b to
adfe474
Compare
Load the dense Qwen3.5-27B checkpoint from its stored BF16 safetensors and serve per-token prompt logprobs from the rows the prompt path scores. Dense attention and MoE projections keep the checkpoint's BF16 weights and activations; FP32 sums and the stored GDN scales are unchanged, and no tolerance moves. Score the served rows locally: `prompt_logprobs` follows `/v1/completions`, `top` accepts 0/1/20, the first entry stays null, and an unknown `top` or an input id at the vocabulary sentinel is a 400. The head accumulates in FP32 and takes its logsumexp over the full vocabulary. Add an independent FP32 head over the same captured BF16 normalized rows, with its own build, a FP64 dot/logsumexp tool and planted controls, so a score can be checked without trusting the production head. Register the new function/SM and record identities with byte replacements; existing declarations and tolerances stay as they are. The CUDA contract still fails 342 launch limits, so this is qualification input, not a passed contract. Refs ashhart#1762, ashhart#2020.
…erence The receipt tree carried 3.26 MB of per-request dumps and the complete CUDA contract log beside the summaries. Remove the per-request dumps, the two per-request concurrency bodies and the cold replay bodies; asset.json pins the sha256 and byte count of every removed file, and of the transformers payload and run log kept out of the tree with them, so the tracked receipts stay auditable against what was removed. The removed files themselves stay with the author and are not published. Add tools/zig/qwen35_transformers_reference.py, which runs the pinned checkpoint on CPU in two arms, stored BF16 and every decoder layer's stored parameters and buffers promoted to FP32, and transformers-comparison.json, which compares the served prompt scores against that forward and adds the tables to the receipt. The transformers arm's own BF16-to-FP32 distance bounds the comparison: 18/18 rows stay inside their bound, the worst tracked native-to-transformers difference is 0.830 on one prompt row at position 255, the other 17 rows are at or under 0.018, and 408/415 argmax rows agree. The BF16 arm's hidden states are bitwise equal to a plain library forward, and extending a prompt by the served continuation tokens leaves the prompt rows bitwise unchanged. Also name the existing GPU lock and admission guard, with one model process per test machine, in the recipe's serving line, and re-pin the commit ids the topic rewrite changed in the required checksum records. Refs ashhart#1762, ashhart#2020.
adfe474 to
d397c8c
Compare
Reuse ashhart#1764's existing kernel, resource records and required symbol bindings for the Qwen dense/MoE and Nemotron ModelOpt port. Keep one six-entry numerical/replacement/control set. Cache the serving choice: TF_CUDA_PROMPT_BF16=0 restores the lane but leaves required symbols bound. The threshold is fixed at 1024 rows. Host ABI and fixture-lifetime checks pass; fresh CUDA contract and checkpoint A/B receipts remain required on this rebased tree. Refs ashhart#1762, ashhart#1764. Co-authored-by: Armin <2369138+Arminova@users.noreply.github.com>
Dory packs its unquantized projections in the shared BF16 lane layout and runs prompt chunks through Linear. Opt it into ashhart#1764's existing tile at the fixed 1024-row threshold; TF_CUDA_PROMPT_BF16=0 restores the lane. The required symbols stay bound and decode stays on its existing path. Exercise the actual family projection at the CUDA ABI without a device. Fresh greedy and seeded token equality and a 2K prompt timing on a GB10 remain required. Refs ashhart#1762, ashhart#1764.
Adapt ashhart#1764's staged chain-warp gated norm to Qwen dense and MoE. Retain the old recurrence and post kernels and each BF16 boundary; TF_CUDA_GDN_CHAIN_NORM=0 restores their separate launches. Register byte replacements for rows, state, sums and chunk seams with source controls. Host ABI checks pass; device and compiler gates are pending. Refs ashhart#1762, ashhart#1764. Co-authored-by: Armin <2369138+Arminova@users.noreply.github.com>
Adapt ashhart#1764's expert-first grid to Qwen MoE's 16-row router. Retain each original FP32 FMA chain and the row-first kernel; TF_CUDA_MOE_EXPERT_FIRST=0 restores its symbol and launch grid. Add FP64 and byte-replacement contracts, padded/live-row cases and a source row-coupling control. Complete shared contract image routing, keep callback tables static, and compile GDN controls with the production chain so their compiler flags match. Device qualification is pending. Refs ashhart#1762, ashhart#1764. Co-authored-by: Armin <2369138+Arminova@users.noreply.github.com>
Load the dense Qwen3.5-27B checkpoint from its stored BF16 safetensors and serve per-token prompt logprobs from the rows the prompt path scores. Dense attention and MoE projections keep the checkpoint's BF16 weights and activations; FP32 sums and the stored GDN scales are unchanged, and no tolerance moves. Score the served rows locally: `prompt_logprobs` follows `/v1/completions`, `top` accepts 0/1/20, the first entry stays null, and an unknown `top` or an input id at the vocabulary sentinel is a 400. The head accumulates in FP32 and takes its logsumexp over the full vocabulary. Add an independent FP32 head over the same captured BF16 normalized rows, with its own build, a FP64 dot/logsumexp tool and planted controls, so a score can be checked without trusting the production head. Register the new function/SM and record identities with byte replacements; existing declarations and tolerances stay as they are. The CUDA contract still fails 342 launch limits, so this is qualification input, not a passed contract. Refs ashhart#1762, ashhart#2020.
…erence The receipt tree carried 3.26 MB of per-request dumps and the complete CUDA contract log beside the summaries. Remove the per-request dumps, the two per-request concurrency bodies and the cold replay bodies; asset.json pins the sha256 and byte count of every removed file, and of the transformers payload and run log kept out of the tree with them, so the tracked receipts stay auditable against what was removed. The removed files themselves stay with the author and are not published. Add tools/zig/qwen35_transformers_reference.py, which runs the pinned checkpoint on CPU in two arms, stored BF16 and every decoder layer's stored parameters and buffers promoted to FP32, and transformers-comparison.json, which compares the served prompt scores against that forward and adds the tables to the receipt. The transformers arm's own BF16-to-FP32 distance bounds the comparison: 18/18 rows stay inside their bound, the worst tracked native-to-transformers difference is 0.830 on one prompt row at position 255, the other 17 rows are at or under 0.018, and 408/415 argmax rows agree. The BF16 arm's hidden states are bitwise equal to a plain library forward, and extending a prompt by the served continuation tokens leaves the prompt rows bitwise unchanged. Also name the existing GPU lock and admission guard, with one model process per test machine, in the recipe's serving line, and re-pin the commit ids the topic rewrite changed in the required checksum records. Refs ashhart#1762, ashhart#2020.
fc61c7c to
47dd8ca
Compare
|
Thanks @akol1. Finding it at layer 0, with embeddings exact and the reference's own layers cloned and checked, is exactly what we needed. One more split would settle fix against floor: inside layer 0, could you compare the conv, the gates, the recurrence and the output norm with FP32 on the same 32-token fixture? Main has also moved under |
|
Our GB10 run on this head ( |
|
Our GB10 run with Nemotron 3.5 Lightning MLX 4-bit on this head, against its merge base, read REVIEW on one cell. Two-stream greedy code went from 318.1 to 248.9 tok/s (-21.8%; base runs 305.3 and 330.8, new 249.3 and 248.4). Four-stream greedy chat moved the other way, +13.8%, and everything else, prefill, decode after a prompt and the other sweeps, is within about 1%, with no token differences in 20 rows. Nemotron's greedy multi-stream cells have two speed modes on GB10s that flip between runs, and a single pair can land on different modes. We saw the same thing on main this afternoon and settled it with repeats. So this is probably that, but we don't take it on two runs. A six-repeat rerun of the two- and four-stream sweeps is queued, and I'll post what it shows. Nothing needed from you for this one. |
|
The six-repeat rerun on Nemotron 3.5 Lightning MLX 4-bit is in, and it's level, so the earlier -21.8% was the multi-stream mode flip, not this PR.
Since then we've found why those cells flip: identical greedy streams that start together run in lockstep, and that alone can move Nemotron about 50% between repeats. Our sweeps now stagger their starts by 150 ms. So both shared-path runs are level (the 27B and Nemotron), and what's left is the layer-0 split for the BF16 path itself. |
# Conflicts: # docs/recipes/cuda.md # zig/kernels/cuda/contract_controls.cu # zig/src/families/qwen3_5/cuda_forward.zig # zig/src/families/qwen3_5/cuda_geometry.zig # zig/src/families/qwen3_5/cuda_weights.zig # zig/tests/cuda/contract_limits.zig
# Conflicts: # zig/src/core/contract/registry.zig
…ader cluster The merge left the file at 606 lines, one over the lean gate's 600 against main; the two control includes move up with the other headers and spare separators go, so the planted moe-router and q35 score controls stay with no new lean problem.
|
Thanks @akol1 for keeping the branch current with main. Two things need you before we can go further, and one
On our side, #2008 (the base) has to be rebased and land first. Main has also moved under four of your files in code
|
|
Thanks @akol1. We went through where this stands so it doesn't sit on our side. One question only you can answer, and one step that's ours. From you: the layer-0 split. Your layer diagnostic puts the first excess in zero-based layer 0, the first linear-attention block. There, the worst native-to-FP32 distance is 0.0765 against the BF16 arm's own 0.0563. The next question is still inside layer 0. On the same 32-token fixture, how do the conv, the gates, the recurrence and the output norm each compare with FP32? Your trace already captures the production CUDA prompt forward at the residual boundaries. This needs capture points inside that one block, run on the same GPU and checkpoint as your other receipts. That's why we're asking you rather than rerunning it on different hardware. What the split decides. Main's #2383 makes a plain BF16 Qwen3.5 on CUDA a decision backbone only. Ours: the base. #2008 has to land before this can. On today's main this head conflicts in seven files:
|
What this changes
Adds an experimental dense BF16 Qwen3.5 format with native nonstreamed
/v1/completionsprompt_logprobsthrough the existing CUDA lanes. Stored FP32 GDN parameters stay FP32; scoring uses BF16 inputs, FP32 head sums/output and full-vocabulary normalization. Existing formats retain their generation/scoring admission. The review follow-up adds finite, opt-in observation of the production prompt body for diagnosis; no numerical tolerance or kernel arithmetic changes.9200a3064153b8041930f61f5ba92102d4bea692, with CUDA: #1764's BF16 prompt tile for Qwen ModelOpt, Nemotron and Dory, plus two exact Qwen prompt kernels (#1762) #2008 pinned atd19ff3f075eb144870af1af159de1eccafd0b69bas an actual ancestor. Its credited callback fix travels with the parent. The requested rebase resolvescuda_geometry.zig::parseby reading the shared layer pattern before the BF16 return; the FP32-scale guard remains. The refreshed parent contributes its bounded host-test registration placement; the BF16 guards and measured resource assertions remain. The parent is still open; its laterf332655dchanges only the GDN receipt assertion, already covered here by the stronger measured/missing-receipt controls. Base-history removal remains conditional on the parent landing; no merge is performed here.atc overlap --json: run after the final rebase, 2026-11-05 09:21 UTC, against main9200a306. Coverage is incomplete (pullFilesLimit). The latest scan reports EXL3 Flash Next on CUDA: one rank, offloaded experts, sm_120 gate (1/8) #1441–EXL3 Flash Next: draft lane guard for offloaded experts (8/8) #1446 and EXL3 Flash Next: host-resident K/V on the tier (6/8) #1522; their conflict files reproduce on main or main plus the refreshed parent. The previously detected qwen CUDA: a faster opt-in paged path (TF_QWEN_KV_PAGES=256), --parallel a cap with pages set #2011/qwen3_5 cuda: the 27B as a pipeline stage, logits byte-equal to the whole model #2115 were also checked and add no conflict files beyond those baselines. These are read-only merge checks, not integration of unrelated branches. CUDA: #1764's BF16 prompt tile for Qwen ModelOpt, Nemotron and Dory, plus two exact Qwen prompt kernels (#1762) #2008 is an ancestor. The local warning is a preserved checkout of this same PR. This PR is mergeable against main.Checks on this head
47dd8cadc6f09ece60dd72613630c839b44bfe21. Measured native/capture source is9416f0cf94bddbea49becb4c14047d0c16d08faf. After the later main/parent integration, the complete Qwen CUDA family and all CUDA kernel sources remain byte-identical to that producer. New upstream load/cache/stage changes are covered by the refreshed host checks; no device execution is relabeled. Transformers capture source isb54d8ff7691385fe420399e72272c932a881e29e; the source and binary identities in the assets are not relabeled.zig fmt --check build.zig zigandgit diff --checkpass. The registry stays within 600 lines by registering the receipt test through the existing bounded test module.zig build test test-kernel-contract test-golden fuzz-cortheon dev-tools --test-timeout 10m -j8 --summary all, 917/917 steps, 7417/7487 executed tests passed, 70 skipped, other results cached, exit 0, on this refreshed integration head.zig build test test-kernel-contract test-golden fuzz-cortheon -j8 --summary all, 599/599 steps, 7396/7455 executed passed, 59 skipped, other results cached, exit 0, onb54d8ff7. Native/capture and plain builds at9416f0cfpass; plain is 30/30 steps.python3 -m unittest discover -s tools/zig -p 'test_qwen35*.py' -v: 20/20 passed with the pinned reference dependencies; 17 passed / 3 skipped without the optional ML dependencies. The complete source fixes a superseded partial-export setup failure, retained in the packet.Receipt
The refreshed host log and exact source/overlap checks are attached in the integration supplement. The original 217-file device/reference packet remains unchanged.
Layer diagnostic and reproduction, compact result, archive hashes, immutable evidence.
Qwen/Qwen3.5-27B, revisionfc05daec18b0a78c049392ed2e771dde82bdf654; all 11 actual shard hashes/sizes match pinned public LFS after capture. CPU reference: Python 3.12.3, Torch 2.15.0+cu132, Transformers 5.22.1, accelerate 1.15.0, safetensors 0.8.0, NumPy 2.5.4, eager attention, CUDA disabled. Both arms preserve all 96 stored FP32 parameters. Promoted FP32 uses the stored BF16 checkpoint values, not a separate FP32 training checkpoint.b168b36d, not claimed as new executions on this head.b168b36dremain fully linked: native/SGLang C4 aggregate decode is about 9/109.5 tokens/s. Performance remains unqualified.Requested layer comparison
The exact 32-token public fixture has 31 hidden rows used by served prompt scores. The last input row is retained in a separate all-32-row view. At each boundary the rule is
max |native − FP32| <= max |Transformers BF16 − FP32|, with no added allowance.The first excess is zero-based layer 0, the first linear-attention block. Embeddings match exactly. Layer 0's worst coordinate is input row 21, hidden column 3994: native 15.5625, FP32 15.63897705078125, BF16 reference 15.625.
The rule fails at 18/64 residual layers. Both row scopes find the same first layer. All 66 boundaries, maxima/medians/RMS, worst coordinates and 198 unchanged tensor arrays are external. Later boundaries returning inside their maximum do not waive the separately failed served-logprob rule. This locates observed drift in the first block; it does not establish an isolated accumulation bug or an unavoidable format floor.
The earlier direct HTTP comparison remains failed at all four prompt lengths, over all 4511 scored positions, including the 4097-ID seam, in both reference arms. At 32 IDs, worst/median native−FP32 logprob distance is 0.0415096283 / 0.004390716553, against own BF16−FP32 worst 0.02388763428. Same-weight FP64 checks still cover the head on native rows, not the whole body. No broader hidden-state bound replaces these failures.
The 217-file supplement includes full build/capture/audit logs, exact IDs, numerical failures and actual source/binary identities. Archive/member checksums and normalized header identities are recorded; all three public downloads were rehashed successfully. Source, outgoing history, JSON metadata and the complete packet were reviewed for private identifiers/credentials, with zero findings; approved public contributor aliases/noreply credit remain.
Kernel contract and historical producer
The BF16 copy/dense/FP32 scoring and FP32-scale RMS operators remain registered with their planted controls; no numerical tolerance or known exemption is added. The CPU five-SM audit at native producer
9416f0cfpasses, with no stale records or applicable launch failures, and every planted launch control red. This inspects compiled resources; it is not five physical-device runs.The complete historical sm_120 command at
b168b36d0cc3503ae69e8bffcad494574019caf5, unchanged in the existing asset, is:The same six declared NaN findings remain; no new known entry is added. A complete device-suite rerun on the rebased head is not run, and this historical SUMMARY is not relabeled. Other CUDA chips, Metal/HIP and multiple ranks are unqualified. GB10 execution remains with the maintainer.
Checklist