Repository navigation
fix(flashnext): a HIP round's graph replays only over its pool slot's caches - #963
Conversation
… caches A graph keyed by a pool slot names the buffers that slot was made with, but keyOf only checked the caches' capacity: caches made outside the pool (id 0 by default) took slot 0's graphs and replayed them over another allocation. tf-flashnext-hip-test made fresh caches for each --repeat run and freed them after, so a later run replayed run 1's graphs over run 1's freed buffers; whether it gave graphs-off's logits depended on the allocator handing the same addresses back. At tp 4 on gfx1030 with the RDNA RCCL build, run 2's n-gram conv input (cin) moved and its logits differed from graphs off. cache.Pool keeps each slot's buffers as made, and keyOf refuses caches that do not hold them (CachesNotPooled). The test tool takes slot 0 from the pool for every run, as a served stream does. A host test chooses a round over caches made outside the pool: it got the slot's graph (capture) before, and is refused now.
|
Thank you @BlivionIaG. Checked on gfx1151 (Strix Halo, Radeon 8060S), Zig 0.17.0, host side only: the new test fails on main 46a08c1 with |
|
Thank you, @BlivionIaG, for the graph-cache identity reproducer and correction of the earlier repeat receipt. We merged your fix for 1.1.0 in 2406aa0. Each pool slot retains the buffers, window and input bases its graph names. A same-capacity cache created outside that pool is refused with The regression checks that false match directly. Served streams continue to lease their own pool caches. Host cache-identity/ownership checks passed; a final HIP device rerun is not recorded. Posted by Ash's AI Assistant Synthena |
…ts pool slot was made with
What this changes
A Flash Next HIP round graph names the buffers of the pool slot it was recorded for.
keyOfchecked only the caches' capacity, so caches made outside the pool (id 0) took slot 0's graph and replayed it over other buffers.tf-flashnext-hip-testmade new caches for each--repeatrun and freed them after, so a later run replayed run 1's graph over freed buffers.cache.Poolkeeps the buffers each slot was made with;Pool.holds(c)tells ifcis that slot's own.keyOfrefuses caches the pool does not hold (CachesNotPooled).tf-flashnext-hip-testtakes slot 0 from the pool for each run, as a served stream does.The served path already used pool slots, so served replies do not change. The fault is in our #818: its receipt ran with the system RCCL, where the freed buffers came back at the same addresses. With the RDNA RCCL build, run 2's n-gram conv input moved and its logits differed from graphs off.
Receipt
Environment: main 46a08c1 and this branch 54b7407; Zig 0.17.0, HIP 7.14; RCCL from ROCm 7.14 and the RDNA build; 4 × Radeon PRO V620 (gfx1030), 2 × Radeon PRO W7800 (gfx1100); Qwen3.8-Flash-Next-MLX-4bit-MTP and -3bit-MTP.
Exactness:
tf-flashnext-hip-test generate --hash--repeat 3, RDNA RCCL349d2996…,52fe0f9b…,349d2996…349d2996…× 3 (twice)349d2996…× 3349d2996…× 3349d2996…× 3349d2996…× 3--repeat 26fbb0a3f…× 26fbb0a3f…× 2tools/bench_concurrent.py --levels 1,4 --alone --serial --temperatures 0,1 --tokens 128 --reps 2on 4 × V620 tp 4: 8 cells, every alone and serial run equal, 0 failed.Decode speed,
tools/bench_openai.py --tokens 256 --reps 3 --temperatures 0, 4 × V620 tp 4, runs alternated: main 99.92 and 99.49 tok/s (code), 80.44 and 80.08 (chat); this branch 99.80 and 99.54, 80.18 and 80.23.Prompt speed: n/a, the change is in the decode round's graph key.
Tests run:
zig build test -Dcpu=apple_m1: 204/204 steps, 2990/3000 tests (10 skipped); main 2989/2999.test-golden: 309/319 equal, 0 unexpected.zig build testpasses.zig fmt --checkis clean.lean_check.py517, the same as main.Not run, and why: Metal and CUDA (files untouched).
Checklist
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo.