Repository navigation
Conversation
…heir own input batch; the trunk stays flat
4 tasks done
Rockdu
force-pushed
the
dmd2/07c-original-scoring-in-trunk
branch
2 times, most recently
from
November 25, 2026 07:25
3c339bf to
07a6f9d
Compare
Collaborator
Author
5 tasks done
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
Rework of #416's trunk, for cherry-picking into #416 (base is #416's branch). Review thread on #416.
PreparedBatch.teacher_guidance_scaleandforward_only_batchbecometeacher_batchandactor_forward_batch, both fullPreparedBatches. The teacher's CFG fields andneg_cond/joint_condlive onteacher_batch, built bydmd2._teacher_batch; the trunk no longer derivesuse_cfgfrom a scale._compute_noise_pred(model, batch, inputs). EMA and ref reuse the training batch's inputs._forward_teacher_and_modeland the returned closure go away.teacher_predandactor_forward_pred;forward_only_teacher_predis gone (it wasteacher_predon another batch, never both set).keep_scorestakes(fake_batch, fake_pred, real_batch, real_pred).Why
A stage is model x input x grad. Only the actor has two kinds of forward (training, and an extra no-grad one whose input may differ); the teacher, EMA and ref forwards are all no-grad, so the actor's extra forward is one more sibling stage, not a mechanism of its own. "forward-only" named a batch, not a grad mode, and read as a tautology on the teacher.
Validation
pytest tests/fast/backends/fsdp_utils/test_loss_hub_dmd2.py test_reference_models.py test_train_input_hook.py tests/fast/utils/test_reference_arguments.py: 71 passed;pre-commitclean.record-e2e-standards.yml(run 45132900931, 3gpu runner) and compared with the committed standard ([DMD2 e2e] test(e2e): 2-GPU H3 DMD2 proxy with a CI-recorded standard #366, recorded on sglang-miles): every metric identical, so the defaultreuse-critic-steppath is unchanged end to end.run-ci-e2eon this PR.Files
miles/backends/fsdp_utils/loss_hub/types.py— the two batch fields.miles/backends/fsdp_utils/loss_hub/dmd2.py—_teacher_batch,prepare_critic_batchfills both batches underoriginal,keep_scoresper batch.miles/backends/fsdp_utils/actor.py— the flat trunk.docs/user-guide/customization.md,docs/fsdp_model_roles.md,docs/user-guide/cli-reference.md— contract wording.tests/fast/backends/fsdp_utils/test_loss_hub_dmd2.py,test_reference_models.py— harnesses follow the contract.Checklist
pre-commit run --all-filespasses (touched files)pytest -xis green (the touched suites)python3 train.py --helpstill parses — no flag changed