Repository navigation
[WS2][CUDA][Qwen-Image] Add sequence sharding/gather and arbitrary-length support - #705
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
|
🔍 OpenCodeReview found 2 issue(s) in this PR.
📄
|
|
@MaTwickenham The automated OCR review has completed. Please review and address all automated review bot findings, then push your updates. Maintainers will begin manual review after the bot findings have been addressed. |
Signed-off-by: MaTwickenham <[email protected]>
046f43a to
557aa3e
Compare
Flink-ddd
left a comment
There was a problem hiding this comment.
LGTM, the remaining bot suggestions are non-blocking and can be addressed in a follow-up.
Conflicts in docs/.nav.yml and docs/operators/README.md: both sides added a Qwen-Image operator page at the same place; both entries are kept. Signed-off-by: Wenbo Ji <[email protected]>
shard_image_sequence (from RL-Align#705 on test-qwenimage) assigns a 2-tuple and then a 3-tuple to expected_shape, which mypy 2.4 rejects in the CI linting job. Declare it as tuple[int, ...]; behavior is unchanged. Signed-off-by: Wenbo Ji <[email protected]>
Summary
Implements two Qwen-Image WS2 work items from #386:
sp_shard_gather: Contiguous image-token sharding with co-sharded three-axis RoPE positions and rank-ordered gathering.sp_arbitrary_length: Support for non-divisible sequence lengths, with padding confined to communication buffers.Implementation
shard_image_sequence()andgather_sequence()with first-order autograd support.TorchDistributedDeterministicCollectivefor NCCL/Gloo transport and fixed-order FP32 gradient accumulation.Validation
Validated on 4× NVIDIA A100-SXM4-80GB, Python 3.11.10, PyTorch 2.9.0+cu130, CUDA 13.0, NCCL 2.27.7.
65 tests passed: 26 sequence-parallel tests and 39 existing collective regression tests.
Coverage includes:
Benchmark
On 4× A100,
B=1,S=6889,C=3072, BF16, with 5 warmup and 20 measured iterations:Measurements include collective setup and use the slowest rank's mean wall time.
Scope
This PR provides the sequence layout and communication primitives for subsequent Qwen-Image SP attention integration. Distributed execution is validated through SP=4; SP=8 currently has layout-level coverage.
Related: #386.