Skip to content

[Docs] Enumerate accepted resource keys for ScalingConfig (#46608)#63449

Open
dstrodtman wants to merge 2 commits into
ray-project:masterfrom
dstrodtman:doc-980-scalingconfig-resource-keys
Open

[Docs] Enumerate accepted resource keys for ScalingConfig (#46608)#63449
dstrodtman wants to merge 2 commits into
ray-project:masterfrom
dstrodtman:doc-980-scalingconfig-resource-keys

Conversation

@dstrodtman
Copy link
Copy Markdown
Contributor

Description

The trainer_resources and resources_per_worker docstrings on ScalingConfig previously only named "CPU" (and "GPU") and pointed at the custom-resources ref without listing the pre-defined keys users can actually pass — the reporter explicitly asked whether they could request memory. Expand both docstrings in python/ray/air/config.py (V1) and the V2 override in python/ray/train/v2/api/config.py to enumerate "CPU", "GPU", "memory" (bytes), "TPU" (V2 only), and custom resources, with case-sensitivity callouts and a link to the Ray Core resources page.

Related issues

Closes #46608

[DOC-980]

Additional information

Target files:

  • python/ray/air/config.py — V1 ScalingConfig (the base class; documents both trainer_resources and resources_per_worker).
  • python/ray/train/v2/api/config.py — V2 ScalingConfig (subclasses V1 and overrides the resources_per_worker docstring; trainer_resources is deprecated in V2 and not re-documented here).

No code or behavior changes; docstrings only.

Generated with Claude Code

…t#46608)

The ``trainer_resources`` and ``resources_per_worker`` docstrings on
``ScalingConfig`` previously only named ``"CPU"`` (and ``"GPU"``) and
pointed at the ``custom-resources`` ref without listing the pre-defined
keys users can actually pass. Expand both docstrings in
``python/ray/air/config.py`` (V1) and the V2 override in
``python/ray/train/v2/api/config.py`` to enumerate ``"CPU"``, ``"GPU"``,
``"memory"`` (bytes), ``"TPU"`` (V2 only), and custom resources, with
case-sensitivity callouts and a link to the Ray Core resources page.

Closes ray-project#46608

[DOC-980]

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Douglas Strodtman <douglas@anyscale.com>
@dstrodtman dstrodtman requested a review from a team as a code owner May 18, 2026 16:03
Copy link
Copy Markdown
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 improves the documentation for ScalingConfig in both the Ray AIR and Train V2 APIs by explicitly listing supported resource keys and their case sensitivity. The review feedback suggests clarifying that memory in trainer_resources is reserved for the coordinator actor and ensuring that 'TPU' is consistently included in the case-sensitivity notes across all configuration versions.

Comment thread python/ray/air/config.py

- ``"CPU"``: number of logical CPUs.
- ``"GPU"``: number of logical GPUs.
- ``"memory"``: heap memory reserved on the node, in bytes
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.

medium

For trainer_resources, the memory is reserved specifically for the training coordinator actor, not for the entire node. Using "reserved for the coordinator" would be more accurate and consistent with the "reserved per worker" phrasing used in the resources_per_worker section below.

Suggested change
- ``"memory"``: heap memory reserved on the node, in bytes
- ``"memory"``: heap memory reserved for the coordinator, in bytes

Comment thread python/ray/air/config.py
Comment thread python/ray/air/config.py
@ray-gardener ray-gardener Bot added docs An issue or change related to documentation train Ray Train Related Issue labels May 18, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

This pull request has been automatically marked as stale because it has not had
any activity for 14 days. It will be closed in another 14 days if no further activity occurs.
Thank you for your contributions.

You can always ask for help on our discussion forum or Ray's public slack channel.

If you'd like to keep this open, just leave any comment, and the stale label will be removed.

@github-actions github-actions Bot added the stale The issue is stale. It will be closed within 7 days unless there are further conversation label Jun 2, 2026
Copy link
Copy Markdown
Member

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

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs An issue or change related to documentation stale The issue is stale. It will be closed within 7 days unless there are further conversation train Ray Train Related Issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Doc | Ray Train] Make it clear what resources are accpeted by trainer_resources and resources_per_worker

2 participants