Repository navigation
dsv41: the served engine's lane half as a backend-neutral module - #1719
Merged
Merged
Conversation
4 of 9 tasks
gilby
force-pushed
the
dsv41-metal-pr/15-serve-lanes
branch
from
November 1, 2026 21:43
5ae41b7 to
754a14f
Compare
6 of 9 tasks
gilby
force-pushed
the
dsv41-metal-pr/15-serve-lanes
branch
2 times, most recently
from
November 2, 2026 09:27
7a912c4 to
0ec5a1e
Compare
This was referenced Nov 3, 2026
dsv41 metal: one decoder layer's launch over 1-16 rows, checked stage by stage against float64
#1715
Closed
Owner
gilby
force-pushed
the
dsv41-metal-pr/15-serve-lanes
branch
2 times, most recently
from
November 3, 2026 09:39
33d3005 to
60106f7
Compare
index.metal scores FP4 queries against FP4 keys in one stated order with causal and block masks, topk512.metal keeps each row's top 512, cand.metal picks the candidate blocks as a byte mask, and route.metal takes the top-k of sqrt(softplus(logit)) + bias for the backbone and the drafter. Each is registered with the contract.
compress.metal pools the ratio-2 and ratio-4 compressed KV and round-trips it through FP4; engram.metal dequantises the FP8 Engram rows, projects them, gates them and adds them to the residual. Registered with the contract against float64 and bit-equal to the phase-1 glue where they replace it.
…lded decode glue hc.metal runs hc_mixes with Sinkhorn, hc_pre and hc_post in fixed orders; fused.metal and fold.metal split or fold neighbouring glue launches at the same bits. Registered with the contract against float64 and bit-equal to the phase-1 glue.
… by stage against float64 The Metal package over the family's neutral host files: the kernels' pipelines, release weights (copied or mapped from the shards), a slot's KV regions, RoPE tables, scratch and one layer's encoders (attention with the indexer and compressor, MoE, hyper-connections). test-dsv41-metal checks every stage of every layer kind against float64 and rows at once against one at a time; test-dsv41-metal-real runs one release layer under TF_DSV41_REAL.
…d the DSpark taps forward.zig runs the stack for 1-16 rows of one or several slots in one launch: Engram before its layers, the hc mean into the taps, the head. model_weights loads a whole checkpoint, its shards mapped zero-copy where aligned. The tiny model's stages are checked against float64 and R rows in a launch against one at a time.
The prompt runs the encoder layers over every row in chunks, then the decoder's suffix cone: layer L of the decoder computes only the rows the prompt's end depends on (kept + (39 - L) x 127), with the bits of running every row. ced gains the cone's rules and the snapshot replay; tests check chunk sizes, the cone against every row, resumes and the grouped experts against the decode rows.
The drafter on Metal: its weights, the ingest of committed rows, the propose launches for several slots at once and the pass's plan. Its stages are checked against float64, R rows ingested at once against one at a time, and several slots in one pass against each alone.
serve_lanes.Model is what a backend gives the lanes (target, pass, shape, costs, hooks) and Served runs it under LaneHost; calib_lanes holds the draft-cost tables. The CUDA engine (serve_engine) is unchanged and keeps its own lane half; the Metal backend in the next part is the first to serve through this module.
ashhart
force-pushed
the
dsv41-metal-pr/15-serve-lanes
branch
from
November 3, 2026 10:38
60106f7 to
33c6da0
Compare
Owner
|
Thank you @gilby. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes. |
This was referenced Nov 3, 2026
Owner
|
Thanks @gilby! This is in TensorFold 1.2.2, out now: https://github.com/ashhart/TensorFold/releases/tag/v1.2.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
The served engine's lane half as a backend-neutral module (
serve_lanes,calib_lanes) that a backend plugs into:serve_lanes.Modelis what a backend gives the lanes (target, pass, shape, costs, hooks) andServedruns it under LaneHost. The CUDA engine is not changed:serve_engine.zig,calib_gpu.zig,gate_lanes.zig,slot_drafts_cli.ziganddraft_host_test.zigare byte-identical to main (git diff mainon them is empty). The Metal backend in the next part is the first to serve through it.Part 15 of 18 of the stack for #1676; stacks on
dsv41-metal-pr/14-dspark(part 14, #1718), on main with parts 1 to 5 (#1705 to #1709) merged.Receipt
tools/bench_concurrent.py --alone --serialortoken_shaagainst"draft": false: n/a for served output here (no backend serves through the module until the next part);serve_lanes_test.zigchecks the module on the host.tools/bench_openai.py: measured on the last PR of the stack.ttft_sfromtools/bench_cache.py --require-coldon a long prompt, or "n/a" with the reason when the change cannot reach prompt processing: measured on the last PR of the stack.zig build test tf-kernel-contract -Dcpu=apple_m1: exit 0, 625/625 steps succeeded; kernel contract,tf-kernel-contract --only dsv41(Metal):SUMMARY 89 kernels: 89 pass gates 1-4, 0 fail, 0 known findings; 186 controls: 186 red as planted, 0 missed; 0 limit problems; gates 120474 ms, limits 160 ms;zig build test-dsv41-metal -Dcpu=apple_m1(the device suite, its own step): exit 0, 7/7 steps succeeded; 28/28 tests passed;python3 tools/zig/lean_check.py: 5134 files, 424 problems, the same count as main (5027 files, 424). Zig's summary counts only the test binaries it ran in that invocation, so the step count is the comparable figure.test-dsv41-metal-real,test-dsv41-metal-vision-real) were run at the stack's top and are in dsv41 metal: image prompts #1722's receipt.Checklist
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo.SUMMARYline is in the receipt.