Repository navigation
qwen3_5 cuda: the dense family has a rank plan, host only; it moves no tokens - #3383
Merged
Merged
Conversation
Owner
|
@Nipale-ai, thank you. We read the series against main. With READY: it goes in the landing queue.
|
This was referenced Nov 16, 2026
…o tokens The Qwen3.5 CUDA Options take tp, rank and master as Flash Next's do, and cuda_shard.zig plans the dense hybrid's even split for a rank of a world: whole query, KV, key and value heads, the packed in_proj_qkv segments, the MLP rows and the vocabulary in 128-tiles. A width or half off the tiles is refused by name, never rounded. No rank serves yet: --tp on the dense family, --tp on qwen3_5_moe (which shares Options) and --learn-conversations at --tp are each refused by name. Refs ashhart#3325
test-native-options-host builds cuda_options.zig with engine_api alone, so the test that imported qwen35 there stopped test-host with "no module named 'qwen35' available within module 'root'". The same test now sits beside the other Qwen3.5 refusal tests in cuda_refusal.zig and reaches set() through cuda_options.zig; cuda_options.zig is back to main's text. Refs ashhart#3325
ashhart
force-pushed
the
qwen35-cuda-ranks-host-3325
branch
from
November 16, 2026 11:55
bbd9f8c to
8edf2b6
Compare
Owner
|
Thank you @Nipale-ai. 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 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
Step 1 of #3325, host only. The Qwen3.5 CUDA family's
Options(qwen3_5_moeshares them) now carrytp,rank,masterandmaster_port, as Flash Next's do, and the newcuda_shard.zigplans one rank's share of the dense hybrid (the 27B): whole query, KV, key and value heads, the three packedin_proj_qkvsegments each cut at its own offset, the MLP rows and the vocabulary rows in 128-element EXL3 tiles. A width or a half that leaves the tiles, a head count that does not split, a bad rank and an empty share each fail with their own error, never rounded. The plan's tests pin the spans at TP=1, 2 and 4 on the 27B's widths (TP=8 is refused: 1,940 vocabulary tiles do not split by 8), and a second test declares the same shares asfabric/mesh/shard.zigdeclarations for worlds 1 to 16 and compares them, refusals and their order included.This moves no token and needs no GPU. Before: no rank field, and
--tp 2stopped at "this CUDA family has no tensor-parallel ranks". After:--tpabove 1 is still refused before any device work, now by name: the dense family says it plans its shards but serves no rank yet,qwen3_5_moesays it has no plan and no ranks (it sharesOptions, so the field alone would have made it look ranked), and--learn-conversationsat--tpgets its own sentence for this family, which declares no one-rank kept disk. With--tp 1the only change is fourOptionsfields with defaults; every other family's refusals are unchanged. Steps 2 and later (the weight cut, the ring, the first ranked token) are not part of this.atc overlap --json(atc 0.9.6, withATC_READ_ONLY=1), run in this tree on 2026-11-14 at 23:20 CET, base main2ba55ec7d, this headbbd9f8ca8:complete: false(otherPullRequestsLimit,pullFilesUnavailable,pullRequestsLimit,timeLimit), 17 overlaps, 10 clean, 7 unknown (the limits above), 0 conflicts. The clean ones include CUDA: #1764's BF16 prompt tile for Qwen ModelOpt, Nemotron and Dory, plus two exact Qwen prompt kernels (#1762) #2008, GLM-5.3-Flash on CUDA keeps conversation states on disk, every rank's part (--learn-conversations) #1411, fabric/mesh: one launch description, --tp up to 64 and the rank aliases (T1a of #2560) #2917, GLM on CUDA: owner-only latent rows and owner-computed attention (TF_GLM_KV_SPLIT, #1431 part 2; stacked on #2415) #2935, GLM on CUDA: the prompt history fetch under the latent split (TF_GLM_KV_SPLIT, #1431 part 3; stacked on #2935) #2937 and GLM on CUDA: kept states, carries and prompt twins under the latent split (TF_GLM_KV_SPLIT, #1431 part 4; stacked on #2937) #2938, which each share at least one file with this change; I also merged this head with each of those six withgit merge-tree, and all merge cleanly. idol: Idol's denoiser on CUDA (stacked on #1766) #1767, fix(cuda): allocate Qwen3.5 scratch at load #1879, Living Weights: slide-forget counting only with --slide-forget, Metal's mask shift for wide pockets (#678) #2026 and Prefill on a GB10, decode on a Mac: long prompts for Qwen3.8-27B handed over ConnectX (#1594, step 2b) #2648 already conflict with main, in files this change does not touch (a fixture,CHANGELOG.md,routes.zig).Checks on this head
python3 tools/zig/lean_check.py, on the base and on this head: 341 on the base, 341 on this head, 0 new (6,454 and 6,456 files; all 341 inherited).python3 tools/pr_check.py --base origin/main --pr 3383: 7 changed files, 0 errors; the one warning is that no Unreleased bullet names this PR yet (this change carries no CHANGELOG line).zig build test test-golden -Dcpu=apple_m1 --summary allon a fresh cache: 872/872 steps succeeded, 14079 of 14197 tests passed, 118 skipped, 0 failed. The Metal toolchain installed on this Mac was older than macOS asked for, so the shader steps ran with the oldermetalbinary; no kernel is touched here.zig build test-cuda-host --summary allon a fresh cache: 410/410 steps, 6751 of 6791 tests passed, 40 skipped, 0 failed. On main at 2ba55ec the same step gives 408/408 steps, 6718 of 6758 passed, 40 skipped.zig fmt --check build.zig zigandgit diff --check origin/main: clean.cuda_shard.zig, 2 incuda_shard_decl_test.zig, 1 named and 1 unnamed inqwen3_5/cuda.zig(the second pulls the plan's tests into the family's root; the first checks the plan's head widths againstcuda_geometry.zig), 4 incuda_refusal.zig.test-cuda-hostreaches all of them.test-cuda-hoststops withunable to load "cuda_shard.zig": FileNotFoundand, incuda_refusal.zig,use of undeclared identifierforqwen35_plan_only,qwen35_moe_no_ranksandqwen35_learn_ranks; the options test alone stops withno field named 'tp' in struct 'cuda_native.Options'(shown while it still sat incuda_options.zig, same body; not repeated after the move). Each new test file was also shown red once with a planted wrong value on this head (5 tests in 5 files, 6 failures as planted; then restored).test-native-options-host. That step buildscuda_options.zigwithengine_apialone, so the options test's@import("qwen35")found no module. The second commit moves that test tocuda_refusal.zig, where the family module is wired, andcuda_options.zigis back to main's text.zig build test-native-options-host test-release-cuda-refusal-hoston this head: 8/8 steps, 4/4 tests. I will read CI on this head.test-hostitself, which exists on Linux only (on macOS I ran everytest-*,check-*andcompile-*step of this tree instead: 2701/2705 steps succeeded, 24916 of 25094 tests passed, 178 skipped; the 2 failed steps aretest-grammar-budgetandtest-grammar-tools, which need-Dxgrammar=DIRand stop the same way on main);zig build dev-tools(macOS; only CUDA-side files and the host build wiring change).Receipt
n/a: this reaches no inference.
--tpabove 1 is refused infamily()before any device work or weight read, and with--tp 1the only change is fourOptionsfields with their defaults, which nothing reads yet. The first ranked token and its exactness checks belong to the later steps.Checklist