feat: TQ3 compressed ring all-reduce for TP bandwidth reduction#181
Closed
influenist wants to merge 1 commit intoturboderp-org:masterfrom
Closed
feat: TQ3 compressed ring all-reduce for TP bandwidth reduction#181influenist wants to merge 1 commit intoturboderp-org:masterfrom
influenist wants to merge 1 commit intoturboderp-org:masterfrom
Conversation
Adds compressed communication to the Native TP backend's ring all-reduce, reducing inter-GPU data transfer by ~6.4x. Algorithm: 1. Each rank compresses local fp16 data to TQ3 (10 bytes per 32 values) 2. Writes compressed data to shared memory ring buffer 3. Ring reduce: decompress from predecessor + accumulate locally 4. Ring broadcast: forward accumulated result 5. Result written back in-place New files: - tq3_compress.cuh: Thread-level TQ3 compress/decompress/decompress+add - tq3_all_reduce.cu: Standalone compressed ring kernel using ParallelContext - tq3_all_reduce.cuh: Header declarations Integration: - TPBackendNative.tq3_compress flag (opt-in) - ext.tq3_all_reduce() binding Impact: PCIe setups (32 GB/s) and multi-machine (InfiniBand) see significant throughput improvement. NVLink setups see minimal change since interconnect is rarely the bottleneck. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Author
|
Closing — CUDA kernels were never compiled or tested on real hardware. Will revisit after the KV cache PR (#182) is reviewed. |
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
Adds optional TQ3 compression to the Native TP backend's ring all-reduce, reducing inter-GPU data transfer by ~6.4x (fp16 → 2.5 bits/value).
Independent of PR #180 — this is a communication optimization, not a quantization format.
How it works
Each ring iteration:
When it helps
Files (7 files, +694 lines)
Opt-in
Test plan
🤖 Generated with Claude Code