feat(dspark): add offline USP training support - #725
Open
calyoung80 wants to merge 1 commit into
Open
Conversation
Signed-off-by: calyoung80 <zsucal@hotmail.com>
calyoung80
requested review from
FlamingoPg,
FrankLeeeee,
shuaills and
sleepcoo
as code owners
July 28, 2026 07:09
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Collaborator
|
Hi, can you add your results of dspark draft model that trained on long sequence? |
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
DSpark offline training currently processes the full sequence on every draft
sequence-parallel rank, which limits the usable sequence length and duplicates
target hidden-state storage and compute.
This PR adds a USP-backed offline training path for DSpark. It shards sequence
tensors across the draft-SP group while preserving global sequence semantics
for draft attention and loss computation.
Modifications
input_ids,loss_mask,hidden_states, andtarget_last_hidden_states;communication;
attention_maskthrough the collator and training strategy.reduce_scatter_tensor;uspas a DSpark attention backend:width.
shards safely.
distributed gather/backward behavior, backend mapping, and empty-shard anchor
handling.
Related Issues
N/A
Accuracy Test
This PR changes DSpark training infrastructure rather than model architecture
or inference kernels.
Accuracy validation has not been run yet. A multi-rank DSpark offline training
comparison against the non-USP baseline is required before merge.
Benchmark & Profiling
This PR is intended to enable longer offline training sequences and reduce
per-rank sequence-state memory.
Benchmark and profiling results have not been collected yet. Suggested
follow-up measurements:
Checklist
pytest tests/test_algorithms/test_dspark_usp.py tests/test_algorithms/test_model_providers.py tests/test_utils/test_dflash_losses.pySigned-off-by: calyoung80 <zsucal@hotmail.com>