Repository navigation
Conversation
This was referenced Oct 26, 2026
Open
5 of 6 tasks
3 of 5 tasks
zhihengy
force-pushed
the
dmd2/06-h3-recipe
branch
from
November 9, 2026 22:16
a5a42f3 to
d387c25
Compare
…metrics to judge it
… reward reads the media
zhihengy
force-pushed
the
dmd2/06-h3-recipe
branch
from
November 10, 2026 03:59
d387c25 to
7d3283e
Compare
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.
Ninth of the DMD2 stacked series, on top of #342. Adds the MiniMax H3 t2va 4-step DMD2 recipe for 2 nodes x 8 GPUs, and what is needed to judge a run by looking at it: eval videos at the right speed and with sound, kept on disk next to reference renders of the same prompts and seeds, plus distribution-matching and memory metrics.
What
scripts/run_diffusion_dmd2_h3_t2va_16gpu_multinode.py: FastVideo's FastH3 Preview v1 Dense / Data-Free recipe (fromcheckpoint_metadata.jsonofFastVideo/FastVideo-FastH3-4-step-Preview-v1-Dense-DataFree) on--loss-type dmd2:stop_at_random_stepbackward simulation,oderollout, unguided teacher;--dmd2-critic-loss-space x0,--dmd2-score-sigma-range 0.001 0.999,--fsdp-flow-shift visual=5.0;vidprom_filtered_extended.txt(248,221 VidProM prompts), downloaded and split deterministically by the script into train / test / a 26-prompteval_mediaset, with the output hashes pinned so every node builds the same files;--reference teacher|fasth3renders the eval set with MiniMax-H3 at 50 steps or with FastH3's student at 4 steps (MiniMax-H3 with the FastH3 transformer swapped in; the export shares every other component and both shifts), through--debug-rollout-onlyeval.--rm-type none: a constant 0 reward with no scorer, for a loss that reads none. The rollout still asks for a reward, and DMD2 has no use for one. With it (and no--custom-rm-path), training requests also sendrollout_return_generated_output=False, so the engine skips their VAE decode ([sglang-miles] [Diffusion] Let a rollout request skip the VAE decode sgl-project/sglang#46545); eval requests still decode.--rollout-video-dtypenow applies to eval responses too.--diffusion-fps(the hardcoded 8 stays the fallback); H3's config drops fps from the request, so the recipe sets 24 for playback only;imageio_ffmpeg's ffmpeg).Samplegainsgenerated_audio/audio_sample_rate, read from the rollout response'sgenerated_audio/audio_sample_ratewhen present;--save-eval-media-dir: every eval sample's file under<dir>/eval_<rollout_id>/with anindex.jsonlof prompt, seed and reward, independent of--wandb-log-num-images; such samples keep their media past scoring;RolloutManager.disposejoins the media threads, so the last eval (and a reference run, which ends right after it) is fully written and uploaded.dmd2_score_gap_abs_mean(mean |x0_fake − x0_real|),dmd2_teacher_dist_abs_mean(mean |x0 − x0_real|, g's normalizer),dmd2_x0_mean/dmd2_x0_std;dmd2_grad_abs_mean, the two above andx0_mean_abs_diffare also logged per stop step as<key>_step{i}, through aSTEP_SCHEMAfamily ofnew_metric_buffer(num_rollout_steps=...); a step no pair trained on logs nothing;peak_memory_allocated_gb(this process, since the previous step) anddevice_memory_used_gb(the whole GPU, so sleeping groups and the engine count) per optimizer step.Why
--eval-intervalwith the same seeds, and the two reference runs render the same prompts and seeds, so files with the same name compare directly.dmd2here.score_timestep_shift 2.4on its own clock, which FastGen-DMD documents as FastGen's score-time shift 5 (12 / 5 = 2.4);--fsdp-flow-shift visual=5.0gives that density on the sigma axis. Worth re-checking against FastVideo's training code once it is published.--rm-type none: miles' rm_hub hasrandom/deterministic_randomfor runs that do not need a real reward.Known gaps
generated_audio/audio_sample_rateto the rollout response; until it is in the image the saved videos are silent. The miles side here reads the fields when present.sglang-milesis the branchzhihengy/sglang:dmd2/h3-dmd2-e2e.Tests
tests/fast/backends/fsdp_utils/test_loss_hub_dmd2.py: the new metrics, overall and per stop step, on pairs with known teacher distance and score gap; steps no pair stopped at log nothing.tests/fast/rollout/test_eval_media.py: a video plays at the given fps (frame count and duration read back), the engine's audio ends up as a second stream with no leftover files, a single frame is a png, and_log_imageswith a save dir keeps every sample plusindex.jsonlwithout W&B.tests/fast/rollout/test_rm_none.py:nonegives 0 for every sample, globally and as a per-sample override.tests/fast/rollout/test_rollout_payload_media.py: training requests skip the decode only when no reward reads the media (nonewithout a custom reward); eval requests always decode; the video dtype reaches eval requests.tests/fast/rollout/test_release_eval_sample_media.py: saved eval media are kept past scoring; released samples also drop their audio.tests/fast/utils/test_diffusion_rollout_response.py: the response's audio fields fill the sample, and are absent when the engine sends none.--referencearg sets go throughmiles.utils.arguments.parse_argsand its DMD2 validation offline (global batch 320, scoring range, critic loss space, x0 flow shift, rm none, eval media dir).Checklist
pre-commithooks (black, isort, ruff at the pinned versions) pass on the changed filespytest tests/fast: 575 passed, 7 skipped; 4 tests fail in this environment and fail the same way on [DMD2 7/10] feat(dmd2): train the student with the distribution matching gradient from the critic group's scores #334 (test_hybrid_shard_mesh::test_mesh_axesandtest_metric_buffer_dist::test_metric_buffer_reduction, whose torchrun children import another checkout, and twotest_sft_h3_ref2va_encodercases)python3 train_diffusion.py --helpstill parses (--save-eval-media-diris listed)--save-eval-media-dir;--rm-type nonewith its decode skip, eval--rollout-video-dtype, and the--diffusion-fpsplayback use in their rows)Stack
DMD2: distill a flow-matching teacher into a few-step student with distribution matching. Merge in order:
external_data--loss-type dmd2on the actor--dmd2-critic-scoring original, the reference's separate scoring before the critic's last stepA GAN head and other follow-ups come after this series.