feat(dspark): add Ascend NPU support for Qwen3.5-4B DSpark training#617
Open
curnane-lab wants to merge 3 commits into
Open
feat(dspark): add Ascend NPU support for Qwen3.5-4B DSpark training#617curnane-lab wants to merge 3 commits into
curnane-lab wants to merge 3 commits into
Conversation
…ion) Port of TorchSpec PR sgl-project#129 to SpecForge. Adds: - specforge/modeling/draft/dspark.py: DSparkConfig, VanillaMarkov, AcceptRatePredictor, DSparkDraftModel (subclass of DFlashDraftModel) - specforge/core/dspark.py: OnlineDSparkModel (subclass of OnlineDFlashModel) with Markov-biased logits + CE + L1 distribution distillation + confidence BCE and a pooled global-mean loss - scripts/train_dspark.py: training driver (clone of train_dflash.py) - configs/qwen3-8b-dspark.json, examples/run_qwen3_8b_dspark_online.sh - last_hidden_states surfaced from the DFlash target backends (HF + sglang) - tests/test_utils/test_dspark.py: 11 CPU unit tests Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
f6ed937 to
d72ded8
Compare
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.
Summary
This PR adds Ascend NPU training support for DSpark on Qwen3.5-4B.
What is added (incremental)
1. NPU training launcher
examples/run_qwen3.5_4b_dspark_online_npu.shASCEND_RT_VISIBLE_DEVICESandPYTORCH_NPU_ALLOC_CONF.--attention-backend sdpaand--target-model-backend hf(HF backend always surfaceslast_hidden_states, which DSpark's L1 / confidence losses require).torchrun --standalone.2. Trainer NPU fallback
scripts/train_dspark.pyflex_attentiontosdpawhen the default backend would fail on NPU.DSpark background (for context)
DSpark = SpecForge's DFlash block-diffusion drafter + EAGLE-style Markov & confidence heads, trained with:
The base trainer implementation is in the preceding commit (
a2f18ea). This PR only layers the NPU enablement on top.Usage
Checklist