Repository navigation
MiMo-V2.6-Flash on CUDA (2x GB10) with DFlash as the drafter - #728
ajensenwaud wants to merge 26 commits into
Conversation
…3 experts Checked ash hart PRs open+closed (read-only). Direct hits on our problems, all OPEN, branch BHCC2025/TensorFold exl3-cuda-experts: - ashhart#741 EXL3 routed experts behind experts.Grouped: gate+up+SwiGLU ONE kernel, down on pair rows, each expert's rows rotated by its own suh INLINE (register-resident rot for 1-2 pair chunks - the problem we had deemed impossible tile-incrementally). Rides on grouped.zig's Plan (in our tree). 297cu+124zig lines, with an exactness test harness (tf-cuda-test exl3-experts) - 367,872 values within FP64 bounds, alone==grouped byte-equal. - ashhart#740 EXL3 projections behind qlinear (the stacked base). - ashhart#718 branch-free trellis window extraction (perf). - ashhart#729 share decoded weights across prefill rows (perf). - ashhart#728 MiMo-V2.6 CUDA EXL3 two-GPU (another full CUDA EXL3 family). - ashhart#765 GLM CUDA multi-rank doorbells; ashhart#770/777/768 nemotron CUDA single-launch shared rounds + batched MTP drafting (patterns for our later concurrency work). PLAN: vendored exl3_experts.cu/.zig + exl3.cuh into our tree (this commit, unwired). Next: build wiring (fatbin + mod), port moeBlock to Grouped.decode with the router->plan plumbing from grouped.zig, run their exl3-experts test on our checkpoint, parity, bench. Our own grouped kernels (stage-1 parity) stay as fallback.
|
Thank you, @ajensenwaud, the shared-lane DFlash path and explicit optional FP8 policy give the MiMo work useful boundaries. We checked 83fd3f2. native.zig:374 still requires captured kernels, :379 hides bad TP settings with catch null, and rankWeights:412-416 divides bytes despite replicated embeddings/drafter. We can repair refusal and placement accounting while moving execution onto owned kernels and the shared EXL3 module. We will extract the depth rule and infrastructure first, then the family with prompt reuse and final-source numerical/peer/memory gates; 16-bit cache remains the default. Please provide the original/converted checkpoint and vision inventory with the pinned workload so image obligations and the final reference gate are explicit. Earlier pre-rebase receipts remain attached to their source. Posted by Ash's AI Assistant Synthena |
|
Thank you, @ajensenwaud, for #728 and the 24 concurrent-versus-solo checks on two GPUs, with @jayleaton and the common EXL3 contributors. MiMo-V2.6-Flash is not included in 1.1.1. Its current CUDA path depends on a Python-captured Triton set that TensorFold does not ship; without TENSORFOLD_CUDA_KERNELS it refuses to start. Native kernels for its eight Triton launches come next, followed by full-model fidelity, drafted/plain, resumed/fresh, concurrent/solo, two-rank failure and compiler/resource gates on the integrated EXL3/DFlash path. This is held for a later 1.1.x; captured-set receipts do not qualify the new native path. Posted by Ash's AI Assistant Synthena |
|
Thanks @ajensenwaud for MiMo-V2.6-Flash on CUDA. Main has moved a long way since this branch (it is stacked on #703), so rather than ask you to rebase, we'll port its MiMo-specific commits onto current main ourselves, keeping you as their author and saying in each message what was adapted. Then it goes to the GB10 kernel contract and served-equality runs on one and two GB10s before it lands. If you are partway through a change here, please say so, so we don't collide. - Synthema, Ash's AI Assistant. |
|
Thank you. Very keen to contribute. I know it's moving fast. I can rebase and recommit if that helps? |
|
@ajensenwaud, a question from the port before we combine the MiMo paths with main's shared EXL3 operators. In the branch, the arithmetic a row gets depends on how many rows or tokens arrive together: the router picks its tile by row count (BM 16 up to 16 rows, then larger tiles with BK 256 to 64 and BLOCK_E 32 to 64, - Synthema, Ash's AI Assistant. |
|
Thanks Synthema, and thanks for porting rather than asking for a rebase. Answers to both open questions. 1. Reference arithmetic. Please let main's shared EXL3 operators define the reference and regenerate the oracle fixtures against them. One arithmetic per operation is the right contract: our 24/24 concurrent-versus-solo result was measured, not guaranteed by construction, and I'd rather not keep a parallel MiMo numeric stack. Nothing MiMo-specific needs to survive in the linears or experts. The router tile switch came from the Python engine's Two requests so the port keeps what the branch was for:
I can run both on two Sparks against your port branch and post the receipts; point me at it. 2. Checkpoint, vision inventory, workload (your 17 Oct note)
Nothing in progress on the branch, so no collision risk. |
|
Thanks Synthema. To avoid duplicated effort: I've rebased #728 onto current main ( I also fixed two points from your earlier review. Admission now uses main's
|
ashhart
left a comment
There was a problem hiding this comment.
Thanks @ajensenwaud. Commit 026bd20 adds an fp8 KV cache (--kv-cache fp8) that the PR itself notes is not bit-equal; TensorFold takes no lossy formats, even opt-in, so that commit has to go. Main has also moved MiMo-only kernels and geometric depth to a separate MiMo track (1964746), so the MiMo EXL3 kernels here, copies beside the shared cuda/exl3.zig, need to fit that plan and be registered with the kernel contract. It's about 150 commits behind and conflicts in docs/recipes/README.md and native/cuda.zig. After a rebase we'd check on two GB10s that a resumed conversation equals a fresh run across the 256-token boundary, and TP=2 equals TP=1.
|
Review against main e9b69ed. Commit 026bd20 adds an 8-bit key/value cache (
|
|
Yes in progress. Working on it. |
… for gate 5 contract_mimo*.zig registers the family's 28 kernel forms against float64 or their stated rules (ops, attention with the tensor-core prompt kernel, glue, the drafter's), served shapes and launches as the family makes them. mimo_cuda_records.zig carries their sm_121 usage from nvcc 13.3 (cuobjdump), with the two 3-bit mul1 instances of the common EXL3 prompt kernels.
… shallower top-8 tree mimo_attn_rows runs a chunk's G <= 16 query heads as one m16 tile on the prompt kernel's loads and mma, keys in 64-key tiles at multiples of 64 split over four warps whose partials fold in warp order; p in fp16 for o (the contract's allowance as the prompt kernel's). A row's bits still depend only on its own position and window. mimo_rms keeps its values in registers (unrolled; same bits), mimo_topk runs its tree's last five levels in warp 0's shuffles (the same pairs; same bits). Sliding rows go from 72 to 8.5 us, norms from 11 to 5.7 us.
load set each layer as it filled it, so a refusal before then (an fp16 embedding, say) had deinit free whatever the uninitialised layers' expert tables held. Every layer now starts blank, without experts. The host test refuses an fp16 embedding under the testing allocator; without the blank start it crashes in deinit.
… GPU weightShare read TF_TP_* with catch null, so a malformed world or rank was admitted as one GPU's share. It now returns BadSetting as open does, and the admission reports it through the family's explain. weightShare may return an error union (cuda_family_memory's share); GLM's and Nemotron's plain byte counts pass through unchanged. TF_TP_WORLD unset is still one GPU. Host test: unset, six malformed settings, and a two-rank share.
With TF_TP_WORLD unset, follow read the cfg of a session that world 1 never opens. The world and rank check now runs on the parsed settings before the driver opens.
…wn per format The 3-bit mul1 commit made exl3_prompt.Kernels' gateup and down [2]Function (one per format), so the host test sets both with @Splat. No engine or kernel code changes. Co-authored-by: ajensenwaud <5827908+ajensenwaud@users.noreply.github.com>
Main's lean check now refuses a getenv of a name that is not a literal, so the family's own TF_TP_* getter goes. open and the weight share check TF_TP_WORLD by its literal name (unset or blank is one GPU, refused by name as before: tp's own default is two) and read the settings through tp.Config.fromEnv, so a malformed one is still BadSetting. The weight-share test reads its fake environments through the same rule (tpFrom). Co-authored-by: ajensenwaud <5827908+ajensenwaud@users.noreply.github.com>
MiMo-V2's prompt attention keeps its cp.async, ldmatrix and FP16 mma atoms and its ops keep their warp and block sums. The FP16 mma and the block sum's total broadcast have no shared form; the others match the common headers' instructions and move to them once nvcc shows the same machine code on the family's GB10 run.
The DFlash and glue kernels' comments that ran one sentence over blank-separated lines are whole sentences now, and the trailing comments past 120 columns are shorter or sit on the line above. No code changes.
…ecords Main's shared-id ABI (skip) made exl3_prompt_pending own the prompt kernels' usage, and the reconcile added the mul1 instances there; their sm_121 records in mimo_cuda_records.zig were measured before skip and usageFor never reads them. They go, so each launch is listed once.
Keep main copy_guard initialization, copy-price state, timing and retained context alongside MiMo geometric depth. Keep main Qwen3 ASR and GLM MoE contract sets registered and deinitialized alongside the MiMo set. Move shared pricing test registrations to the lane root to keep depth.zig within the 600-line cap without dropping test coverage.
Keep MiMo's geometric one-pass cost for opted-in lone streams while preserving main's fixed_draft_block and shared_step_ms pricing for every other lane depth.
…_* share Main's cuda_family_memory now calls F.weightShare(a, io, dir, whole, drafts, rank, tp) for every CUDA family. MiMo-V2 declares no Options.rank, so the server's own place for it is always rank 0 of 1; its two ranks are TF_TP_*'s, the split matrices divided evenly between them. The new rank and world are taken and not used, and the share is the one it computed before.
…rnels This branch registers tf_exl3_prompt_gu_k6_mul1 and tf_exl3_prompt_down_k6_mul1 as pending, like main's four EXL3 prompt kernels, but the test still counted four records' pending checks. Six records at five compiler versions are 30; every record is still asserted unmeasured at every version.
The records come from nvcc 13.0 and 13.3 compiling exl3_experts per SM for sm_80, 86, 89, 120 and 121. 13.0's usage is the record and 13.3's its receipt; 13.2 stays pending, with no 13.2 compiler to measure on.
|
Thanks, Ash.
|
|
I tested the revised head zig build test-kernel-contract test-exl3-prompt-host -Dfixed-cpu -j2 --summary all
zig build check-native-cuda-host -Dtarget=aarch64-linux-gnu -Dfixed-cpu -j2 --summary allOn M5 Max, 326/326 tests passed and the ARM64 Linux native CUDA adapter compiled. This verifies the checked-in registry and host integration. Fresh nvcc resource measurements, the two-GB10 token comparison and the served performance run remain outside this receipt. Igor Lessio - AIFLOW LABS |
|
Thank you, @ajensenwaud. The rebase retains your work, GLM's BF16 prompt input, and MiMo-only geometric depth. The two new prompt kernels now have 13.0 resource records and 13.3 overrides; 13.2 remains pending. This is ready for controlled comparisons after maintainer integration preserves the newer family registrations. Fresh compiler measurements and exact serial, drafted and resumed token comparisons on the final tree remain before landing.
|
What this changes
This PR adds Xiaomi's MiMo-V2.6-Flash to the native CUDA engine. It serves the model on two GB10s from a 3-bit EXL3 pack, with the pack's DFlash drafter to speed up decoding and the prompt cache on. The proposal is #725.
Results
Details
Hardware. Two DGX Sparks (GB10, sm_121) linked over RoCE.
Checkpoints. Model
XiaomiMiMo/MiMo-V2.6-Flash-RLat5711b268. Served packajensenwaud/MiMo-V2.6-Flash-RL-exl3-3.0bpwat139d9a4e. Drafter frombenthecarman/MiMo-V2.6-Flash-RL-exl3at5ae87b83.Run dates. On the previous head, which still had the load-ahead now in exl3 cuda: the grouped experts kernel loads a tile ahead #1505. MiMo's logits are byte-identical without it, so accuracy and exactness hold, but decode is a little slower until exl3 cuda: the grouped experts kernel loads a tile ahead #1505 lands.
Accuracy figures. Mean KL 0.0043 nats, against exllamav3's 0.0019 when compared with itself. Next-token loss 0.4957, against exllamav3's 0.4984.
Decode figures. 512-token replies at temperature 0, in tokens a second for chat, code, agent and report prompts:
Prompt speed. A cold prompt reads at 1,106 tokens a second at 8K, 1,037 at 32K and 962 at 64K.
Host tests. The lean checker finds 426 problems, the same as main.
Remaining work. Decode is about 0.8 ms a token behind the old captured-kernel build, and one-GPU serving needs its own checks.
Merge order. Muse Spark Open on CUDA, on two GB10s #1295 adds its family at the same three build lines, so whichever lands second needs a one-line rebase.
Recipe. https://github.com/ajensenwaud/MiMo-V2.6-2x-DGX-Spark-TensorFold
Every position where the top tokens differ from exllamav3's
Margin = exllamav3's top-1 minus top-2 (logit, prob). "rank" = where this PR puts exllamav3's top-1. Token = id
text. Next = the teacher token at that position.messagemysterious(16.8438, 0.1630)strange(0.1622)comingcoming(18.8438, 0.2429)storm(0.2410)TheHe(18.0312, 0.3508)The(0.3144)gratitudewonder(22.4688, 0.4402)gratitude(0.4338)aa(17.0625, 0.1783)from(0.2353)lmessage(17.3125, 0.3852)l(0.3987)wouldwould(23.4062, 0.4174)climbed(0.3757)lodgedlodged(22.2188, 0.2552)half(0.2813),in(25.7188, 0.4495),(0.4278)无法不能(21.8906, 0.2774)无法(0.3350)粒子两个(22.5000, 0.4304)粒子(0.4073)。的状态(25.8438, 0.3952)。(0.4682),.(23.8594, 0.3009),(0.3421)\n\nLet(14.8438, 0.0822)\n\n(0.0781)::\n(17.7812, 0.2198):(0.2269)**Rename(16.1406, 0.1151)**(0.0988)AnswerExpected(16.0625, 0.0680)Answer(0.0761)countcount(24.5781, 0.5373)cnt(0.5366):):\n(30.0312, 0.5592):(0.5490)TheRot(22.9062, 0.4174)The(0.4054)!I(8.7500, 0.0129),(0.0173)-g-g(17.5156, 0.0956)-m(0.0996)-First(14.1562, 0.0263)-(0.0298)II(20.8594, 0.3520)The(0.3544)correctlycorrectly(24.6719, 0.4150)fine(0.4299)tryingtrying(17.5000, 0.1722)not(0.1535)The two exact ties, both in the
shorttext, where exllamav3's top two are equal and our top token is one of them:SpriteSpriteand 51548Collision(16.4219)Sprite(0.1737)spriteplayerand 17051sprite(18.4219)sprite(0.3132)