Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueComment |
fa52064 to
8a2c8bd
Compare
8a2c8bd to
663bfa3
Compare
|
Closing this draft because its The branch is preserved on the fork at |
Summary
Extend the fused-QKV
sol_attn_chunkedpath with the same per-key logit-bias carrier already supported by directsol_attn, for both CUDA and HIP.The chunked API accepts natural-log
key_bias, normalizes it to the existing float32[B,T]contract, converts it once to log2 units, and passes it into K-row quantization. The producer continues to compute pooled K sums and V calibration statistics from the unweighted activations; only the exact routed branch receives the score bias.This preserves the existing sparse-routing/calibration behavior while allowing callers that stream fused QKV to apply exact per-key weighting without materializing full Q/K/V tensors.
Contract
key_biasis a new optional keyword-only argument after the legacy positional tail.sol_attnsemantics where key bias is consumed by the exact branch.kmean/vscalecalibration remains based on unweighted activations; the measure changes exact score semantics, not calibration values.Tests and source audit
Adds shared fused-backend coverage for:
sol_attnon the same post-RoPE Q/K/V;key_biasshape rejection before producer execution;token_aug=64weighted interaction case that compares cold and primed chunked execution against direct fused Sol-Attn, checks finite output, verifies weighted output differs from unweighted output, and requireskmean/vscaleto remain bit-identical to the unweighted calibration;rope_eps,tail,block_len,coarse_gate, andtoken_augparameters remain positional whilekey_biasis optional and keyword-only.The reviewed CUDA and HIP producer implementations both compute post-RoPE K sums and V statistics before key-bias-bearing K quantization. The bias therefore cannot alter the
kmean/vscalecalibration values. Both low-level bindings require the producer bias carrier to be packed contiguous float32 with exactlyB*Telements before a raw pointer reaches the kernel.The token-routing audit also closes the weighted exact-prefix interaction mechanically on both backends: route initialization inserts sink blocks directly into the exact list; sink blocks are excluded from the normal routed-candidate calculation, excluded from the token candidate bitmap, and excluded from the pooled tail. Token augmentation therefore only refines unrelated non-sink blocks and cannot consume or duplicate a biased exact sink block.
The current clean head
663bfa3ab5c29e9cff6b2ab68d7f287ea54ae6bbis one implementation commit directly on current upstreammain(21003fa97bf3b180393446d729ae630ceb6c2a52) and is mergeable. A pre-test checkpoint is retained atcheckpoint/pr-171-before-token-aug-test-20260911.For this exact head, CLA run
34563733264passed.Build Wheelsrun34563734866concludedaction_requiredbefore build execution because fork workflow authorization is required. That status is not a compiler failure and provides no CUDA/HIP numerical evidence.This draft therefore still requires a compiled supported-GPU run before review. Minimum CUDA acceptance is:
pytest -q tests/test_sol_attn.py tests/test_sol_attn_weighted_token_aug.py -k 'chunked_key_bias'That covers zero-token-budget weighted cold/primed parity plus the enabled-token-routing interaction. HIP has structural/source parity but remains behaviorally unvalidated unless run on supported HIP hardware.
Architecture companion: xmarre/MiniMax-H3-Flow-Aligned-Regenerate#29
Core contract: Comfy-Org/ComfyUI#16239
Sol-H3 provider: xmarre/ComfyUI-Sol-H3#9