Repository navigation
Conversation
cc5048b to
ee8a658
Compare
|
Thanks @cshintov. One build fix remains after the rebase. At stage_planes.zig:6 and qwen27.zig:52, the code references core.qwen35_stages, but the production tensorfold.zig core does not export it. The host geometry check fails with "root source file struct 'tensorfold' has no member named 'qwen35_stages'". The standalone tools use separate core shims, so they miss this caller. Please export the recorder through the production core and rerun
|
… over 2 on main's attention Geometry
…hs (512 experts' rows over 2,048)
… float64 forward One stage vocabulary (families/qwen3_5/stages.zig): the residual stream after the embedding and after each layer's mixer and MLP, then final (the normed rows the head reads, not the residual) and the logits. tools/zig/qwen36_stage_ref.py measures each against float64 of the checkpoint's exact weights; a non-unit final norm fixture refuses a residual labelled final.
…, as the recorder allows While stages record, the last layer counts as tapped, so main's keys-only last layer stays off and the recorded stream and final are real rows. The stage hook (planes and glue) and the admit check move into stage_planes.zig, so the runner needs no forwarding function, and planes.end runs after the round is committed, so a recorder error leaves the runner consistent.
…16 query heads over 2
|
Exported |
ee8a658 to
742ebb4
Compare
This builds Qwen3.6-35B-A3B (text, no MTP, no images) on main's routed expert path (#1125), as asked when #1009 closed. Slice 1 of #931.
What this changes
qwen27: Qwen3.6-35B-A3B on #1125's routed path...).model.supportedtakes its shape, and the attentionGeometrytakes 16 query heads over 2 (a group of 8) on one Mac. A rank of 8 over 1 is refused. Config tests cover the shape and both refusals.docs/kernel-contract.md: one paragraph on the new widths.tf-qwen27-run --stages DIR). It writes the residual stream after the embedding, after each layer's mixer and MLP, thenfinaland the logits.finalis the normed rows the head reads, not the residual. A fixture with a non-unit final norm refuses a residual labelled final.tools/zig/qwen36_stage_ref.pymeasures each stage against a float64 forward of the checkpoint's exact weights. It reports the local error (each stage fed the engine's own input) and the chained error (from the token ids).finalare real rows.Design
The 35B-A3B is the same family as Ornith-1.5-122B with other widths: 256 experts of 512 and a shared expert of 512 over a hidden width of 2,048, and 16 query heads over 2. So it adds no kernels and no loader. The router runs on its stored 8-bit g64 rows, stacked with the shared gate.
Alternatives rejected:
Receipts
M4 Pro (no tensor units), macOS 26.5, head
cc5048b6con mainaaac299d1.Host and contract:
zig build test-qwen27: all pass (46 of 46 steps).zig build test-kernel-contract: 204 of 204 pass.tf-kernel-contract --only qwen27, on the same commits over mainc34ff562c: 36 kernels pass gates 1-4, 0 fail, 0 known findings; 3 controls red as planted; 0 limit problems.zig fmt --check: clean.tools/pr_check.py --base main: 0 errors, lean 341 against 341 (0 new).Real checkpoint (
mlx-community/Qwen3.6-35B-A3B-4bitat38740b84), on this head.tf-qwen27-run --max-tokens 64 --chunk 128 --compare-chunk 16 --seams 16, greedy:All three replies are token for token the same on this head, on the same commits over main
c34ff562c, and before the rebase. The staged references below were measured on the pre-rebase run.Staged references for the long prompt plus 72 teacher rows, against a float64 forward of the same weights:
finallocal max: 0.19%.Not run, and why
draft: false. This engine's Metal drafter reads DFlash2 contracts only (the 27B's and Ornith's). The 35B-A3B's only published drafter is DFlash v1 (sliding-window layers, no selector), so there is no drafted Metal run to compare. A drafter for it is a separate PR.zig build test. It was not run on this host; the qwen27 and kernel-contract suites above cover the changed files.