refactor(miles): drop redundant num_gpus=1 in RLix train actor decorator#30
Open
TianyeGGBond wants to merge 1 commit into
Open
Conversation
The ray.remote(num_gpus=1) decorator value is immediately overridden by .options(num_gpus=num_gpus_per_actor) on every use, so the 1 is dead and misleading. Declare GPU resources only in .options(). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
In the F12 shared-PG / RLix-mode train path,
RayTrainGroup._allocate_gpus_via_placementsbuilds each train actor like this:.options(num_gpus=num_gpus_per_actor)is applied on every single use, so thenum_gpus=1in theray.remote(...)decorator is never the effective value. It is dead, and worse it is misleading: a reviewer seesnum_gpus=1in the decorator andnum_gpus=num_gpus_per_actor(0 in RLix mode) in.options()and has to reason about which one wins.Change
miles/ray/actor_group.py: removenum_gpus=1from theray.remote(...)decorator. GPU resource is now declared in exactly one place —.options().Impact
None.
.options()already overrode the decorator on every code path, so effective scheduling behavior is byte-for-byte identical. This is a readability-only change.