Repository navigation
[HIP] [JIT] Add M3 sequence-parallel collectives - #6031
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
quick_reduce_scatter.cu, added on main by ROCm#6031, uses kWavefront, which this branch had renamed to kBlockX. Restore main's definition so the merged tree builds. The launch geometry is unchanged ({64, 4, 1}).
* Enable gfx1250 QuickReduce for TP2 and TP4 * Address review feedback and extend gfx1250 QuickReduce to TP8 for DPX mode * Restore kWavefront in quick_all_reduce_base.h quick_reduce_scatter.cu, added on main by #6031, uses kWavefront, which this branch had renamed to kBlockX. Restore main's definition so the merged tree builds. The launch geometry is unchanged ({64, 4, 1}).
Summary
Add the HIP communication kernels used by ROCm/ATOM#2364 for four-rank M3 sequence parallelism: an INT4 QuickReduce reduce-scatter that writes contiguous rank shards, and a head exchange that writes the final token-major head layout directly.
[tokens, heads]to[tokens / 4, heads * 4]. It supports staged inputs and registered graph inputs, and validates the address read by vectorized loads in both paths.This PR contains the eight HIP/JIT files split from #5822. The Triton tiled sorter and its integration remain in #5822. Both PRs target
mainand can be reviewed and merged independently.Evidence
qr_reduce_scatterorsp_head_exchangepublic entry points.After: both are exposed through their own
compile_opswrappers and registered JIT modules.a70f4fef9071f8b9b2bf25884b38bb6184b4d207. Combining it with the Triton patch reconstructs that source tree exactly. Black, Ruff, andgit diff --checkpass.python -m pytest -q op_tests/multigpu_tests/test_sp_head_exchange.py # 3 passed on four gfx950 GPUsThe QuickRS harness also measures BF16
[tokens, 6144]inputs on four gfx950 GPUs. Latency is the maximum across ranks over 200 timed CUDA-graph invocations per shape; results below are from the split HIP branch.The combined SP serving and model-quality measurements are documented in ROCm/ATOM#2364; those measurements evaluate the complete downstream SP path.
Merge Danger
Door: two-way
Blast Radius: collectives
Calls sharing a communicator must remain serialized on its current stream. QuickRS uses lossy INT4 communication and shares the existing QuickReduce state layout, so both modules must be built from the same AITER revision. Callers remain responsible for choosing the supported four-rank shape, dtype, and communication policy.