Skip to content

[Docs] Fix broken samples in the RLlib, Tune scheduler and collective guides - #66918

Merged
dstrodtman merged 3 commits into
ray-project:masterfrom
shaikn6:fix-rllib-doc-imports
Oct 13, 2026
Merged

dstrodtman merged 3 commits into
ray-project:masterfrom
shaikn6:fix-rllib-doc-imports

Conversation

@shaikn6

@shaikn6 shaikn6 commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Why are these changes needed?

Several doc samples fail when copied because they use names or arguments that don't exist. This PR bundles the fixes:

RLlib import paths

  • doc/source/rllib/multi-agent-envs.md: from ray.rllib.algorithm.ppo import PPOConfig → ModuleNotFoundError: No module named 'ray.rllib.algorithm'. Now ray.rllib.algorithms.ppo.
  • doc/source/rllib/offline.md (2 samples): from ray.rllib.algorithm_config import AlgorithmConfig → ModuleNotFoundError. Now ray.rllib.algorithms.algorithm_config.
  • doc/source/rllib/rl-modules.md (2 samples): from ray.rllib.core import Columns, TorchRLModule → ImportError: cannot import name 'TorchRLModule'. ray.rllib.core exports Columns but not TorchRLModule, so the sample now imports TorchRLModule from ray.rllib.core.rl_module.torch.

Wrong names

  • doc/source/rllib/offline.md: Columns.TERMINATED / Columns.TRUNCATED → Columns.TERMINATEDS / Columns.TRUNCATEDS.
  • doc/source/ray-more-libs/ray-collective.md: collective.destroy_group() → collective.destroy_collective_group().

Tune scheduler arguments

  • doc/source/tune/api/schedulers.rst: the PopulationBasedTrainingReplay sample passes experiment_dir= and trial_id=, but the constructor is __init__(self, policy_file: str), so it raises TypeError: PopulationBasedTrainingReplay.__init__() got an unexpected keyword argument 'experiment_dir'. The sample now passes policy_file= with the pbt_policy_<trial id>.txt naming from the class docstring, and the sentence above it describes that argument.

Related issue number

None.

Checks

AI assistance

AI assistance was used to find and prepare these fixes.

Not a duplicate: searched open PRs with gh pr list --repo ray-project/ray --state open --search "<terms>" for PopulationBasedTrainingReplay, schedulers.rst policy_file, rllib docs import paths and ray-collective destroy_collective_group. The only hits were this PR and #66654, which is an unrelated Ray Data change. There is no linked issue.

Tests run and results:

  • RLlib imports, with pip install "ray[rllib]": each original import line raises the error quoted above and each corrected line imports.
  • Tune, with pip install "ray[tune]" (ray 2.59.0): PopulationBasedTrainingReplay(experiment_dir=..., trial_id=...) raises the TypeError above; PopulationBasedTrainingReplay(policy_file=<path to a one-row policy file>) constructs. The signature in python/ray/tune/schedulers/pbt.py on master is __init__(self, policy_file: str).
  • The docs site was not built locally.

Docs-only change.

@shaikn6
shaikn6 requested review from a team as code owners October 10, 2026 16:39

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

Copy link
Copy Markdown
Contributor

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 corrects several outdated import paths in the RLlib documentation, specifically updating imports for PPOConfig, AlgorithmConfig, and TorchRLModule to reflect their correct locations in the codebase. There are no review comments to address, and I have no further feedback to provide.

@shaikn6
shaikn6 requested a review from a team as a code owner October 10, 2026 17:27
@shaikn6

shaikn6 commented Oct 10, 2026

Copy link
Copy Markdown
Contributor Author

Added a second signed-off commit for two more stale names: collective.destroy_group() → collective.destroy_collective_group() (ray-collective.md) and Columns.TERMINATED/TRUNCATED → Columns.TERMINATEDS/TRUNCATEDS (rllib/offline.md). Both corrected names exist in the released package; the old ones raise AttributeError.

@ray-gardener ray-gardener Bot added rllib RLlib related issues docs An issue or change related to documentation community-contribution Contributed by the community labels Oct 10, 2026
@shaikn6
shaikn6 requested a review from a team as a code owner October 11, 2026 05:04
@shaikn6 shaikn6 changed the title [RLlib] [Docs] Fix import paths in three RLlib guides [Docs] Fix broken samples in the RLlib, Tune scheduler and collective guides Oct 11, 2026

@pseudo-rnd-thoughts pseudo-rnd-thoughts left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for fixing these issues

@pseudo-rnd-thoughts pseudo-rnd-thoughts added the go add ONLY when ready to merge, run all tests label Oct 12, 2026
@dstrodtman
dstrodtman merged commit 0acd07c into ray-project:master Oct 13, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Contributed by the community docs An issue or change related to documentation go add ONLY when ready to merge, run all tests rllib RLlib related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants