refactor(diffusion): move rollout patch group selection to a CLI arg - #97
Draft
Rockdu wants to merge 1 commit into
Draft
refactor(diffusion): move rollout patch group selection to a CLI arg#97Rockdu wants to merge 1 commit into
Rockdu wants to merge 1 commit into
Conversation
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
TrainPipelineConfig.rollout_patch_group: family config classes no longer inject rollout monkey-patch groups behind the user's back.--rollout-patch-group(comma-separated) to select patch groups explicitly at launch; the LTX launch script now passes--rollout-patch-group ltx.@register_rollout_patch_groupregistry inmiles_validate_args, so an unknown group fails at arg validation instead of inside the sglang-d scheduler child at engine startup.Why
rollout_patch_groupwas the last direct config→rollout coupling: a train-side config class decided which monkey patches the inference engine applies, with the knowledge crossing two processes (train arg validation →MILES_ROLLOUT_PATCH_GROUPSenv → sglang-d scheduler) and no validation until deep inside the engine. Selecting patch groups in launch arguments keeps arg validation to validation only (no inference from config classes) and makes the rollout-parity patching visible in the launch command. Behavior is unchanged for the in-tree recipes: the LTX script/e2e passes the flag explicitly, and--apply-sgld-monkey-patchesis untouched.Files
miles/utils/arguments.py— add--rollout-patch-group, merge it intoargs.rollout_patch_groups, validate groups against the registry; drop thecfg_cls.rollout_patch_groupinjectionmiles/backends/sglang_diffusion_utils/monkey_patches/__init__.py— addvalidate_rollout_patch_groups(); reuse it inapply_env_selected_rollout_patchesmiles/backends/fsdp_utils/configs/train_pipeline_config.py— remove therollout_patch_groupfield; document thesde_timestep_divisorunit conventionmiles/backends/fsdp_utils/configs/ltx.py— droprollout_patch_group = "ltx"scripts/run-diffusion-grpo-ltx23-sglang.sh— pass--rollout-patch-group ltxtests/fast/backends/sglang_diffusion_utils/test_rollout_patch_groups.py— cover the validator (registered instage-a-cpu)Checklist
pre-commit run --all-filespassespytest -xis green —tests/fast: 147 passed;test_hybrid_shard_mesh/test_metric_buffer_distfail identically on cleanmainin this sandbox (no local torch.distributed rendezvous), unrelated to this changepython3 train_diffusion.py --helpstill parses (new flag renders; run with a stubbed sglang, CPU-only env)