-
Notifications
You must be signed in to change notification settings - Fork 325
add: DFlash block diffusion speculative decoding #1128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ChenhanYu
wants to merge
23
commits into
main
Choose a base branch
from
chenhany/dflash
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
3f89ea9
add: DFlash block diffusion speculative decoding
ChenhanYu 190cb3a
fix: rewrite DFlash to match SpecForge reference
ChenhanYu b7a2a7b
fix: correct mask_token_id and base model forward dispatch
ChenhanYu a310d96
add: auto-detect mask_token_id for DFlash across model families
ChenhanYu 972dfaa
fix: prevent DDP deadlock during AR validation
ChenhanYu 6c4eb80
fix: avoid DynamicModule dispatch loop in forward/training paths
ChenhanYu 2c42363
fix: revert training/eval to super().forward() matching EAGLE pattern
ChenhanYu a279960
fix: DDP deadlock when no valid loss positions on a rank
ChenhanYu cbddc30
add: logit distillation option for DFlash training
ChenhanYu c53a66a
fix: print training accuracy to console at each log step
ChenhanYu 2eabf57
fix: use response-only loss mask for DFlash training
ChenhanYu 2a16232
fix: apply assistant_masks to labels in LanguageDataCollator
ChenhanYu e3b9930
fix: robust response-only loss mask via regex assistant span detection
ChenhanYu 07066c2
docs: add DFlash section to speculative decoding README
ChenhanYu a32de63
fix: resolve DFlash components from base model architecture
ChenhanYu 6a6a9ca
fix: enable response-only loss mask for DFlash training
ChenhanYu a777849
add: DFlash launcher example for Qwen3-8B
ChenhanYu 2c56aca
fix: inline values in DFlash launcher YAML for --yaml compatibility
ChenhanYu 306fc3e
add: unit tests for DFlash speculative decoding
ChenhanYu c4a3ecb
fix: add docstrings to DFlash classes for coverage check
ChenhanYu 1c23ced
add: AR validation step to DFlash launcher pipeline
ChenhanYu 38450b0
fix: split DFlash tests into CPU (unit) and GPU tests
ChenhanYu 4c2fc77
fix: correct DFlash attention mask test for reverse-causal pattern
ChenhanYu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: NVIDIA/Model-Optimizer
Length of output: 160
🏁 Script executed:
Repository: NVIDIA/Model-Optimizer
Length of output: 1578
🏁 Script executed:
Repository: NVIDIA/Model-Optimizer
Length of output: 4763
🏁 Script executed:
Repository: NVIDIA/Model-Optimizer
Length of output: 7010
🏁 Script executed:
Repository: NVIDIA/Model-Optimizer
Length of output: 4716
🏁 Script executed:
Repository: NVIDIA/Model-Optimizer
Length of output: 1651
🏁 Script executed:
Repository: NVIDIA/Model-Optimizer
Length of output: 4722
🏁 Script executed:
Repository: NVIDIA/Model-Optimizer
Length of output: 4128
🏁 Script executed:
Repository: NVIDIA/Model-Optimizer
Length of output: 3447
Move dataset loading outside the master-only validation block for efficiency.
The validation code is safe as-is:
validate_ar()contains no distributed collectives, andpop_and_gather_aux_hiddens()only performs local tensor concatenation (not a distributed gather). Thebarrier()correctly synchronizes ranks after rank-0 validation.However, reloading the validation dataset inside the master-only block wastes idle time on non-master ranks. Load the dataset once before the validation check:
🤖 Prompt for AI Agents