Skip to content

Conversation

@kamil-kaczmarek
Copy link
Contributor

@kamil-kaczmarek kamil-kaczmarek commented Dec 23, 2025

Description

Create a resource bundle for each learner, do not pack all learners into single bundle.

Related to #51017

Signed-off-by: Kamil Kaczmarek <[email protected]>
@kamil-kaczmarek kamil-kaczmarek self-assigned this Dec 23, 2025
@kamil-kaczmarek kamil-kaczmarek requested a review from a team as a code owner December 23, 2025 04:04
@kamil-kaczmarek kamil-kaczmarek added the rllib RLlib related issues label Dec 23, 2025
@kamil-kaczmarek kamil-kaczmarek marked this pull request as draft December 23, 2025 04:04
@kamil-kaczmarek kamil-kaczmarek changed the title [RLlib] Create resource bundle per learner, optimize init [RLlib] Create resource bundle per learner, optimize Algorithm setup Dec 23, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the creation of resource bundles for learners in RLlib. Instead of creating a single large bundle for all learners, it now creates a separate bundle for each learner. This is a good change that allows for more flexible scheduling of learners across a cluster. The removal of the extension point for _get_learner_bundles also simplifies the code.

My review includes one suggestion to apply the same bundling logic to aggregator actors when no remote learners are used, for consistency.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Kamil Kaczmarek <[email protected]>
@kamil-kaczmarek kamil-kaczmarek changed the title [RLlib] Create resource bundle per learner, optimize Algorithm setup [RLlib] Create resource bundle per learner Dec 23, 2025
@kamil-kaczmarek kamil-kaczmarek added the go add ONLY when ready to merge, run all tests label Dec 23, 2025
@kamil-kaczmarek kamil-kaczmarek marked this pull request as ready for review December 23, 2025 04:55
@simonsays1980 simonsays1980 added the rllib-algorithms An RLlib algorithm/Trainer is not learning. label Dec 23, 2025
Copy link
Contributor

@simonsays1980 simonsays1980 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking the ownership here @kamil-kaczmarek ! The solution you propose looks good. There is one question left to be answered.

"CPU": num_cpus_per_learner + config.num_aggregator_actors_per_learner,
"GPU": config.num_gpus_per_learner,
}
for _ in range(config.num_learners)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks more correct than before, but I am wondering, if this would still not ensure that AggregatorActors being scheduled on the same node as we do not use placement groups. Could theoretically an EnvRunner be scheduled on CPUs of the same node instead of an AggregatorActor?

@simonsays1980 simonsays1980 self-requested a review January 7, 2026 14:44
Copy link
Contributor

@simonsays1980 simonsays1980 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for this important change @kamil-kaczmarek !

@simonsays1980 simonsays1980 enabled auto-merge (squash) January 7, 2026 14:45
@simonsays1980 simonsays1980 merged commit f6c2b5f into master Jan 7, 2026
7 checks passed
@simonsays1980 simonsays1980 deleted the kk/fix-learner-bundles branch January 7, 2026 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go add ONLY when ready to merge, run all tests rllib RLlib related issues rllib-algorithms An RLlib algorithm/Trainer is not learning.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants