Repository navigation
Conversation
…cache; Gemma 4 and Qwen 3.5 CUDA use it Each layer's tensors are read with direct_gather into an arena, and Checkpoint.get returns those copies in place of the mapping. Layer i+1 is read on a thread of its own while layer i packs. TF_LOAD_DIRECT=0, or TF_LOAD_PREFETCH=0, keeps the page-cache read-ahead of ashhart#1928.
…ast read's are used; Flash Next and checkpoint.direct share it Flash Next's expert loader had its own two-arena gather thread (ashhart#1960). It moves onto core's Pair, with its chunk mark as the read's hook, so the double-buffered read lives in one place.
…shhart#1762) and add+norm under 1 %, direct load for Gemma 4 and Qwen 3.5 (ashhart#2282), Nemotron's done, q27 Metal pages (ashhart#2283)
|
Thanks @jschmied. One shared direct loader with the next layer read while this one packs is a clean way to give Gemma 4 and Qwen 3.5 what Nemotron already has, and 28–31% faster cold loads with identical replies is a good result. Since this changes the default load path, two things before it queues:
The Flash Next part reads correctly to us; its speed is reviewed separately. |
|
Thanks @jschmied. The Flash Next side is fine.
Your level cold load on FP4 does exercise this path, since that checkpoint is ModelOpt and loads through |
|
Thanks @ashhart. The CHANGELOG line is in: b84620b. We have no discrete card here, only the GB10, so I can't do the second one myself. @BobClawblaw, could you run this on your RTX 5090, if that host loads from an ordinary NVMe drive? One cold load, On the GB10 the same comparison gave −28 % on Qwen3.8-27B NVFP4. On a discrete card the time goes to the disk and to the upload to the card, so the gain may well be smaller. That is what we'd like to see. |
|
Thanks @jschmied. The CHANGELOG line covers it: direct reads as the default, the extra host memory and |
|
/atc exchange 1816bcede6594bf1f83f3eef2a5a40c988a1bb32958fcfdbf10d8b7d29bb9482 |
…shhart#1762) and add+norm under 1 %, direct load for Gemma 4 and Qwen 3.5 (ashhart#2282), Nemotron's done, q27 Metal pages (ashhart#2283)
…shhart#1762) and add+norm under 1 %, direct load for Gemma 4 and Qwen 3.5 (ashhart#2282), Nemotron's done, q27 Metal pages (ashhart#2283)
|
Our cells on this head (
It's in the landing queue now. |
Gemma 4 and Qwen 3.5 on CUDA now read their checkpoints with direct reads. Cold load is 28–31 % faster with the same weights and replies. The loader is shared core code that Flash Next now uses too.
What changes
core/checkpoint_direct.zig(new): a layer loader's tensors are read past the page cache into reused buffers, and the next layer is read while the current one packs.Checkpoint.get()hands out the copies, so each family's change is a few lines in itscuda_weights.zig.TF_LOAD_DIRECT=0keeps core: TF_LOAD_PREFETCH; Gemma 4 and Qwen 3.5 CUDA read each layer ahead while it packs #1928's read-ahead.core/direct_gather.zig:Pairreads the next views on a thread while the last read's are used. Flash Next's own copy of it from flashnext cuda: the direct expert load gathers the next chunk while the current one packs, and tensor() stops reopening shards #1960 now uses this one.Measured (one GB10, page cache dropped before every start, A-B-B-A)
maincold load (s)Checks
zig build testandtest-cuda-hostpass, and so does the no-GPU CI set.zig fmt --checkandgit diff --checkare clean.main.