Conversation
Add a source-built CUDA IPC Ulysses backend with cached peer target buffers, a high-priority communication stream, and grouped GPU-memory handshakes. Route eligible attention projections through it while retaining NCCL fallbacks. Start MiniMax H3's strided V transfer before Q/K norm and RoPE, then submit tagged Q/K transfers. Add correctness, parity, benchmark, and profiler coverage; refresh parallel and MiniMax H3 documentation with four-H100 measurements. Verification: ruff check; 33 focused unit tests; four-GPU CUDA IPC correctness; MiniMax H3 Ulysses2/Ulysses4/TP2+Ulysses2 parity; four-H100 Flash, Sage, and AdaTaylorCache benchmarks; CUDA trace confirming 157.7 us V-copy/QK-preprocessing overlap.
Overlap Ulysses Q/K/V communication with attention preparation and profile the resulting execution path. Add a lossless LingBot delivery mode with FIFO backpressure, published-frame completion accounting, and a LiveKit acknowledgement before track teardown. Validate the one-minute four-H100 AIPerf replay and update the LingBot and AIPerf benchmark tables. Verification: ruff format/check; 68 focused TeleFuser tests; 6 AIPerf adapter tests; one-minute four-H100 AIPerf replay (1/1 succeeded).
Give each tensor-channel consumer an independent CUDA IPC refcounter and let the channel own cleanup of its producer pools and consumer mappings. Close Ulysses IPC groups before distributed teardown, keep child workers on cooperative shutdown, and allow LiveKit sessions a grace period before cancellation. Add unit and multi-GPU coverage for IPC cleanup, refcounter isolation, worker signals, group closure, and session stop behavior. Validate with the 4-GPU LingBot World V2 streaming path.
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
This PR adds an optional, source-built CUDA IPC backend for same-host Ulysses scatter operations. It writes directly into cached peer target buffers on a high-priority CUDA communication stream and groups Q/K/V transfers behind one GPU-memory handshake, while retaining PyTorch/NCCL fallbacks for unsupported configurations.
MiniMax H3 now starts its strided V transfer before Q/K normalization and RoPE, then submits tagged Q and K transfers. Other eligible attention implementations also use tagged transfers without changing their public pipeline configuration.
The PR additionally adds lossless LingBot-World streaming delivery and hardens CUDA IPC/session teardown based on the four-H100 validation results.
Motivation
Ulysses attention previously relied on NCCL collectives and intermediate packing or relayout work. This serialized communication with Q/K preprocessing and prevented Copy Engine transfers from overlapping useful GPU computation.
Long-running LingBot sessions also needed an explicit delivery contract: target completion did not guarantee that every published frame had reached the client. Session cancellation could interrupt asynchronous cleanup, while multi-consumer CUDA IPC tensors shared one refcounter and could emit lifecycle warnings during shutdown.
This change improves communication overlap, preserves lossless frame delivery when requested, and makes IPC resource ownership and shutdown deterministic.
Type of Change
Changes Made
tf-kernelCUDA IPC Ulysses backend:telefuser.distributed.ulysses_comm:WorkerTensorChannelowns producer-pool and consumer-mapping cleanup.Testing
Verification performed:
ruff checkRepresentative commands:
ruff check telefuser tests tools/validation tf-kernel/tf_kernel pytest -q \ tests/unit/distributed/test_ulysses_comm.py \ tests/unit/models/test_minimax_h3_dit.py \ tests/unit/models/test_lingbot_world_fast_dit.py \ tests/unit/service/livekit \ tests/unit/worker/test_parallel_worker.py \ tests/unit/worker/test_tensor_channel.py pytest -q -s tests/integration/test_minimax_h3_distributed.py pytest -q -s tests/integration/test_worker_tensor_channel.py cd tf-kernel torchrun --standalone --nproc-per-node=4 \ tests/distributed/ulysses_correctness.pyBenchmark and profiler commands are documented in:
examples/minimax_h3/README.mdexamples/lingbot/README.mddocs/en/benchmark_aiperf.mdChecklist
ruff)pre-commit run --all-files)pytest tests/)[TYPE] Brief descriptionRelated Issues
N/A
Additional Notes
The optimized backend is optional and belongs to the separately built
tf-kernelpackage. TeleFuser does not build or install it automatically. Missing kernels, multi-host process groups, compilation, or unsupported CUDA IPC configurations retain the existing NCCL behavior.A grouped transfer cannot safely switch to NCCL after some tagged operations have already started; such failures are surfaced instead of mixing collective protocols mid-request.
The complete
pytest tests/andpre-commit run --all-filessuites were not run. Focused suites covering the changed paths passed.GPU Architecture Support
The CUDA IPC implementation is not intentionally SM90-specific, but this PR was validated only on four H100 80 GB GPUs.
Performance Impact
Environment: 4 x H100 80 GB, PyTorch 2.11.0+cu128, CUDA 12.8, NCCL 2.28.9, source-built SM90
tf-kernel.MiniMax H3
SageAttention reduced pipeline latency by 6.34% and DiT latency by 6.43%. AdaTaylorCache reduced pipeline latency by 45.2%.
The CUDA trace confirmed 157.7 us of overlap between the strided V Copy Engine transfer and Q/K normalization plus RoPE preprocessing.
LingBot-World v2
The direct-path measurement improved by approximately 11.3% while preserving all requested output frames.