refactor(rlix-examples): extract shared driver helpers into _common#19
Open
TianyeGGBond wants to merge 2 commits into
Open
refactor(rlix-examples): extract shared driver helpers into _common#19TianyeGGBond wants to merge 2 commits into
TianyeGGBond wants to merge 2 commits into
Conversation
_overlap_pools_from_env returned None whenever any of the four
MILES_DUAL_P*_{TRAIN,INFER} vars was unset, so a typo or one missing var
silently fell back to the disjoint topology and ran a different experiment
than intended. Treat the four as all-or-nothing: all set -> overlap, none
set -> disjoint fallback, partial set -> ValueError naming the missing vars.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The single (run_miles_rlix.py) and dual (run_miles_dual.py) drivers carried
near-identical copies of the env-var guard, the MilesPipelineConfig
dataclass, and the Ray runtime_env construction. Move them to a new
examples/rlix/_common.py (stdlib-only, safe to import before the heavy
imports):
- require_rlix_control_plane(script, module) — the RLIX_CONTROL_PLANE guard
- MilesPipelineConfig — single dataclass (cluster_device_mappings defaults
to {} so the single driver is unaffected)
- build_pipeline_runtime_env(pipeline_id, namespace, extra=) — identity vars
+ PYTHONPATH + forwarded escape hatches; dual passes MILES_ROLLOUT_BASE_PORT
via extra=
Imports of _common use a try/except fallback (from ._common, else from
_common) so both `python -m examples.rlix.run_miles_*` (package context) and
`python examples/rlix/run_miles_*.py` (direct script, as the rlix smoke
scripts invoke it) keep working.
No behavior change; both drivers now share one definition.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
TianyeGGBond
force-pushed
the
tianye/m11-dual-dedup-common
branch
from
June 21, 2026 17:04
131181c to
6d23375
Compare
Author
|
Updated (force-push) to fix a blocker: the relative Both driver |
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.
Context
examples/rlix/run_miles_rlix.py(single) andrun_miles_dual.py(dual)carried three near-verbatim copies of the same logic:
RLIX_CONTROL_PLANE=rlixenv-var guard (must run before heavy imports),MilesPipelineConfigdataclass (defined as a local class in eachmain(); the dual one had an extracluster_device_mappingsfield),runtime_envenv_vars construction (identity vars + PYTHONPATH +the forwarded smoke-only escape hatches).
Two drifting copies are easy to let diverge.
Change
New
examples/rlix/_common.py(stdlib-only, so it is safe to import beforethe per-actor CUDA_VISIBLE_DEVICES guard fires):
require_rlix_control_plane(script_path, module_path)— the guardMilesPipelineConfig— one dataclass;cluster_device_mappingsdefaultsto
{}, so the single driver (which never set it) is unaffectedbuild_pipeline_runtime_env(pipeline_id, namespace, *, extra=None)— theenv_vars dict; the dual driver passes
MILES_ROLLOUT_BASE_PORTviaextra=Both drivers now import these instead of redefining them. No behavior change.
Stacking
Stacked on #18 (partial-env fail-fast). Until #18 merges into
zhenyu/m11-mvp-test, this PR's Files-changed view also shows #18's commit;review the top commit here. Merge after #18.
🤖 Generated with Claude Code