Repository navigation
Ling-3.1-flash on CUDA, on one or two GB10s - #2340
ajensenwaud wants to merge 31 commits into
Conversation
|
Thank you, @ajensenwaud, for #2340 and for splitting the shared pieces out as #2334–#2339. Having the family on top of them makes the whole of #850 step 5 easy to see. Landing order. #2142, then #2338, #2334, #2335, #2336, #2339 and #2337, each on its own receipts; the family last. Please move the contract records and tests for the Before the family leaves draft:
YaRN and the split latent cache as an opt-in. Today they switch on from Device evidence. Could you post GLM main-against-branch numbers from your GB10s on this base: Thank you again. |
d8e3d27 to
088bba9
Compare
|
Thanks @ashhart. #2340 is now the core you suggested: Ling-3.1-flash on EXL3 at TP=1 and TP=2, inside the native 262,144-token window. The body has the commits, checks and receipts.
|
088bba9 to
09fa6f3
Compare
|
Thanks @ajensenwaud, the cut to the core reads well. The shared pieces are on main, the contract here holds only On GLM: this head only makes A few small things before it lands:
This lands after #2338. Main is frozen for a release right now, so once these are in and the freeze lifts, it goes on
|
|
Thanks @ashhart. All five are done in
Rows where our top-1 differs from exllamav3's (margins in nats)Agent text
English prose
|
|
Thanks @ajensenwaud, all five are in on
#2338 is on main now, and its two commits on this branch match main's, so they drop out when this lands. Main's GLM router, which Ling calls through
|
|
@ajensenwaud our GB10 run is in. We built this head merged with today's main (CUDA tests included, so the GLM router change under
|
|
Thank you! |
|
@ajensenwaud one small thing before this lands: main moved under it this morning, and
|
26262ae to
676c4fe
Compare
|
Thanks, Ash. The branch is rebased onto main
|
…F_LING_RANK and TF_LING_WORLD registered, NCCL names literal, RoCE at GLM's default cap
…s main's registry test asks of every family with a host prompt cache
…kBias before it uploads it (a group holding +inf and -inf scores NaN, which the kernel always keeps), refused by name
… the checkpoint opens; config.parse keeps the head counts
…ows has no libc setenv, so test-cuda-host failed to link there)
…ers_ref.py, ling_ref_stream.py, ling_check.py --misses, ling_texts.json) and ling-tp --ids; the orphan ling_weights.py removed
…rary checkpoint, so dropping the call fails it
…rates) and carries the closeness and GSM8K numbers
…#2843 asks Main's ashhart#2843 (3768bc0) gave Grouped.decode, Grouped.prompt and exl3_grouped.Grouped.run the real pair count and the caller's tile, and sizes the EXL3 storage by pairs. Ling's block_ffn passes rows * slots and its own tile (16 for decode, promptTile for a prompt pass), as every other family does. The device checks pass the tile their plans were routed at (16, or ling_clamp's prompt tile); ling_exl3_clamp drops the old ignored bool.
ashhart#2340 registers the ling_glue and ling_act images in kernels.zig; no existing kernel source changed. The serving pins run on every PR since ashhart#3011.
Format current-main conflict resolutions and remove only blank separators needed for the 600-line source cap. No runtime behavior or test assertions change.
Follows main c2a6b0b, which adds the Idol decoder set as the last allocation. Ling now follows it, so release that set if the new allocation fails; the successful path and every existing family remain unchanged.
|
Thanks, @ajensenwaud. I found three things to fix in the Ling PR.
|
Engine.free and deinit ignored a failed synchronize and freed the memory anyway, so queued work could still touch it. They now call cuda.completion.drain, as GLM does; a failed open leaks the arenas instead when its drain fails.
At TP=2 a drop that ran out of memory freed rank 0's copy without telling rank 1. keep now reserves the room for its later drop, and makes every allocation before rank 1 hears of the keep.
The check expected a .weight for every linear. It now reads each trellis group (trellis, suh, svh and codebook marker) through the loader's own exl3Group, accepts the fp16 tensors exllamav3 leaves unquantized, and follows the fused KDA qkv_proj and conv1d.
|
Thanks, Ash. All three are fixed in three commits on top of
None of the three changes the model's arithmetic, so the earlier device results still hold. |
|
Thank you for the three focused fixes. Reserving the snapshot and drop-list capacity up front now keeps both ranks consistent when allocation fails. The runtime sequence drains also protect normal release and shutdown. Five cases still need changes before this lands:
We will handle the current-main integration; no rebase is needed from you.
|
The release after a failed admission then names no slot that was never made. ling-init-faults now admits a second stream at every failure point.
Engine.init installs GLM's terminal drain before it binds slot 0: if the open fails from there, the stream drains first or the process ends.
The readiness digest now covers the checkpoint's identity and every shard byte, hashed while each rank loads its share.
|
Thanks, Ash. All five are fixed in five commits on top of
None of the five changes the model's arithmetic. |
What this changes
This PR adds inclusionAI's Ling-3.1-flash to the native CUDA server. It serves EXL3 packs on one GB10 or across two at TP=2, within the model's native window of 262,144 tokens. It is step 5 of #850, cut down at review to the core family, and it builds on Jürgen Schmied's TP=1 port in #874 and the host package in #1541.
bailing_moe_v3) has 63 KDA layers and 9 MLA layers, with 512 routed experts chosen by group-limited sigmoid routing.ling_glue, which joins the layers together, andling_act, which applies Ling's activation function. The only change to GLM's code is that one merge function,latent.merge, becomes public.rope_scaling, the usual way of extending a model's context.ling-init-faults, found two places where a failed load did not clean up after itself. Both are fixed.Three features were moved out at review and will follow as separate PRs:
--rope-yarnswitch, so that raising--contextalone never changes a reply.FP8 and NVFP4 loading is dropped for now.
atc overlap --json: not runChecks on this head
676c4fe82, 14 commits on main000b534a2.zig fmt --checkandgit diff --checkare clean.zig build test-environment-host test-ling test-cuda-host test-kernel-symbols-host --summary allpasses all 393 steps on Linux x86, without a GPU.09fa6f39e, before the review commits, the full host suite passed 711 of 711 steps, with 8,774 of 8,844 tests passing and 70 skipped.kdaGeometrycall removed fromweights.open,test-lingfails; with it restored, it passes.26262aea7, and running on this one.This PR's commits
40f708c1c: the Ling-3.1-flash family itself, co-authored with Jürgen Schmied.28758c8e7: the family's kernels registered with the kernel contract.1411ff316,7ae198a4c,a9eba7bbf: the two cleanup leaksling-init-faultsfound, and the fake driver's reset.7b0b80cf2: a corrected gate-5 record fortf_ling_swiglu_64.d1c5df97d,d0cc02b5d: main's rules for settings and for the prompt-cache registry.0cce11312,3bb2d2b55: the load-time refusals of an infiniteexpert_biaspair and of an unsupported KDA shape.39ef58329: NCCL settings throughsys.env, so the Windows build links.1c658fa70,8127bc2ac,676c4fe82: the review round's scripts, test and recipe changes.Receipt
09fa6f39e. No later commit changes a kernel or what Ling computes. The later commits add refusals, scripts, tests and docs, and route settings through main's environment table.Closeness against exllamav3. The reference is exllamav3 v1.6.6 on the same EXL3 pack, over four public texts of 512 tokens each: 256 prompt tokens, then the rest forced as decode rows. The floor is exllamav3 measured against itself, comparing its forward of a shorter prefix with its full forward. "Release" is our released LingSpark build, which uses its own routing kernel; this PR uses #2334's shared one.
GSM8K. On 500 fixed items at TP=2, this PR scores 488 and the release build 489 (97.6% against 97.8%), with McNemar exact p = 1.0. Settings were thinking on, temperature 1.0, top_p 0.95, top_k 20, seed 1234, and a 32,768-token budget. Five of this PR's replies hit the budget, against two of the release build's; the median reply is 324.5 tokens on this PR and 322 on the release build.
Device gates.
ling-contract: all 11 kernels pass gates 1-4.ling-lanes: all 102 checks pass. Chunked equals whole, drafted equals plain, resumed equals fresh and concurrent equals solo, byte for byte.ling-init-faults: 579 failure points, each refused cleanly once the two leaks were fixed.kernel-contract: our kernels pass gates 1-4, every planted control fails as planted, and the limit problems match main's count.glm-ref: identical on main and on this branch.TP=2 on the full pack.
With the full pack served at TP=2 (four streams, greedy, prompts of about 5,750 tokens), drafted replies equal
"draft": false, four concurrent requests equal the same four run alone, and resumed turns equal fresh ones. Each comparison is on the reply's token sha.The full 184 GB pack does not fit one GB10, so TP=1 and TP=2 were compared on its first 24 layers. TP=2 is byte-identical across runs, and the two part only at a token where TP=1's top two candidates are exactly tied.
Licence of any new weights or drafter: n/a. Ling-3.1-flash is MIT-licensed, and there is no drafter.
Kernel contract
tf_ling_add,tf_ling_combine,tf_ling_copy_rowsandtf_ling_pattninling_glue, andtf_ling_swiglu_512andtf_ling_swiglu_64inling_act. All 11 pass gates 1-4 on sm_121.mlaimage's entries are in cuda: a shared MLA image for 64 roped columns and 128-wide heads, on GLM's chunk bodies #2335,tf_exl3_plan_finish_afteris in cuda exl3 experts: the SwiGLU clamp on silu's output (tf_exl3_plan_finish_after) #2336, and the group-limited top-k is in cuda moe glue: group-limited selection in the sigmoid score form #2334.ling_cuda_records.zigand 13.3 inpending_133; 13.2 is pending. The 13.0 records matchcuobjdump -res-usageon all five SMs.