Repository navigation
One Buffer per Attention unit - #40
almogtavor wants to merge 2 commits into
Conversation
Each Attention unit gets its own Gloo subgroup and Buffer, so an exchange or a close on one unit involves only the FFN ranks and that unit. The FFN ranks still wait for every unit they receive from. Lanes and Units share the helpers that give each Buffer its own communication stream.
|
|
Performance: not ready to merge yet. I measured decode throughput with one Buffer for all units against one Buffer per unit. The FFN ranks wait for every unit in both cases. With one Buffer per unit, throughput is equal at the small load and lower at the large load. Sum of rounds per second over 6 units, median of 5 repetitions:
Setup: 8x H100 in one NVLink domain, 6 Attention units of one rank each, 2 FFN ranks, hidden size 4096, top-k 10, 256 experts per FFN rank. The routes and hidden states are a replay of Qwen/Qwen3.5-397B-A17B-FP8 layer 31 on ShareGPT V3. Each round includes the Attention computation of the layer on the Attention ranks and the expert computation on the FFN ranks, so these are rounds of one decoder layer, not serving throughput. The numbers were measured on the tree of #33, which contains this change (native source digest Most of the loss disappears at alignment 1, so the likely cause is the padding of each expert to 128 rows, which is paid once per unit instead of once in total. I have not yet separated the remaining part. Prefill and mixed load are being measured now. I am going to find the cause before asking for a review. |
|
I tried one shared buffer vs. one buffer per Attention unit on three H100 nodes over RoCE. The separate groups helped at larger batches, but each FFN rank had to keep more GPU memory reserved.
I also kept the ranks and work fixed and ran the same six chunks through either one reused buffer or six separate buffers. Each timing is for all six chunks.
Both tables time communication only. In a separate two-group run, the default GIN settings hit the 8 MiB Could we keep the shared buffer as the default and add a flag for per-unit buffers? |
|
Why would it consume more memory? @Etelis |
Step 1 of #38.
Goal: each Attention unit writes to its own Buffer, so a unit can be added or removed without rebuilding the Buffers of the others.
Units(group, config, units)builds one Buffer per Attention unit over the same FFN ranks. Nothing else changes: the FFN ranks still wait for every unit.Results (8x H100, one NVLink domain, exact match with the single-Buffer reference, eager and CUDA graph):
In every run the last unit closes its Buffer and the other units keep exchanging on theirs.
The existing suite (
tests.gpu.deepep --lanes 2, BF16 and FP8) also passes, and so do the 59 unit tests and Ruff.Not included: DBO inside a unit, and adding a unit while the others run.