Repository navigation
Conversation
IGNITION_KIMI_PREFILL_DMA_ROWS=R (default 0 = off) makes prefill graphs with capacity >= R reduce over b12x DmaAllReduce at world 8; smaller prefill graphs keep the exact two-shot channel, sized to the largest prefill capacity below R. IGNITION_KIMI_PREFILL_DMA_BF16=1 selects the BF16 hop-sum ring (one pass per reduction) instead of the exact FP32 owner-packet ring, whose graph nodes cost about 0.46 GiB per rank. - PreparationConfig.prefill_dma_ring_rows / prefill_dma_ring_bf16, read from the environment in kimi3/recipe.py prepare_variant (export-time switches, not plan settings, so the package identity is unchanged when off). - prefill_reduction_rows(): ring only at world 8 and R <= chunk. - reduction_runtime(): decode / verify / draft graphs always keep the regular collective; only prefill graphs >= R get the ring. - The ring is created lossless (wire_mode="off", ignores B12X_PCIE_DMA_FP8) and refuses B12X_PCIE_DMA_PIECES. - decoder.py: BF16 hop-sum branch; both DMA branches reject non-prefill modes. - tests/recipes/test_kimi3_prefill_dma_ring.py: CPU tests for the switch, split, selection and call sites. The BF16 hop sums round once per hop (7 roundings at TP8), so the result is not exact: on independent heavy-tailed partials the relative RMS error is about 2x the exact path, and it grows with cancellation between the per-rank partials. On 8x RTX PRO 6000 Max-Q behind two PCIe switches a 3072x7168 reduction takes 1.49 ms vs 1.88 ms for the exact island_eighth all-reduce; first-token logprobs of a model-level A/B stayed within build-to-build noise. Memory: about 0.19 GiB per rank at R=3072. Hand-port of tunamitom/flare-local-inference@bc818b1 and @2f0acabfb88b99f0d62f20511976f6e6f60036ec without the fork's island and FP8-transport prefill commits (which they build on); the inline selection was split into the two pure helpers above for testing, the ring is forced lossless, and the plan-settings recording commit was not ported. Co-authored-by: tunamitom <tunamitom@users.noreply.github.com>
Author
|
GPU-side status of this Flare branch as published (base
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 Description
The design and original implementation are by
tunamitom(fork branch linked above). This is a hand-port onto the release branch.IGNITION_KIMI_PREFILL_DMA_ROWS=R(default 0 = off): at world 8, prefill graphs with capacity >= R reduce over b12xDmaAllReduce. Smaller prefill graphs keep the exact two-shot channel, sized to the largest prefill capacity below R. Decode, verify and draft graphs never use the ring.IGNITION_KIMI_PREFILL_DMA_BF16=1selects the BF16 hop-sum ring (one pass per reduction). The alternative, the exact FP32 owner-packet ring, adds about 0.46 GiB of graph nodes per rank. Both are export-time switches read inprepare_variantand are not plan settings, so the package identity is unchanged when they are off.What we changed relative to his commits:
prefill_reduction_rows()andreduction_runtime()are pure helpers, so they can be unit-tested.wire_mode="off", so a strayB12X_PCIE_DMA_FP8cannot make it lossy.B12X_PCIE_DMA_PIECESis set.Measured on 8x RTX PRO 6000 Max-Q, two PCIe Gen5 switches with 4 GPUs each on separate root complexes (two islands, one x16 uplink each), no NVLink:
island_eighth, Add opt-in two-island transports to the b12x PCIe BF16 two-shot all-reduce local-inference-lab/flashinfer#93).Exactness: not exact. BF16 hop sums round once per hop, 7 times at TP8. On independent heavy-tailed partials the relative RMS error is about 2x the exact path (2.0-2.5x). It grows roughly linearly with cancellation between per-rank partials (about 11-13x when the partials largely cancel). Our GPU ring output matched a bitwise emulator at world 2/3. A model-level A/B over 10 prompts (2K-66K tokens) compared first-token top-20 logprobs: top-1 agreed 10/10 and the worst KL was 0.0069, within the build-to-build noise we see from <= 3-ulp reorder changes. Ranks are bit-identical. The ring passed 2,000 CUDA-graph replays and 200 replays with poisoned scratch with 0 mismatches.
🧪 Tests
tests/recipes/test_kimi3_prefill_dma_ring.py: 22 passed on CPU on this branch (actually run, against the b12x of FlashInferrelease/k31-exl3-tp8-20261108). The other kimi3 / candidate-merge / KDA CPU tests have the same failure set as the release branch (4 pre-existing failures).Topology assumptions
prefill_reduction_rowsreturns 0 otherwise), so the switch is inert elsewhere.