Repository navigation
glm/cuda: TF_GLM_KDA_PAD tells unset from 0 across the ranks; unset stays off (for #3516) - #3519
ultradaoto wants to merge 3 commits into
Conversation
…lines merge without a conflict
|
Thanks @ultradaoto, this is a clean piece of work. The tri-state setting, the fingerprint carrying unset apart from on and off, and the world walk in the test are all as they should be, and at worlds 1, 2, 4 and 8 every byte stays as before. The measurements read well too: bf16 first tokens 8 to 9 percent sooner with decode level, and the dense bits arm faster again. One thing holds it, and it is the default. With the setting unset, worlds 3, 5, 6 and 7 change their replies, and our rule is that a change keeps every token unless the maintainers rule otherwise, and #3516's quality case is waiting on exactly that ruling, so please keep unset meaning off for now, with Please also post CI green for the head. We will run the device check on our side once the default is off: GLM-5.3-Flash on GB10s at world 4 unset (every hash equal main's) and at world 3 with the setting on.
|
…hart#3516 Review asked that unset keep serving unpadded until the maintainers rule on the reply change at worlds 3, 5, 6 and 7. One constant holds what unset means there, and it is off; the tri-state setting and its fingerprint are unchanged.
|
Thanks. Done in
On CI: the runs for this branch stop at |
|
Thanks @ultradaoto for turning this round so quickly. Looking again at what is left at this head, we are going to close the PR. I'm sorry this goes back on our earlier "everything else can land" note. Here is the reasoning:
The measurements are still useful. If the padded stack can be made to give the unpadded stack's exact bytes (same sum order and the same precision in the tiled path, so every reply hash equals main's), the 8–9% first-token gain would be welcome as a new PR. It would also need no switch at all.
|
For #3516. After review, an unset
TF_GLM_KDA_PADstays off; this lands everything else and leaves the default to the maintainers' ruling there.Settings.kda_padis now?bool, so unset is distinct from 0. The rank fingerprint carries 0 for unset, 1 for on and 2 for off, so ranks still have to agree.kdaPadded(settings, uneven)decides. One constant,pad_uneven_unset, holds what unset means where some rank's KDA head count, and so its row width (384 a head plus 256), is not a multiple of 8 (worlds 3, 5, 6 and 7 on GLM-5.3-Flash's 64 heads). It isfalse, so unset is unpadded on every world.TF_GLM_KDA_PAD=1and=0force it either way, as on main.pad_tois 0 on every world and every byte is main's; with 1 the stack is main'sTF_GLM_KDA_PAD=1.zig build test-cuda-hostwith the pushed Zig files: 4,261 of the 4,274 tests it ran pass and 12 skip (steps unchanged since the first push reused their cached passes). The one failure,cli_config_test'sserve --config: expand reads the file ..., fails the same way on main on this host.zig fmt --checkis clean on the family's folder;pr_check: 0 errors, 0 new lean findings.The receipts below were measured on the first push, where unset padded at world 3. On this head that path is
TF_GLM_KDA_PAD=1(the code under the switch is unchanged) and unset is main's path; I have not run them again on this head. Main (cf45553) against the first push (the same diff oncf45553) on three GB10s,--parallel 4 --kv-cache fp8, greedy, thinking off, two starts each,tools/bench_openai.py --tokens 256 --reps 3andtools/bench_concurrent.py --tokens 256 --reps 3 --levels 1,4 --alone --serial, plus cold first-token times. One number per start:bench_openaidecode, code / chat (tok/s)bench_concurrentcode, 1 / 4 streamsTF_GLM_DENSE_BITS=8 TF_GLM_HEAD_BITS=8At bf16 the padded stack also tiles in prompt passes, so cold prompts' first tokens come 8–9% sooner; bf16 decode is level within the noise of these tools (bench16 measured +2.1%). With dense bits the padded stack logs
glm: 290 linears packed (8/8 bits)(unpadded: 188). Padded replies differ from unpadded ones (0 of 36 hashes equal; each run repeats its own), because the stack's kernel changes and with dense bits so does its precision; see #3516 for quality.