Repository navigation
[nn]: add shared masked diffusion training objectives - #6569
Merged
Merged
Conversation
Include the upstream benchmark worker teardown fix, give Gemma4 GPU tests unique module names, and use bounded address-in-use retries for Gemma4 and ZeRO checkpoint tests.
Use a per-test FileStore for the single-rank lifecycle regression so port allocation races cannot fail before the cleanup checks. Preserve real process group initialization, error propagation and barrier assertions.
kiseki-zj
enabled auto-merge (squash)
December 2, 2026 07:47
yuxuan-lou
approved these changes
Dec 2, 2026
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.
What does this PR do?
Add reusable masked-diffusion training objectives for LLaDA and LLaDA2. The helpers sample per-sequence mask probabilities, preserve prompt and padding boundaries, and keep LLaDA's inverse-probability weighted per-answer loss separate from dFactory's unweighted same-position masked-token cross entropy.
Provide a dense block-diffusion correctness baseline with doubled noisy/clean inputs, repeated position IDs, and attention masks that prevent answer leakage. This builds directly on the adapters already merged into main; it does not include the Ouro training PR or development scripts/logs.
Tests compare the helpers against pinned official formulas and dFactory reference functions, including logits, loss, parameter gradients, and updates through native ShardFormer policies. Only the 60 source-independent objective tests are registered in CPU CI; the tiny model integration tests require cached pinned model sources.
Merge
mainatda3df39eto include the upstream benchmark worker teardown fix. Rename Gemma4 GPU test modules to avoid collisions with their CPU counterparts, update batch paths, and add bounded retries for address-in-use failures in Gemma4 and ZeRO checkpoint tests. Numerical failures are not retried. The single-rank worker lifecycle regression uses a per-test file rendezvous to avoid TCP port-allocation races.Validation
Current GitHub Actions results are shown in the PR checks.
The final single-rank rendezvous change passed all 9 worker cleanup and Gloo callback regressions under PyTorch 2.5.1+cpu, plus applicable pre-commit checks.
Scope
This completes the shared 2D2 objective baseline. Original-weight training, GPU BF16 model execution, distributed/offload acceptance, and LLaDA2-specific editing or insertion/deletion objectives remain separate work. The dense block mask is a correctness baseline, not a long-sequence optimization.