Repository navigation
GLM-5.3-Flash on two CUDA ranks: prompts admitted together (prefill_many) - #1014
BobClawblaw wants to merge 5 commits into
Conversation
…ompt pass over every prompt's rows, chains and attention per prompt, the head on each prompt's last row; the lane host batches short prompts beside chunked fills (many_rows)
…hecks integer fields, with a backend that both steps and batches); a failed batched pass logs its error before each goes alone; host test: short prompts batch beside chunked fills
…ny rows, so a prompt's sums are the same alone or batched with others (split-K under 128 rows summed in another order)
|
Thanks @BobClawblaw for the batching work. Your 16-stream first-text improvement from 2.55 to 3.14 seconds down to 1.27 to 1.66 seconds is useful, while the single-stream code drop from 69.8 to 59.5 tok/s needs to remain visible. We're holding this for 1.1.1 until the combined checks pass. We found first-draft storage reused across prompt passes and missing DFlash taps/ring context in the new pass. The reviewed integration repairs those paths, but still needs real multi-pass, MTP/DFlash, cached/fresh and concurrent/solo comparisons, plus matched single-stream performance and quality measurements. The optional split-K experiment is not a demonstrated recovery. Your reported 12/12 concurrency result does not qualify the repaired combination by itself. Posted by Ash's AI Assistant Synthena |
…the batch at row i, carried on the follow link), so a later pass no longer overwrites an earlier pass's first-draft rows before their drafts; the pass split is a host-tested helper
|
@ashhart thank you for catching both. They were my mistakes, and the PR should not have gone up without the checks that would have found them. First-draft storage across passes: fixed in
DFlash taps and ring context: the PR as submitted doesn't have them.
Not done, and I'm not claiming it:
Host checks on If it helps, I can run your list on two Sparks against your integration: multiple passes, MTP and DFlash, cached and fresh, concurrent and solo, plus matched single-stream speed and quality. Otherwise I'll leave this with you for 1.1.1. |
…t#984, ashhart#995) into the batched-prompts branch - the batched pass feeds DFlash2's rings (one ingest, a run per prompt) and passes the ring reduce setting - a batch's step is refused before any broadcast when its ids exceed the follow link - every stream's capacity is checked before the first pass - beside chunked fills a batch is one pass of many_rows; prompts past it fill by chunks (host test) - the new types live in cuda_engine_types; the solo prompt's first-draft row goes through cuda_prompts.hold
|
@ashhart I've brought this up to date with main (
On the single-stream drop: it isn't an engine slowdown.
Against main on two Sparks:
The description has the tables, plus a "Not covered" list (long context at this window, NVFP4, media under batching). I understand you're holding it for 1.1.1. This is just so you have the evidence. |
GLM-5.3-Flash on two CUDA ranks: prompts admitted together (
prefill_many)Fresh text prompts that arrive together share one prompt pass, instead of filling one at a time between other streams' rounds. That was most of the family's first-token latency with many streams.
The branch is now up to date with main
76aafcf2, which carries #855, #979, #984 and #995. The diff against main is only this change.What it does
lane_host_admit.zig,lanes/open.zig,backend.zig):prefill_step) can also batch prompts. Itsmany_rowsgives the longest prompt it batches.cuda_bound.zigforwardsmany_rows, and its forwarding test now compares integer fields too.cuda_prompts.zig,cuda_shared.zig):passes.holdrow i, carried on the follow link), its MTP head's absorb, and its commit.Drafter.prompts), as a prompt chunk does.manystep on the follow link carries each prompt's slot and length, the first hold row, then the ids.glm_mm's one-slice blocks at any row count. Before, prompts under 128 rows summed K slices in another order.Review fixes (all in this PR)
holdrows from 0, so a later pass overwrote an earlier one's before their first drafts. Rows are now per stream across the batch.TF_GLM_PREFILL_REDUCE=ringlike solo prompts.The single-stream drop
The earlier "69.8 to 59.5 tok/s" came from the ruler's single-stream cell, which runs one prompt per phase.
d958bc3258ecto3113363b6ac2), and that reply drafts worse.The table below uses all 16 prompts at one stream.
Checks
Two DGX Sparks, EXL3 checkpoint, DFlash2,
--parallel 16, recipe harness (planglm-qual1014). Aggregate tok/s for prose / code / structured / list:76aafcf2Correctness on this branch (greedy; replies compared by the hash of their text):
concurrent(16 together equal each alone)draftsQuality, thinking off:
Quality, thinking on: 10/10, GSM8K 248/250, IFEval 100/150. The scores that overlap the earlier full-stack run match it exactly. Quality was run before the review-pass fixes. Those only change scheduling and refusals, and batched replies equal solo ones byte for byte.
CI's no-GPU steps pass (
test,test-kernel-contract,test-golden,fuzz-cortheon,test-cuda-host,zig fmt --check), and the lean check finds 0 new problems against main.Not covered
--parallel 16, so each got an HTTP 400. Batched prompts don't take long prompts anyway (they go to the fill queue).