feat(dspark): add Ulysses sequence parallel training - #728
Draft
maocheng23 wants to merge 26 commits into
Draft
Conversation
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
maocheng23
force-pushed
the
feat/dspark-ulysses-sp
branch
6 times, most recently
from
July 29, 2026 04:18
18a1082 to
90f1727
Compare
maocheng23
force-pushed
the
feat/dspark-ulysses-sp
branch
from
July 29, 2026 04:23
90f1727 to
95f493b
Compare
maocheng23
force-pushed
the
feat/dspark-ulysses-sp
branch
from
July 29, 2026 05:01
f4143d3 to
8f31ca5
Compare
maocheng23
force-pushed
the
feat/dspark-ulysses-sp
branch
from
July 29, 2026 05:12
8f31ca5 to
4fdb5ae
Compare
Collaborator
Author
|
Exact online 120K validation completed on 2 nodes / 16x H200. Configuration:
Observed evidence:
This testing exposed and fixed the forced monolithic-prefill OOM. It also confirmed that the documented 128 GiB Mooncake segment is required; the 32 GiB default fills after three GLM-5.2 samples. The latest lint check passes. |
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.
Motivation
FSDP shards model parameters, gradients, and optimizer state, but it does not shard sequence activations. Long-context DSpark training therefore remains constrained by replicated 120K-token activations even when model-state memory is manageable.
This PR adds Ulysses sequence parallelism to the offline DSpark path so each SP rank owns only its local sequence slice while the draft remains FSDP-sharded.
Modifications
input_ids, captured target features, final target states, masks, and absolute positions across the SP group.attention_backend: usp,sp_ulysses_size, and the existing FSDP sharding option.The initial implementation is intentionally Ulysses-only. Ring sequence parallelism and online/disaggregated DSpark SP are out of scope.
Related Issues
No linked issue.
Accuracy Test
FULL_SHARDoptimizer-step integration passed.FULL_SHARDsmoke test passed.git diff --checkpassed.A real Qwen3-8B 120K end-to-end run was also executed on 8x H200:
Qwen/Qwen3-8Btarget, TP8 capture, YaRN context 131,072[1, 120000, 20480]BF16[1, 120000, 4096]BF16FULL_SHARDoptimizer step completed4.089876; all checkpointed draft parameters finiteThe Qwen run used deterministic synthetic text, so it is an integration and capacity check rather than a model-quality or convergence measurement.
Benchmark & Profiling
On the 8x H200 Qwen3-8B run:
Checklist