Repository navigation
Conversation
Add _Fused4StreamPackedCombineNorm so a single CTA per token loads block_output[token] once into registers and reuses it across all 4 residual streams when streams == 4, hidden_size % 8 == 0, and max_tokens >= 64. Keep _PackedCombineNorm for small-token decode plans (max_tokens < 64) where 4x more blocks improve SM occupancy on low-M batches. Bump norm.hyperconnection.cute compile spec version from 11 to 12. Bit-exact (rtol=0, atol=0) with _PackedCombineNorm across BF16/FP32 weights, zero_centered True/False, non-contiguous logit strides, and num_warps in (8, 10, 16).
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 19 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Author
|
@coderabbitai review |
Action not completed
|
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.
Summary
Add
_Fused4StreamPackedCombineNorminb12x.norm.hyperconnection._cuteand select it in_compile_hyperconnectionforrole == "combine_norm"whenstreams == 4,hidden_size % 8 == 0, andquery.max_tokens >= 64.Previously,
_PackedCombineNormlaunchedgrid=(tokens, streams, 1), so each token'sblock_output[token]row was read 4 separate times from global memory by 4 distinct blocks. In_Fused4StreamPackedCombineNorm:block_output[token]once into registers and reuses it across all 4 residual streams._PackedCombineNormbit for bit (scale = 2.0 * sigmoid(logit / streams), BF16 rounding before RMS sum-of-squares, identical FP32/BF16 weight handling andzero_centeredmode, with a block barrier after each stream's_block_sumbefore reusing shared reduction memory).max_tokens < 64) continue using_PackedCombineNormso low-M batches retain 4x block-level SM occupancy.norm.hyperconnection.cutecompile spec version from 11 to 12.Benchmark (NVIDIA GB10 / DGX Spark, SM 12.1,
streams=4, H=2560)End-to-end Nsight Systems profile of a 32,768-token Qwen3.8 Flash-Next prefill on GB10:
PackedCombineNormtotal GPU time:1,182.1 ms -> 942.0 ms(-240.2 ms,-20.3%) at 8,192-token prefill chunks.1,182.1 ms -> 966.0 ms(-216.2 ms,-18.3%) at 16,384-token prefill chunks.Testing
test_fused4_combine_norm_bit_exact_with_packedintests/experimental/b12x/norm/test_prepared_hyperconnection.pyverifyingrtol=0, atol=0parity against_PackedCombineNormacrosstokens in (128, 1024),(bf16/zero_centered=True, bf16/zero_centered=False, fp32/zero_centered=False), non-contiguous logit strides (stride=336), andnum_warps in (8, 10, 16).test_combine_norm_preserves_affine_precision_and_replaysalso coverstokens=4096(fused path) andtokens in (1, 7)(packed path) with CUDA graph capture/replay and in-place aliasing (out=(state, normalized)).pytest --confcutdir=tests/experimental/b12x tests/experimental/b12x/norm/test_prepared_hyperconnection.py-> 124 passed.