Repository navigation
Conversation
This was referenced Nov 2, 2026
Merged
Merged
zhihengy
force-pushed
the
dmd2/07-original-scoring
branch
from
November 9, 2026 22:16
ba4bb14 to
f50339e
Compare
zhihengy
force-pushed
the
dmd2/07-original-scoring
branch
from
November 10, 2026 12:53
f50339e to
0c5ceec
Compare
6 tasks done
Rockdu
added a commit
that referenced
this pull request
Nov 11, 2026
prepare_critic_batch did three things in one body: build the SFT batch, pick the scoring step's grid range, and collate the teacher's CFG inputs. The teacher part is its own function now, _request_teacher_forward, and the two helpers it shared with #351 are back, so the critic's prepare reads as SFT plus the last step's teacher request. No behaviour change.
zhihengy
force-pushed
the
dmd2/07-original-scoring
branch
from
November 11, 2026 11:00
0c5ceec to
a6e8635
Compare
5 tasks done
zhihengy
force-pushed
the
dmd2/07-original-scoring
branch
from
November 11, 2026 11:54
a6e8635 to
36222f1
Compare
Rockdu
added a commit
that referenced
this pull request
Nov 11, 2026
prepare_critic_batch did three things in one body: build the SFT batch, pick the scoring step's grid range, and collate the teacher's CFG inputs. The teacher part is its own function now, _request_teacher_forward, and the two helpers it shared with #351 are back, so the critic's prepare reads as SFT plus the last step's teacher request. No behaviour change.
Rockdu
marked this pull request as draft
November 11, 2026 13:04
Rockdu
added a commit
that referenced
this pull request
Nov 11, 2026
…by the critic's prepare hook (#372) * feat(ray): hand earlier trainer groups' outputs to later groups as external_data * fix(fsdp): box the train output so the driver's ray.get only waits `train` returned its train output directly, so the driver's ray.get on the train refs pulled every rank's output into the controller before the next group read it again from the object store. Return `Box(ray.put(output))` like the rollout shards: the driver gets a small box, the payload stays in the store until the paired rank of a later group unboxes it. Also note the train-output hook as a `--teacher-load` consumer in docs/fsdp_model_roles.md, which cli-reference.md already did. Co-Authored-By: Claude Mythos 5.1 <noreply@anthropic.com> * fix(ray): hand later trainer groups the output boxes, not the raw refs train returns Box(ray.put(output)); the driver discarded its ray.get and passed the task refs on, so the consumer's box.inner hit an ObjectRef. Keep the boxes the way the rollout shards are kept. Co-Authored-By: Claude Mythos 5.1 <noreply@anthropic.com> * feat(fsdp): add a train-input hook that preprocesses train pairs before micro-batching * refactor(fsdp): rename the train-input hook to custom_train_input_postprocess Review on #338: `custom_train_input_postprocess_func` says what the hook does, a post-processing step on the converted train pairs. The flag follows the prepare hook's pattern: `--custom-train-input-postprocess-path` sets `args.custom_train_input_postprocess_path`, loaded into `self.custom_train_input_postprocess_func`. Docs and the hook test follow. Co-Authored-By: Claude Mythos 5.1 <noreply@anthropic.com> * feat(rollout): stop the rollout at a random step for DMD2 backward simulation * feat(dmd2): train a fake-score critic group from the teacher and score the student's samples * feat(dmd2): train the student with the distribution matching gradient from the critic group's scores * fix(dmd2): follow the train-input hook rename in the DMD2 defaults #338 renamed the hook to --custom-train-input-postprocess-path; the DMD2 defaults and the critic override still set custom_train_input_function_path, so --loss-type dmd2 failed in parse_args. Co-Authored-By: Claude Mythos 5.1 <noreply@anthropic.com> * perf(ray): sleep each trainer group right after its train * feat(dmd2): add the MiniMax H3 4-step DMD2 recipe with the media and metrics to judge it * feat(dmd2): skip the engine's VAE decode of training rollouts when no reward reads the media * build: declare imageio-ffmpeg, which the eval media muxing imports miles/ray/rollout.py imports imageio_ffmpeg to mux the eval audio; the GPU image had it only as a transitive dependency and the hosted CPU suite not at all, so tests/fast/rollout/test_eval_media.py failed to import there. Co-Authored-By: Claude Mythos 5.1 <noreply@anthropic.com> * docs(h3): say the DMD2 recipe downloads the VidProM prompt list from the Hub * docs(dmd2): count the VidProM prompts after dedup * fix(dmd2): load the FastH3 reference by its Hub id on every node * refactor(args): drop the teacher consumer check Whether a hook forwards the teacher is the hook's business; the argument layer cannot tell from --loss-type and the hook paths who will read it, so the check only ever guessed. --teacher-load is now accepted under every loss type (dmd2 still requires it). * refactor(fsdp): select loss hooks from a (loss_type, role) table Stop filling the --custom-*-path arguments on behalf of nft / dmd2 and stop overriding them per trainer role: a group's prepare, formula, train-input and train-output hooks come from loss_hub.LOSS_HOOKS keyed by (loss_type, role), the way miles core's get_loss_function does. Only custom_loss reads the path flags. The critic overrides shrink to the six values that really differ (checkpoint, lr, load/save dirs, steps, batch). * fix(args): reject --custom-*-path outside --loss-type custom_loss A path given under any other loss type would be silently ignored now that the table selects the hooks, so fail at parse time instead. * fix(args): reject --diffusion-recompute-old-log-prob under dmd2 DMD2 has no log-prob ratio to recompute, and once the recompute loop passes its real step index the critic's last window would run its scoring prepare and formula a second time. sft_loss and nft already reject the flag. * refactor(fsdp): pass the loop counters to the hooks as arguments microbatch_id and optim_step_idx were written onto DiffusionLossContext before every forward and read back by the hooks; the planned micro-batch prefetch would race on them. They are now required keyword arguments of every prepare and formula hook, passed by the two trunk loops; the numbering is unchanged (training from 0, the old-log-prob recompute of windows 1.. reuses their training forwards' numbers). * refactor(fsdp): hand the train-output list to the hooks as an argument The DMD2 critic formula appended its scoring inputs to a list on the context and the train-output hook read them back: a hook-to-hook channel invisible in the call graph. The trunk now owns one list per train call and passes it to the formulas and to the train-output hook. * refactor(fsdp): freeze DiffusionLossContext Nothing writes the context after construction any more: it is the rollout-level, read-only view the hooks share. eq=False keeps identity comparison; a synthesized hash would fail on the dict fields. * refactor(fsdp): run the DMD2 teacher forward in the actor, requested by the critic's prepare hook * fix(fsdp): run the teacher forward without the student's true_cfg_scale * refactor(dmd2): pull the teacher request out of prepare_critic_batch prepare_critic_batch did three things in one body: build the SFT batch, pick the scoring step's grid range, and collate the teacher's CFG inputs. The teacher part is its own function now, _request_teacher_forward, and the two helpers it shared with #351 are back, so the critic's prepare reads as SFT plus the last step's teacher request. No behaviour change. --------- Co-authored-by: Claude Mythos 5.1 <noreply@anthropic.com> Co-authored-by: rockdu <kangrdu@gmail.com>
A group that trains and then scores in the same wake would wake twice, and waking a frozen model twice replaces its pinned host copies with its GPU parameters, so the next sleep would leave the teacher on the GPU. Co-Authored-By: Claude Mythos 5.1 <noreply@anthropic.com>
`train(..., optim_steps=(lo, hi))` runs windows lo..hi-1 of the rollout's micro-batch schedule with the micro-batch ids of the full run, so a range draws the same noise as the whole rollout would; a range outside the schedule, or one under --diffusion-recompute-old-log-prob, is rejected. The EMA steps once per rollout, by the call whose range ends at the last step. `RayTrainGroup.async_train` passes the range through. Co-Authored-By: Claude Mythos 5.1 <noreply@anthropic.com>
`FSDPTrainRayActor.compute(rollout_id, rollout_data_ref, external_data, hooks_key)` runs the loss hub's `(--loss-type, hooks_key)` hooks without grad: their train-input selection, one forward per micro-batch through the trunk (`_forward_train_pair_batch` takes the hooks to run instead of the group's), numbered past the rollout's training micro-batches so no training forward shares a draw, then their train-output hook, boxed as train's output is. The models are resharded after; the optimizer, scheduler, EMA and step count stay. `RayTrainGroup.async_compute` dispatches it per rank like `async_train`. Co-Authored-By: Claude Mythos 5.1 <noreply@anthropic.com>
…ate scoring forward
`reuse-critic-step` (default, no behavior change): the critic's last training step draws in the scoring range, asks
for the teacher and keeps both x0 as the score. `original`: that step is plain SFT and keeps nothing; the new
`("dmd2", "critic-scoring")` hooks, run forward-only by `FSDPTrainRayActor.compute`, score the last step's pairs
(`last_step_pairs`) at the scoring draw with the critic before its last update, as tianweiy/DMD2 does. Both modes share
`prepare_scoring_batch` and `keep_scores`, so they score the same function of the same draw.
Co-Authored-By: Claude Mythos 5.1 <noreply@anthropic.com>
…actor within a rollout `--loss-type dmd2` runs through its own entrypoint, as async NFT does: under `reuse-critic-step` the critic trains and the actor trains on its scores; under `original` the critic trains steps 0..K-2, scores forward-only, the actor trains on the scores and the critic trains step K-1. A group saves after its last train of the rollout and, under --offload-train, sleeps before another group wakes. `train_diffusion.py` sends dmd2 here; the H3 recipe passes `train_script="train_dmd2.py"` (its reference evals keep train_diffusion.py). Co-Authored-By: Claude Mythos 5.1 <noreply@anthropic.com>
zhihengy
force-pushed
the
dmd2/07-original-scoring
branch
from
November 11, 2026 22:02
36222f1 to
d0c8631
Compare
zhihengy
marked this pull request as ready for review
November 16, 2026 22:51
5 tasks done
Rockdu
added a commit
that referenced
this pull request
Nov 25, 2026
…#366) * feat(ray): hand earlier trainer groups' outputs to later groups as external_data * fix(fsdp): box the train output so the driver's ray.get only waits `train` returned its train output directly, so the driver's ray.get on the train refs pulled every rank's output into the controller before the next group read it again from the object store. Return `Box(ray.put(output))` like the rollout shards: the driver gets a small box, the payload stays in the store until the paired rank of a later group unboxes it. Also note the train-output hook as a `--teacher-load` consumer in docs/fsdp_model_roles.md, which cli-reference.md already did. Co-Authored-By: Claude Mythos 5.1 <noreply@anthropic.com> * fix(ray): hand later trainer groups the output boxes, not the raw refs train returns Box(ray.put(output)); the driver discarded its ray.get and passed the task refs on, so the consumer's box.inner hit an ObjectRef. Keep the boxes the way the rollout shards are kept. Co-Authored-By: Claude Mythos 5.1 <noreply@anthropic.com> * feat(fsdp): add a train-input hook that preprocesses train pairs before micro-batching * refactor(fsdp): rename the train-input hook to custom_train_input_postprocess Review on #338: `custom_train_input_postprocess_func` says what the hook does, a post-processing step on the converted train pairs. The flag follows the prepare hook's pattern: `--custom-train-input-postprocess-path` sets `args.custom_train_input_postprocess_path`, loaded into `self.custom_train_input_postprocess_func`. Docs and the hook test follow. Co-Authored-By: Claude Mythos 5.1 <noreply@anthropic.com> * feat(rollout): stop the rollout at a random step for DMD2 backward simulation * feat(dmd2): train a fake-score critic group from the teacher and score the student's samples * feat(dmd2): train the student with the distribution matching gradient from the critic group's scores * fix(dmd2): follow the train-input hook rename in the DMD2 defaults #338 renamed the hook to --custom-train-input-postprocess-path; the DMD2 defaults and the critic override still set custom_train_input_function_path, so --loss-type dmd2 failed in parse_args. Co-Authored-By: Claude Mythos 5.1 <noreply@anthropic.com> * perf(ray): sleep each trainer group right after its train * feat(dmd2): add the MiniMax H3 4-step DMD2 recipe with the media and metrics to judge it * feat(dmd2): skip the engine's VAE decode of training rollouts when no reward reads the media * build: declare imageio-ffmpeg, which the eval media muxing imports miles/ray/rollout.py imports imageio_ffmpeg to mux the eval audio; the GPU image had it only as a transitive dependency and the hosted CPU suite not at all, so tests/fast/rollout/test_eval_media.py failed to import there. Co-Authored-By: Claude Mythos 5.1 <noreply@anthropic.com> * docs(h3): say the DMD2 recipe downloads the VidProM prompt list from the Hub * docs(dmd2): count the VidProM prompts after dedup * fix(dmd2): load the FastH3 reference by its Hub id on every node * refactor(args): drop the teacher consumer check Whether a hook forwards the teacher is the hook's business; the argument layer cannot tell from --loss-type and the hook paths who will read it, so the check only ever guessed. --teacher-load is now accepted under every loss type (dmd2 still requires it). * refactor(fsdp): select loss hooks from a (loss_type, role) table Stop filling the --custom-*-path arguments on behalf of nft / dmd2 and stop overriding them per trainer role: a group's prepare, formula, train-input and train-output hooks come from loss_hub.LOSS_HOOKS keyed by (loss_type, role), the way miles core's get_loss_function does. Only custom_loss reads the path flags. The critic overrides shrink to the six values that really differ (checkpoint, lr, load/save dirs, steps, batch). * fix(args): reject --custom-*-path outside --loss-type custom_loss A path given under any other loss type would be silently ignored now that the table selects the hooks, so fail at parse time instead. * fix(args): reject --diffusion-recompute-old-log-prob under dmd2 DMD2 has no log-prob ratio to recompute, and once the recompute loop passes its real step index the critic's last window would run its scoring prepare and formula a second time. sft_loss and nft already reject the flag. * refactor(fsdp): pass the loop counters to the hooks as arguments microbatch_id and optim_step_idx were written onto DiffusionLossContext before every forward and read back by the hooks; the planned micro-batch prefetch would race on them. They are now required keyword arguments of every prepare and formula hook, passed by the two trunk loops; the numbering is unchanged (training from 0, the old-log-prob recompute of windows 1.. reuses their training forwards' numbers). * refactor(fsdp): hand the train-output list to the hooks as an argument The DMD2 critic formula appended its scoring inputs to a list on the context and the train-output hook read them back: a hook-to-hook channel invisible in the call graph. The trunk now owns one list per train call and passes it to the formulas and to the train-output hook. * refactor(fsdp): freeze DiffusionLossContext Nothing writes the context after construction any more: it is the rollout-level, read-only view the hooks share. eq=False keeps identity comparison; a synthesized hash would fail on the dict fields. * refactor(fsdp): run the DMD2 teacher forward in the actor, requested by the critic's prepare hook * fix(fsdp): run the teacher forward without the student's true_cfg_scale * refactor(dmd2): pull the teacher request out of prepare_critic_batch prepare_critic_batch did three things in one body: build the SFT batch, pick the scoring step's grid range, and collate the teacher's CFG inputs. The teacher part is its own function now, _request_teacher_forward, and the two helpers it shared with #351 are back, so the critic's prepare reads as SFT plus the last step's teacher request. No behaviour change. * test(e2e): run the H3 DMD2 recipe as a 2-GPU proxy in CI The DMD2 recipe only knew its 2 x 8 topology. Give it the knobs an e2e needs: --num-nodes / --num-gpus-per-node (one node starts its own ray cluster), --critic-steps-per-rollout, --eval-interval 0 / --save-interval 0 to drop eval and checkpoints (0 used to reach should_run_periodic_action's modulo), --fsdp-cpu-offload and --master-dtype. The three 31B models do not fit two GPUs with their optimizers, so the proxy keeps parameters, gradients and optimizer states in host memory with a bf16 master and steps on the CPU. tests/e2e/short/test_h3_t2va_dmd2_2xGPU.py runs 2 rollouts of 4 prompts (2 critic steps of 2, 1 student step on the last 2) under --deterministic-mode and checks the critic loss and grad norm, the student grad norm and the DMD2 metrics against the recorded standard. The 16-GPU defaults are unchanged. Co-Authored-By: Claude Mythos 5.1 <noreply@anthropic.com> * test(e2e): record the H3 DMD2 standard on CI and name the test as a proxy The standard comes from record-e2e-standards.yml on the 3gpu runner (run 42809959116, sglang zhihengy/sglang:dmd2/h3-dmd2-e2e), not from a local run. The test is renamed to the 16xGPU_single_node_2xGPU_proxy form the wan22 and krea2 proxies use, since it runs the 16-GPU recipe shrunk to two GPUs. Co-Authored-By: Claude Mythos 5.1 <noreply@anthropic.com> * test(e2e): re-record the H3 DMD2 standard on sglang-miles record-e2e-standards.yml run 43032161294 on the 3gpu runner, this branch at daff1b5 on sglang-miles 47930723 (the tip with sgl-project/sglang#49440 and #49143, so no ci-sglang-pr override). All 22 metric points match the two records on the previous combo branch bit for bit; only meta.commit moves. Co-Authored-By: Claude Mythos 5.1 <noreply@anthropic.com> * test(e2e): run the H3 DMD2 proxy with LoRA adapters instead of CPU offload The full-parameter 2-GPU proxy keeps about 1.6 TB in host memory and Ray's memory monitor kills it whenever another e2e shares the CI node. The recipe script gets --lora: the student and the critic train LoRA adapters over frozen bf16 bases (about 112 GB per GPU, about 530 GB of host memory), and the e2e test uses it. The 16-GPU recipe stays full-parameter, and --fsdp-cpu-offload still runs it on fewer GPUs. --loss-type dmd2 now accepts --use-lora. * test(e2e): re-record the H3 DMD2 standard for the LoRA proxy Recorded on the 3gpu CI runner by run 45285320503 at 439990e. * docs(dmd2): state the LoRA proxy's GPU memory as the trainer reports it * docs(h3): drop the single-node smoke section from the model page The model page carries recipes meant to be run; the single-node --lora / --fsdp-cpu-offload modes are smoke configurations for CI and development, documented where they live: the recipe script's docstring and the e2e test. The section also copied the docstring word for word. --------- Co-authored-by: Claude Mythos 5.1 <noreply@anthropic.com> Co-authored-by: rockdu <kangrdu@gmail.com>
This branch has not been deployed
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.
Tenth and last of the DMD2 stacked series, on
mainnow that #343, #367, #368 and #372 are in. Adds--dmd2-critic-scoring original: tianweiy/DMD2's scoring, a separate noise draw and a critic forward on the last step's samples before the critic trains on them. The default,reuse-critic-step, keeps the current behavior, where that step's training forward doubles as the critic's score. The two differ only in whether the scoring shares the critic's last SFT draw and forward, so a run of each isolates what that reuse costs or buys.DMD2 gets its own driver for this,
train_dmd2.py, as async NFT hastrain_diffusion_async.py: the critic / actor order of a rollout is written out there, instead of a generic phase schedule intrain_diffusion.py.What
--dmd2-critic-scoring {reuse-critic-step, original}, defaultreuse-critic-step(no behavior change).train_dmd2.py: the entrypoint for--loss-type dmd2(train_diffusion.pynow rejects it). Per rollout, with K =--dmd2-critic-steps-per-rollout:reuse-critic-step: critic trains its K steps → actor trains on its scores.original: critic trains steps 0..K−2 → critic scores the last step's pairs, forward only → actor trains on the scores → critic trains step K−1. With K = 1 the first train is dropped.--offload-train, sleeps before another group wakes. The rest of the loop (eval, dataset save, weight update) istrain_diffusion.py's.FSDPTrainRayActor.train(..., optim_steps=(lo, hi))trains that range of the rollout's optimizer steps with the micro-batch ids of the full run; a range outside the schedule, or one under--diffusion-recompute-old-log-prob, is rejected. The EMA steps once per rollout, by the call whose range ends at the last step.FSDPTrainRayActor.compute(rollout_id, rollout_data_ref, external_data, hooks_key)runs the loss hub's(loss_type, hooks_key)hooks forward-only: their train-input selection, one no-grad forward per micro-batch through the trunk (_forward_train_pair_batchtakes the hooks to run), numbered past the rollout's training micro-batches so no training forward shares a draw, then their train-output hook, boxed as train's output. The models are resharded after; the optimizer, scheduler, EMA and step count stay.RayTrainGroup.async_computedispatches it per rank.loss_hub.dmd2: the critic's scoring batch and the kept x0 are factored intoprepare_scoring_batchandkeep_scores, which both modes use. Underoriginalthe critic's last training step is plain SFT (full grid, no teacher, keeps nothing) and the new("dmd2", "critic-scoring")hooks (prepare_scoring_batch,scoring_formulawith no loss,last_step_pairs,score_last_step_samples) score the last 1/K of the shard at the scoring draw with the critic before its last update.wake_upis a no-op while the group is awake: a group that trains and then scores in one wake would otherwise wake twice, and waking a frozen model twice replaces its pinned host copies with its GPU parameters.train_script="train_dmd2.py"(its--referenceevals keeptrain_diffusion.py). Docs:cli-reference.md,customization.md,launch-script.md.Why
reuse-critic-steplets the K-th SFT step and the scoring share one draw, restricted to the scoring range, and one forward.originalis the control for that reuse: independent draws, one more critic forward per scored sample, and the critic's last step on the full grid. The scored sample set,dmd2_loss_formulaandselect_scored_pairsare the same.x0_faketoward them. So the critic's K steps are split around the actor.trainover a step range andcompute. The hooks of the forward-only pass sit in the loss hub's table like any other, and they call the shared prepare and keep functions directly, so the training-mode check (_is_scoring_step) cannot switch them off.originalper rollout: a critic forward per scored sample and, under--offload-train, one more sleep/wake of the critic and of the actor, since the critic returns after the actor.reuse-critic-stepstays the default.Tests
tests/fast/test_train_dmd2.py: the production driver loop on both modes with K = 1 and 3, with and without--offload-train: the event order, the actor'sexternal_data({"critic": scores}), saves after a group's last train, sleeps before another group; the critic trains exactly K steps per rollout and the actor once, with the scoring before the critic's last update; other loss types are rejected.test_train_diffusion.py: dmd2 is rejected.test_train_optim_steps.py: a step range trains those steps only, with the full run's micro-batch ids; ranges outside the schedule and under the old-log-prob recompute are rejected; the EMA steps once per rollout, by the call that trains the last step.test_compute_hooks.py: the kept pairs forward once each, numbered after the full schedule's micro-batches, through the hooks handed in; the models are resharded; the step count stays.test_train_output_handoff.py: compute unboxesexternal_dataand boxes its output like train.test_reference_models.py: the trunk runs the hooks it is handed instead of the group's.test_loss_hub_dmd2.py: underoriginalthe last step is plain SFT and keeps nothing; the scoring batch equals the reuse mode's last-step batch at the same micro-batch id (draw, sigmas, teacher scale, conds);scoring_formulareturns no loss and the kept x0 equalx_s − σ vof the critic's and the teacher's forwards;last_step_pairsis the setselect_scored_pairskeeps.test_loss_hub_selection.py: the new table entry.test_placement_group.py: rank pairing ofasync_trainwith a step range and ofasync_compute.test_sleep_wake.py: sleep → wake → wake → sleep moves the models and optimizer once each way.Validation on CI (2 x H200, the #366 proxy)
Both modes ran the #366 proxy (2 rollouts of 4 prompts, 2 critic steps, 1 student step,
--deterministic-mode,--fsdp-cpu-offload) throughtrain_dmd2.pyon the3gpurunner withrecord-e2e-standards.yml, from a temporary branch (deleted since) that carried this PR's commits on the currentmain(the output-store PRs, which this chain still predates) plus #366's e2e: commit df68b9f. This PR's head is that code rebased ontomainafter the chain merged, with the output-store follow-ups folded into their commits (computematerializes the stored tensors liketrain;train_dmd2.pyreleases the rollout after the last group's train, astrain_diffusion.pydoes); neither changes a forward.reuse-critic-step, https://github.com/radixark/miles_diffusion/actions/runs/43006736048: the recorded artifact equals the committedtest_h3_t2va_dmd2_16xGPU_single_node_2xGPU_proxy.jsonbit for bit on all 22 metric points (the file differs only in itsmeta.commit). The default mode through the new driver, the step-rangetrainand the hook table is the old loop.original, https://github.com/radixark/miles_diffusion/actions/runs/43006739665 (a copy of the proxy with--dmd2-critic-scoring original, on the temporary branch only): completes; per rollout the log shows critic step →wake_up(no-op, 0.0 s) →compute(14.6 s: a critic and a teacher forward on the 2 kept samples) → critic sleeps → actor wakes, trains, sleeps → critic wakes, trains its last step →update_weights; critic steps 1–4 and student steps 1–2 all emit their metrics. Step 1 of the critic (the first SFT draw) and the rollout x0 statistics match the reuse run bit for bit; the scoring-dependent metrics differ, as the scoring draw is independent and the critic's last step runs on the full grid.reuse-critic-steporiginalThe two CPU-offloaded 31B optimizers dominate the step times, so the per-step spread (569 s vs 479 s for the same two reuse steps) is the runner, not the mode;
original's extra cost at this size is the 15 scomputeand one more sleep/wake pair per rollout.Checklist
pre-commithooks (black, isort, ruff at the pinned versions) pass on the changed filespytest tests/fast: 727 passed, 3 skipped; the 5 failures intest_loss_hub_flow_grpo.pyfail on plainmainas well (rockdu/fix-flow-grpo-loss-test), the other 3 and the 4 collection errors are the local env's missingradix_transfer_pluginson this head (onmainat f853234; the output-store files that needradix_transfer_pluginsare the usual local collection errors)python3 train_diffusion.py --helpandpython3 train_dmd2.py --helpparse;--dmd2-critic-scoringis listedStack
DMD2: distill a flow-matching teacher into a few-step student with distribution matching. Merge in order:
external_data--loss-type dmd2on the actor(loss_type, role), loop state as hook arguments) and refactor(fsdp): run the DMD2 teacher forward in the actor, requested by the critic's prepare hook #372 (the teacher forward in the trunk), mergedtrain_dmd2.pyand--dmd2-critic-scoring originalA GAN head and other follow-ups come after this series.