Repository navigation
fix(nft): fully align NFT with DiffusionNFT - #266
Merged
Rockdu merged 3 commits intoOct 4, 2026
Merged
Conversation
This was referenced Sep 27, 2026
Merged
Rockdu
force-pushed
the
fsdp-followups/2-nft-alignment
branch
3 times, most recently
from
September 27, 2026 11:26
f3775d3 to
98c4be8
Compare
…s dropping the smallest
Rockdu
force-pushed
the
fsdp-followups/2-nft-alignment
branch
from
September 27, 2026 13:06
98c4be8 to
3ab2a04
Compare
Rockdu
added this pull request to stack #270
September 27, 2026 17:59
Rockdu
force-pushed
the
fsdp-followups/2-nft-alignment
branch
from
September 27, 2026 18:10
3ab2a04 to
ccbeacb
Compare
…for the KL reference
…le, as DiffusionNFT does
Rockdu
force-pushed
the
fsdp-followups/2-nft-alignment
branch
from
September 27, 2026 19:39
ccbeacb to
7fef1b9
Compare
This was referenced Sep 28, 2026
4 of 6 tasks
OnePunchMonk
pushed a commit
to OnePunchMonk/miles_diffusion
that referenced
this pull request
Oct 5, 2026
* fix(nft): train a random subset of sigmas per sample instead of always dropping the smallest * refactor(nft): train against EMA pi_old directly and keep --ref-mode for the KL reference * fix(ema): follow the actor's optimizer step count in the decay schedule, as DiffusionNFT does
OnePunchMonk
pushed a commit
to OnePunchMonk/miles_diffusion
that referenced
this pull request
Oct 5, 2026
* fix(nft): train a random subset of sigmas per sample instead of always dropping the smallest * refactor(nft): train against EMA pi_old directly and keep --ref-mode for the KL reference * fix(ema): follow the actor's optimizer step count in the decay schedule, as DiffusionNFT does
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 2/9 of follow-ups to #263:
main← #265 ← this ← #267 ← #268 ← #269 ← #271 ← #272 ← #273 ← #274.Aligns the NFT path with the reference implementation (NVlabs/DiffusionNFT).
What
--diffusion-nft-timestep-fractionof the sigmas per sample, instead of always dropping the smallest sigma.--ref-modenow only picks the KL reference (none/lora_base/ref), and NFT supports--diffusion-kl-beta(kl_beta * mean((v_new - v_ref)^2)per pair, logged asnft_kl, renamed tokl_lossin refactor(nft): log the NFT KL term as kl_loss like Flow-GRPO #272).--loss-type nftrequires--use-ema --rollout-weights ema.EMAOptimizer.step(optimizer_step)), as DiffusionNFT'sreturn_decay(global_step)does; the separateupdate_countis gone.Why
Each item was a line-level mismatch with the reference code: a fixed dropped sigma never trains, π_old and the KL reference were one role, and the EMA ramp counted train calls instead of optimizer steps.
Validation
fix(nft): train a random subset of sigmas ...moves the NFT metrics;test_sd3_nft_pickscore_3xGPUandtest_krea2_nft_ocr_2xGPUare re-recorded bitwise on that commit. Every other standard is unchanged.refactor(nft): train against EMA pi_old ...andfix(ema): follow the actor's optimizer step count ...are metric-neutral for these recipes: π_old is the same EMA, and one optimizer step per rollout makes the step count equal the old update count. CI checks this against the standards above.Not in this PR
correction=1(as miles, verl, TRL and verl-omni do; flow_grpo, DiffusionNFT and UniRL useddof=0), since neither choice is more principled and switching would re-record every GRPO standard.Files
miles/ray/data_conversion_hub/nft.py: per-sample sigma subset.miles/backends/fsdp_utils/actor.py,loss_hub/{nft,flow_grpo,sft}.py:old_prednext toref_pred; NFT KL term.miles/backends/fsdp_utils/ema.py: decay from the optimizer step.miles/utils/arguments.py, recipes, docs: flag semantics.test_loss_hub_nft.py,test_reference_models.py,test_ema_optimizer.py,test_reference_arguments.py, GPU offload worker; two re-recorded NFT e2e standards.Checklist
pre-commit run --all-filespasses — not run locallypytest -xis green — CPU fsdp and argument tests pass locally; GPU tests run in CIpython3 train.py --helpstill parses — not run (needs the GPU image)