(fsdp2 dev. perf) Add sequence packing for EAGLE3, DFlash, and DFlash2 - #928
Draft
yushengsu-thu wants to merge 2 commits into
Draft
yushengsu-thu wants to merge 2 commits into
yushengsu-thu wants to merge 2 commits into
Conversation
yushengsu-thu
requested review from
FlamingoPg,
FrankLeeeee,
shuaills and
sleepcoo
as code owners
October 4, 2026 10:34
yushengsu-thu
marked this pull request as draft
October 4, 2026 11:08
This branch has not been deployed
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
Variable-length samples waste draft-training work on padding. Add opt-in sequence packing for text EAGLE3, DFlash, and DFlash2 with offline features and online disaggregated consumers.
Modifications
training.sequence_packing: truewithtraining.attention_backend: flex_attention; the default remains disabled.USP, multimodal inputs, compact teacher, loss-position trimming and EAGLE3 LK are unsupported. DFlash/DFlash2 LK and D-PACE are supported.
Accuracy Test
Prior Linux/H200 validation (2026-10-02): 204 CPU tests/540 subtests; 57 GPU model/host-sync tests/45 subtests; five live-online/metadata tests/seven subtests. Two-rank
FULL_SHARDloss/gradient comparisons passed for all three architectures. Full-model runs verified every trainable tensor received 256 optimizer updates, all five draft layers updated, and weights/losses stayed finite.Current checks: repository-wide pre-commit and 27 configuration/package-architecture tests (21 subtests) pass. All 17 changed/new production files match the full-model measured-source hashes. The local macOS Torch installation is missing
libtorch_cpu.dylib, so model/GPU results above are from the prior completed H200 runs.BF16 parity is tolerance-based; convergence, final checkpoint quality and speculative-serving acceptance were not evaluated.
Benchmark & Profiling
Complete Qwen3-4B target (36 layers), five-layer drafts, two H200 GPUs, 1,024 ShareGPT conversations, 256 optimizer steps, four runs per mode. Medians:
Completion includes live target capture, transport, training, acknowledgements and checkpoints at steps 128/256. It excludes preparation, startup and a separate corpus warmup. Training-step diagnostics cover the first 250 steps (1.0442×/1.0523× faster). Gains are workload-specific; the full-vocabulary objective still uses the restored proposal layout.
Related Issues
None.
Checklist