[Docs] Enumerate accepted resource keys for ScalingConfig (#46608)#63449
[Docs] Enumerate accepted resource keys for ScalingConfig (#46608)#63449dstrodtman wants to merge 2 commits into
Conversation
…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>
There was a problem hiding this comment.
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.
|
|
||
| - ``"CPU"``: number of logical CPUs. | ||
| - ``"GPU"``: number of logical GPUs. | ||
| - ``"memory"``: heap memory reserved on the node, in bytes |
There was a problem hiding this comment.
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.
| - ``"memory"``: heap memory reserved on the node, in bytes | |
| - ``"memory"``: heap memory reserved for the coordinator, in bytes |
|
This pull request has been automatically marked as stale because it has not had 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. |
Description
The
trainer_resourcesandresources_per_workerdocstrings onScalingConfigpreviously only named"CPU"(and"GPU") and pointed at thecustom-resourcesref without listing the pre-defined keys users can actually pass — the reporter explicitly asked whether they could requestmemory. Expand both docstrings inpython/ray/air/config.py(V1) and the V2 override inpython/ray/train/v2/api/config.pyto 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— V1ScalingConfig(the base class; documents bothtrainer_resourcesandresources_per_worker).python/ray/train/v2/api/config.py— V2ScalingConfig(subclasses V1 and overrides theresources_per_workerdocstring;trainer_resourcesis deprecated in V2 and not re-documented here).No code or behavior changes; docstrings only.
Generated with Claude Code