fix: apply config-file overrides before argument validation - #1914
Open
Shi-Dong wants to merge 4 commits into
Open
fix: apply config-file overrides before argument validation#1914Shi-Dong wants to merge 4 commits into
Shi-Dong wants to merge 4 commits into
Conversation
Shi-Dong
requested review from
Zhichenzzz,
fzyzcjy,
guapisolo,
jybsuper,
maocheng23 and
yueming-yuan
as code owners
July 28, 2026 16:30
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
…before-validation # Conflicts: # miles/utils/arguments.py # tests/fast/utils/test_arguments.py
Tests call miles_validate_args with partial namespaces; now that the override helper runs first, it must not require the attribute.
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.
Summary
--custom-config-pathlets a YAML file override any argument, but the override loop ran near the end ofmiles_validate_args. Every validation and derivation earlier in the function therefore used the pre-override values:use_criticis derived fromadvantage_estimatorbefore the override, so selecting the advantage estimator via the config file leavesuse_criticstale: the critic worker group and its placement are sized for the wrong estimator, and the async off-policy guard introduced in fix: require explicit off-policy correction for async PPO training #1829 (which keys onuse_critic) silently never fires.rollout_num_gpusonly reserves critic GPUs whenuse_criticis already set, so a config-file estimator switch under-provisions the rollout GPUs.offloadis expanded intooffload_train/offload_rolloutand then deleted before the override ran, sooffload: truein a config file was a silent no-op.This PR extracts the override loop into
_apply_custom_config_overridesand calls it as the first statement ofmiles_validate_args. An argument overridden via the config file now behaves exactly as if it had been passed on the command line: it participates in every subsequent validation and derivation. The--custom-config-pathhelp text documents this.One intentional behavior change: values that validation derives (such as
use_critic) can no longer be forced through the config file, because the derivation now runs after the override — set the source argument (e.g.advantage_estimator) instead.Stacked on #1829.
Test plan
tests/fast/utils/test_arguments.py(TestApplyCustomConfigOverrides):custom_config_pathis a no-opcustom_config_pathattribute is a no-op (tests invokemiles_validate_argswith partial namespaces)python -m py_compileon both touched filesblack --check,isort --check-only, andruff checkclean on both touched filesNote:
tests/fast/utils/test_arguments.pyimportsmiles.utils.arguments, which requires sglang, so the new tests were verified on this branch by exercising the extracted function body directly (same cases as committed), plus an AST check that the override call is the first statement ofmiles_validate_argsand the old inline block is gone; CI runs the real test file.