Repository navigation
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
|
This was referenced Oct 30, 2026
[3/7] fix(speculative): keep the streaming corpus memory-mapped instead of copying it per rank
#3142
Closed
h-guo18
force-pushed
the
haoguo/dflash-fused-loss
branch
from
October 31, 2026 08:41
177e86a to
eae855c
Compare
h-guo18
force-pushed
the
haoguo/muse-spark-open-dflash2-recipe
branch
from
October 31, 2026 08:41
fdd590a to
12f3f7c
Compare
h-guo18
force-pushed
the
haoguo/dflash-fused-loss
branch
from
October 31, 2026 14:13
eae855c to
a818df1
Compare
h-guo18
force-pushed
the
haoguo/muse-spark-open-dflash2-recipe
branch
from
October 31, 2026 14:13
12f3f7c to
b8c972c
Compare
h-guo18
force-pushed
the
haoguo/dflash-fused-loss
branch
from
November 1, 2026 09:32
e4c4d3f to
154e2bb
Compare
h-guo18
force-pushed
the
haoguo/muse-spark-open-dflash2-recipe
branch
from
November 1, 2026 09:32
2bf4f37 to
2ff0ba0
Compare
… released drafter Add the two-stage recipe behind nvidia/Muse-Spark-Open-816B-A42B-DFlash2 under modelopt_recipes/models/meta-models/Muse-Spark-Open-816B-A42B/speculative_decoding/, with a streaming launcher example per stage and a README on the data, the compute and the results: - dflash2.yaml: from scratch, 8 epochs at 4K tokens; stage 2 continues from step 390,000. - dflash2_long_context.yaml: the stage-1 export continued at 12K tokens on the corpus's long samples; the release is step 25,000. Training against this target needed three things main did not have: - The fake base reproduces what Muse-Spark does outside embed_tokens and lm_head: a weightless RMSNorm on the token embeddings, and cap * tanh(multiplier * x / cap) on the logits, for the draft and the teacher alike. It reads the raw config.json when transformers does not know the model_type, as with muse_spark. The final norm is a plain RMSNorm. - DFlash exports write the target's output_multiplier and final_logit_softcapping into dflash_config, the only place vLLM's DFlash2 reads them. Without them the served draft's logits are unscaled and uncapped, which costs acceptance under sampling. - dflash_fused_loss accepts the soft-capped head and applies its transform. The streaming launcher gains SERVE_ENABLE_EP for expert-parallel serve replicas. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: h-guo18 <67671475+h-guo18@users.noreply.github.com>
…o stop each stage Stage 2 now pins max_steps at the release's 59,502. Left to num_train_epochs, transformers rounds each epoch of the 634,723 long samples up to 9,918 optimizer steps, a 59,508-step schedule. Stage 2 starts from stage 1's checkpoint-390000 and the release is stage 2's checkpoint-25000, but neither is the last checkpoint of its run and both recipes keep only the last three, so a run left to finish deletes it. The launcher examples and the README now say to stop each run once its checkpoint is written, or to copy the checkpoint out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: h-guo18 <67671475+h-guo18@users.noreply.github.com>
h-guo18
force-pushed
the
haoguo/dflash-fused-loss
branch
from
November 1, 2026 09:53
154e2bb to
c86d6f8
Compare
h-guo18
force-pushed
the
haoguo/muse-spark-open-dflash2-recipe
branch
from
November 1, 2026 09:53
2ff0ba0 to
23d2a6c
Compare
h-guo18
force-pushed
the
haoguo/dflash-fused-loss
branch
from
November 1, 2026 09:56
a818df1 to
e4c4d3f
Compare
h-guo18
force-pushed
the
haoguo/muse-spark-open-dflash2-recipe
branch
from
November 1, 2026 09:56
b8c972c to
2bf4f37
Compare
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.
Stack (merge in this order; each PR's base is the branch of the one before it). [4/4] reproduces nvidia/Muse-Spark-Open-816B-A42B-DFlash2 and needs all of them.
What does this PR do?
Type of change: new example, plus the target support it needs
This PR adds the recipe that trained nvidia/Muse-Spark-Open-816B-A42B-DFlash2, so the release can be reproduced from
mainonce this stack lands.modelopt_recipes/models/meta-models/Muse-Spark-Open-816B-A42B/speculative_decoding/dflash2.yamlis stage 1: trained from scratch for 8 epochs at 4K tokens. The release continues from its step 390,000.dflash2_long_context.yamlis stage 2: it continues the stage-1 export at 12K tokens on the corpus's long samples. The release is its step 25,000.README.mdcovers the training data, the compute and the results.tools/launcher/examples/meta-models/Muse-Spark-Open-816B-A42B/has one streaming launcher example per stage: 14 vLLM serve replicas of the NVFP4 target and 8 trainer nodes, all 4-GPU GB300.Training against this target needed three changes on
main:cap * tanh(multiplier * logits / cap)to its logits (multiplier 0.177, cap 20). The fake base now builds both intoembed_tokensandlm_head, so the draft's block embeddings, the draft's logits and the teacher's logits all match the target's. Two more pieces:muse_sparkconfig class, so the fake base reads the rawconfig.jsonwhenAutoConfigdoes not know the model type. It needs only scalars from it.output_multiplierandfinal_logit_softcappingintodflash_config, which is the only place vLLM's DFlash2 reads them. Without them the served draft's logits are 5.7x too sharp and uncapped. On an earlier Muse-Spark-Open drafter, adding the two keys raised MT-Bench acceptance length by 9.3% at temperature 1 and by 1.4% greedy.dflash_fused_loss([3/4] perf(speculative): fuse the DFlash-family loss with the lm_head projection #3010) accepts the soft-capped head and passes its transform tofused_head_stats, which already supported one.The streaming launcher also gets
SERVE_ENABLE_EPfor expert-parallel serve replicas. It is its own knob because multi-tokenSERVE_EXTRA_ARGSvalues do not survive nemo_run's environment export, which is also whySERVE_BLOCK_SIZEis separate.Results
The released drafter, which is step 25,000 of stage 2. Acceptance length with vLLM, draft length 7, reasoning effort xhigh, 4,096 output tokens, concurrency 32, on one GB300 node (TP4, EP4):
Compute: stage 1 took 37.7 h and stage 2 took 6.0 h on 88 GB300 GPUs, about 3,850 GPU-hours in all. Synthesizing the training corpus took about 2,100 more.
Usage
On the cluster login node, with the usual launcher environment (
SLURM_HOST,SLURM_ACCOUNT,SLURM_PARTITION,SLURM_HF_LOCAL,SLURM_JOB_DIR):Fill in the placeholders first: the corpus paths, the stage-1 export path and a vLLM image that serves Muse-Spark-Open. Neither checkpoint is the last of its run, and both recipes keep only the last three checkpoints, so a run left to finish deletes it.
Testing
test_muse_spark_base_reproduces_its_embedding_and_logit_transforms(a fake base built from a raw Muse-Sparkconfig.json),test_export_config_carries_the_target_logit_transform, and a soft-capped-head case in the fused-loss test. Each fails without its change.test_examples_resolve(77) and the recipe tests (474).mainafter refactor(speculative): one home each for the DFlash family's shared rules #2757: 881 related unit tests pass at this PR (Python 3.12, transformers 5.18.0).test_hf_spec_rope_export.py's exporter stub now carries anlm_head. The export reads the target's logit transform off it, and without it 6 of that file's 16 tests failed, before the rebase too.tests/gpu/torch/speculative/plugins/test_hf_dflash.pyhas 17 passed and 1 skipped, including the newdflash2-kd-soft-capped-headcase.main.pyprints it at startup in the end-to-end runs below (minus their step, checkpoint and data-order overrides), matches what the two release runs printed. The remaining differences are spellings of the same setting: the token loss iscehere and unset there, both meaning the distillation cross-entropy; the fused loss and out-of-order batch delivery were environment variables there; and the chat template is the one above. Stage 2 also saves every 2,500 steps instead of 1,250.dflash_configcarriesoutput_multiplier0.1768 andfinal_logit_softcapping20.0.main, about 3,850 GPU-hours. The acceptance lengths above are those of the released drafter, which was trained on the release tree.Before your PR is "Ready for review"
CONTRIBUTING.md: N/AAdditional Information
🤖 Generated with Claude Code