Repository navigation
Inkling 2 Mini CUDA: serve batched DSpark drafts (stacked on #4858) - #5197
Draft
plotarmordev wants to merge 7 commits into
Draft
plotarmordev wants to merge 7 commits into
plotarmordev wants to merge 7 commits into
Conversation
- I retain the PR kernel implementations and numerical contracts without importing the older expert or vision stack. - I register the DSpark fatbin alongside Mini serving on current main.
- I capture decoder taps and verify or roll back one shared multi-stream draft pass. - I register Mini CUDA bridge contracts and per-request draft counters. - I leave the serving acceptance regression visible as an unresolved gate.
- I compute post-final target normalization before tap capture and unembedding. - I feed mask rows 1 through 7 into the matching recurrence and hidden projections. - I verified greedy, sampled, resumed, four-stream, and reopened Mini CUDA drafting.
- I describe target tap ordering, aligned recurrent rows, and the unchanged fidelity and speed gates.
- I advertise the existing multi-stream hold to the shared scheduler instead of receiving singleton holds. - I document why the scheduler flag is required for the reused batched CUDA kernels.
- I pack the target unembedding to its valid vocabulary width while checking the full checkpoint tensor. - I compare identical concurrent greedy and sampled streams to catch shifted batched proposal rows.
- I avoid spending shared target passes on the checkpoint’s mostly rejected deeper proposals. - I document the serving depth choice separately from the eight-row kernel capacity.
This branch has not been deployed
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
I add opt-in Inkling 2 Mini CUDA DSpark serving on top of #4858's all-stream draft kernels. Before this stack the Mini target served plain; with
--drafterI load its bundledmtp.safetensors, capture target visits 5/23/41 plus post-final norm, draft two proposals per stream in one batched pass per layer, and verify against the unchanged target with rollback. I reuse #4858's kernels rather than duplicate them.Draft PR while #4858 is open and remaining upstream checks (CI, independent fidelity, and cold prompt overhead) are resolved.
833875fe0b732c7083f236ea7cc3c01a96ebc076onto mainc0ea57ddd924cb8ab76ee9d4939b4a141ce7d392in kernel-only commit7df3fbf93b956071744b3d7d76ffc3a79a9fc65d. My serving commit range ise123d9081740248d007c29bae8db72ed54cc3d01through35bdb47fcdb94ef1afceb8e4aa30f4bdf433bd9d; the intermediate normalization, grouped scheduling, valid-vocabulary stride and two-draft fixes are separate commits. This content rebase does not claim Inkling-2: Add DSpark kernels that draft all streams in one pass #4858's original history as a direct ancestor.Checks on this head
35bdb47fcdb94ef1afceb8e4aa30f4bdf433bd9d.zig fmt --checkandgit diff --checkpass. I ranzig build test-cuda-host -Doptimize=ReleaseFast -Dnvcc="$(command -v nvcc)" -j1on the final code head, exit 0 with 3 expected negative-testfailed commandlines and no explicitFAIL; I rebuilt the CUDA device runner and passedtf-cuda-test inkling2-dspark-servingfor greedy/sampled code/chat, 2053 prompt tokens, resumed cuts 23/28/2048, four mixed and resumed streams, equal-proposal identical streams, and head release/reopen. The mixed cohort accepted 70 proposals at the served two-draft cap.tf-cuda-test kernel-contract dspark DSparkpassed 27/27 kernels under gates 1–4, 0 failed, 0 known findings, with 24/24 planted controls red and 0 limit problems.zig build test test-golden, independent teacher-forced released-checkpoint fidelity, or an external standard-server comparison. At context 8192, cold 32k/64k prompts are not admitted; those require a larger-context separate receipt. The full five-SM limits check exits 1 on both main and this final head with the same 184 inherited stale records, 0 new; I do not call it green.Receipt
--drafter, opt-in; ordinary plain decode remains the default.c0ea57ddd924cb8ab76ee9d4939b4a141ce7d392, Inkling-2: Add DSpark kernels that draft all streams in one pass #4858833875fe0b732c7083f236ea7cc3c01a96ebc076, stacked head35bdb47fcdb94ef1afceb8e4aa30f4bdf433bd9d; Zig 0.17.0, CUDA 13.0, Linux ARM64, one GB10 SM121, released Inkling 2 Mini checkpoint revisioned40e7da625f594fc9c4990f5f66be24873c22d7with its bundled drafter file."draft": falseserial references agreed. The device test passed resumed and released/reopened state.104.7vs77.6/77.3tok/s (+34.9%) and four-stream greedy chat97.3vs80.2/80.2tok/s (+21.3%). Four-stream decode is aggregate tok/s; TTFT is median per-request ms.0.416 / 0.425 / 0.415 GB, and in a separate matched memory probe measured engine CUDA allocator peak23.023 / 24.829 / 23.023 GB(+1.806 GB opt-in when--drafteris enabled). I do not add process RSS to CUDA allocations on unified memory.mtp.safetensors; the caller opts into loading it.Kernel contract
(filtered) SUMMARY 27 kernels: 27 pass gates 1-4, 0 fail, 0 known findings; 24 controls: 24 red as planted, 0 missed; 0 limit problems; exit 0. Full five-SM resource limits exited 1 with the same 184 inherited stale records on main and final head, 0 new.How to check
Base:
c0ea57ddd924cb8ab76ee9d4939b4a141ce7d392. Stacked #4858 parent:833875fe0b732c7083f236ea7cc3c01a96ebc076. Head:35bdb47fcdb94ef1afceb8e4aa30f4bdf433bd9d.Use two independent checkouts for main and this branch, the same released checkpoint and an SM121 device; set
MODEL_DIR,IDS_FIXTURE,OUT, and each checkout'sSERVER_BINaccordingly:I start a fresh server for each A (plain main), B (stacked with
--drafter "$MODEL_DIR"), and A2 (plain main repeat) arm; only B enables the drafter.SERVER_BINis the product build'snative/bin/tensorfold-native:Checklist