Skip to content

[release] Move GPU train release tests to Python 3.14 on the ray-torch image - #65706

Closed
elliot-barn wants to merge 9 commits into
masterfrom
elliot-barn/py314-release-tests
Closed

elliot-barn wants to merge 9 commits into
masterfrom
elliot-barn/py314-release-tests

Conversation

@elliot-barn

Copy link
Copy Markdown
Collaborator

Description

Incremental follow-up to #65114, which added the anyscale/ray-torch release-test
image (py3.14, cu12.8) and the torch-cu128 BYOD type but only wired a single test
(torch_local_mode_ray_torch, frequency: manual) onto it.

This PR moves existing GPU training release tests from the Python 3.10 ray-ml
BYOD image to the Python 3.14 ray-torch image, in batches, running each batch
through the release pipeline before adding the next.

ray-ml is not built for Python versions above 3.10, so ray-torch is its
replacement for GPU release testing on newer interpreters. Moving these tests is how
we get real Python 3.14 signal for Ray Train.

Batch 1 — tests that need nothing beyond the image

test frequency compute
air_benchmark_torch_mnist_gpu_4x4 weekly 4x g4dn.12xlarge
train_async_checkpointing_validation_benchmark nightly g4dn.xlarge x2-4
train_preemption_benchmark nightly g4dn.xlarge x8-10
train_elastic_e2e_with_node_killing weekly g4dn.12xlarge x1-4

These four import only torch / torchvision / torchmetrics, all of which
python/deplocks/ray-torch/ray-torch-cu128_base_py3.14.lock already provides
(torch==2.10.0+cu128), so no python_depset or post_build_script is needed.
Frequencies are unchanged.

Tests deliberately not in batch 1: torch_lightning, huggingface_transformers
and huggingface_accelerate need lightning / accelerate / evaluate, and
training_ingest_benchmark needs torchrec - none of which are in the ray-torch
lock. Those need a python_depset and will come in a later batch.

Related issues / duplicate check

Not a duplicate. gh pr list --repo ray-project/ray --state open --search "torch-cu128"
and a search for open PRs moving release tests to Python 3.14 return nothing
overlapping. #63270 was a closed [DO NOT MERGE] branch used to survey which release
tests pass on 3.14; this PR lands that coverage for real, one reviewable batch at a
time.

Checks

bazel test //release:test_config
//release:test_config                                                    PASSED in 10.9s

Release-pipeline run for the four batch-1 tests: linked in a comment below once it
completes. This PR stays in draft until that run is green.

AI assistance (Claude Code) was used to prepare this change.

Flip four GPU training release tests from the Python 3.10 ray-ml BYOD
image to the Python 3.14 anyscale/ray-torch image (byod type
torch-cu128), which is the ray-ml replacement on Python versions where
the ml image is not built.

  - air_benchmark_torch_mnist_gpu_4x4
  - train_async_checkpointing_validation_benchmark
  - train_preemption_benchmark
  - train_elastic_e2e_with_node_killing

These four only import torch / torchvision / torchmetrics, all of which
the ray-torch lock already provides (torch 2.10.0+cu128), so no
python_depset or post_build_script is needed. Frequencies are unchanged.

Verified with: bazel test //release:test_config

Signed-off-by: elliot-barn <[email protected]>
…on 3.14

Adds a shared ML dependency layer for release tests running on the
anyscale/ray-torch image and moves three more Train tests onto it:

  - torch_lightning
  - huggingface_transformers
  - huggingface_accelerate

The ray-torch image only carries the torch stack, not the rest of what
ray-ml shipped, so these three need `lightning`, `accelerate` and
`evaluate` layered on top. New depset
`ci/raydepsets/configs/release_ray_torch_tests.depsets.yaml` expands the
ray-torch base image deps with those three, constrained to the ray-torch
base lock so torch and friends stay pinned to exactly what the image
already installs (torch 2.10.0+cu128, transformers 4.57.6, numpy 2.4.6).
The result is consumed via `byod.python_depset`, which the BYOD build
installs automatically with `uv pip install --system --no-deps`.

torch_lightning drops its `post_build_script`: the lock now supplies
lightning (2.6.5), so byod_pytorch_lightning_test.sh (which pinned the
mid-2024 lightning==2.4.0) is no longer needed.

Recompiling this config leaves the ancestor locks (ray_img_py314,
ray-torch-cu128 base) byte-identical.

Verified with: bazel test //release:test_config
                            //release:test_custom_byod_build_init_helper

Signed-off-by: elliot-barn <[email protected]>
Moves the remaining image-classification Train benchmarks and the local
mode test to the Python 3.14 ray-torch image:

  - training_ingest_benchmark-task=image_classification
  - training_ingest_benchmark-task=image_classification-heterogenous_fixed_size
  - training_ingest_benchmark-task=image_classification-heterogenous_autoscaling
  - training_ingest_benchmark-soak_test
  - torch_local_mode

These exercise Ray Data and Ray Train together, which is the coverage the
earlier batches did not reach.

No python_depset is needed. The benchmark suite imports torchrec, but only
on the recsys code path (train_benchmark.py imports it inside a
`task == "recsys"` branch); the image-classification path needs just
torch / torchvision / pyarrow / boto3 / pydantic, all of which the
ray-torch base lock already provides.

training_ingest_benchmark-task=recsys is deliberately left on Python 3.10
and the ray-ml image: it is `frequency: manual` and installs torchrec via
byod_install_torchrec.sh, which has no Python 3.14 equivalent.

torch_local_mode is effectively pre-verified -- torch_local_mode_ray_torch
is the same script and compute at py3.14 on torch-cu128, and it passed in
release build 103115. That variant becomes redundant once this lands and
should be removed in the final PR.

Verified with: bazel test //release:test_config

Signed-off-by: elliot-barn <[email protected]>
The three training_ingest_benchmark entries moved to torch-cu128 in the
previous commit still carried "# 'type: gpu' means: use the 'ray-ml'
image." directly above `type: torch-cu128`. Update the comment to
describe the image the tests now actually use.

Signed-off-by: elliot-barn <[email protected]>
Carries the fix from #65757 so this branch's release builds can rebuild the
base-extra layer. Google's cloud-sdk apt repo no longer publishes
google-cloud-sdk, so any cache-missing rebuild fails with exit code 100.

Drop this commit once #65757 lands on master.

Signed-off-by: elliot-barn <[email protected]>
Reverts the batch 3 flip for training_ingest_benchmark-task=image_classification
and its -heterogenous_fixed_size / -heterogenous_autoscaling siblings. They hit a
Ray Data race on Python 3.14 that does not occur on the py3.10 ray-ml image.

SplitCoordinator.stats() returns the live executor stats object
(StreamingExecutor.get_stats: "The stats object will be updated as streaming
execution progresses"). Returning it across an actor boundary makes Ray pickle
it, and the pickler walks DatasetStats.metadata['Map(map_fn)'] -- a list of
BlockStats that grows as blocks complete -- while the executor appends to it:

  ray::SplitCoordinator.stats()
    -> cloudpickle dumps -> super().dump(obj)
  RuntimeError: list changed size during iteration

Reproduced twice each (release builds 105430 and 105432) on
skip_training.parquet, skip_training.jpeg.local_fs and
skip_training.parquet.fault_tolerance; the last presented as lost workers in the
first run and as the serialization error in the second, so it is the same bug.
All three pass on master nightlies on py3.10.

The rest of the flip stays: batches 1 and 2, torch_local_mode and the soak test
remain on py3.14 / torch-cu128 (24 distinct tests verified green).

Signed-off-by: elliot-barn <[email protected]>
Completes the previous commit by reverting the whole image_classification
group rather than only the variations observed failing. soak_test runs the
same workload (train_benchmark.py --task=image_classification
--dataloader_type=ray_data), so it is exposed to the same Ray Data stats race;
keeping it on py3.14 would leave one member of the group on a different image
for no reason other than that its 12h run had not finished yet.

torch_local_mode stays on py3.14: it runs torch_local_mode_launcher.py, not the
ingest benchmark workload.

Signed-off-by: elliot-barn <[email protected]>
@elliot-barn
elliot-barn marked this pull request as ready for review August 28, 2026 16:30
@elliot-barn
elliot-barn requested review from a team as code owners August 28, 2026 16:30
@elliot-barn elliot-barn changed the title [release][DO NOT MERGE] Move GPU train release tests to Python 3.14 on the ray-torch image [release] Move GPU train release tests to Python 3.14 on the ray-torch image Aug 28, 2026

@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 updates several Ray Train release tests to run on Python 3.14 with CUDA 12.8, introduces a new dependency set configuration for these tests, and updates the base Dockerfile to use google-cloud-cli instead of google-cloud-sdk. Feedback on the changes highlights an issue in the dependency set configuration where --index is used instead of --extra-index-url, which would cause compilation errors and prevent PyPI packages from being resolved.

@elliot-barn

Copy link
Copy Markdown
Collaborator Author

Verification status

All three batches have now been run in the release pipeline, and the coverage gaps from the earlier runs are closed.

Batch Build Result
1 — pure-torch GPU train tests 105254 4/4 passed
2 — Lightning + HuggingFace (via the ray_torch_ml_314 depset) 105263 3/3 passed
3 — Ray Data ingest benchmarks 105267 6 passed, but the filter only matched 6 of the entry's 27 expanded tests
3 — the 23 tests batch 3 missed, plus air_benchmark_torch_mnist_gpu_4x4.gce 105430 19/23 passed
rerun of the 3 non-infra failures 105432 3/3 failed again

Of the training_ingest_benchmark-task=image_classification group's 27 expanded tests, 24 passed on py3.14 and 3 failed reproducibly. That includes training_ingest_benchmark-soak_test, which ran the full 12.1h (724 min, exit 0) on the ray-torch image.

Why the ingest benchmarks are going back to Python 3.10

Three tests fail on py3.14 and pass on master's py3.10 nightlies (builds 105208 / 105309 / 105362 / 105400) and weekly (105401):

  • training_ingest_benchmark-task=image_classification.skip_training.parquet
  • training_ingest_benchmark-task=image_classification.skip_training.jpeg.local_fs
  • training_ingest_benchmark-task=image_classification.skip_training.parquet.fault_tolerance

Each failed twice, in both 105430 and 105432. The root cause is the same for all three — it is a Ray Data race, not a py3.14 packaging or ABI problem:

ray::SplitCoordinator.stats()
  -> ray/_private/serialization.py: cloudpickle.dumps(value, protocol=5, buffer_callback=...)
  -> cloudpickle.py:1544 dumps -> :1313 cp.dump(obj) -> super().dump(obj)
RuntimeError: list changed size during iteration

when serializing dict item 'parents' / list item 0
  -> ray.data._internal.stats.DatasetStats object -> state
  -> dict item 'metadata' -> dict item 'Map(map_fn)'

SplitCoordinator.stats() returns self._current_executor.get_stats(), and StreamingExecutor.get_stats is documented as returning a live object: "The stats object will be updated as streaming execution progresses." DatasetStats.metadata is StatsDict = Dict[str, List[BlockStats]], so metadata['Map(map_fn)'] is a list that grows as blocks complete. Returning it across an actor boundary forces Ray to pickle it, and the pickler walks that list while the executor appends to it — the job logs show Map(map_fn): Tasks: 150 still in flight when it raises.

It is timing-dependent, which is why it does not reproduce on py3.10 and why sibling variations on the identical path (preserve_order, torch_dataloader, slow_consumer) pass. skip_training.parquet.fault_tolerance presented as lost workers with A worker health check failed / Connection reset by peer in 105430 and as the serialization error in 105432 — same bug, caught at a different layer.

The whole training_ingest_benchmark group is therefore staying on py3.10 / byod: gpu for now, including the soak test: pinning only the variations observed failing would encode a distinction that the evidence does not support, since the passing siblings run the same code path.

What remains flipped to py3.14 / torch-cu128

air_benchmark_torch_mnist_gpu_4x4 (aws + gce), train_async_checkpointing_validation_benchmark, train_preemption_benchmark, train_elastic_e2e_with_node_killing.aws, torch_lightning, huggingface_transformers, huggingface_accelerate, torch_local_mode.

Eight of these are verified green. The exception is air_benchmark_torch_mnist_gpu_4x4.gce, which failed for an unrelated infrastructure reason — OSError: [Errno 28] ... '/mnt/cluster_storage/ray_train_run-...': No space left on device during Ray Train storage init on the staging GCE cloud. Its .aws twin passes on the same image and commit, the traceback is before any training code runs, and prepare_return_codes: [0], so this is the cloud's shared volume being full rather than anything about py3.14.

Validation

$ python -c "parse_test_definition(release_tests.yaml)"     # 335 expanded tests, parses clean
  image_classification workload still on 3.14: none
$ validate_test + validate_byod_type over all 149 BYOD tests -> no errors

validate_byod_type is the check that matters here: it enforces torch-cu128 implies Python 3.14 and gpu implies 3.10, so a half-reverted entry cannot pass.

Note for reviewers

This branch temporarily carries [ci][docker] Install google-cloud-cli in base-extra, which is #65757 against master. It is only here so this branch's images can rebuild the base-extra layer; it should be dropped once #65757 lands.

AI assistance was used for the failure triage, the root-cause analysis from the Buildkite and Anyscale job logs, and the release-pipeline runs above. Every changed line was reviewed and every result quoted here comes from a build linked in this comment.

@ray-gardener ray-gardener Bot added train Ray Train Related Issue release-test release test labels Aug 28, 2026
Keeps the Python 3.10 entries as the ones that actually run, and adds a
_ray_torch copy of each on python 3.14 / byod torch-cu128 with
frequency: manual, so the py3.14 coverage stays runnable on demand instead of
being deleted while the Ray Data stats race is outstanding.

Every frequency is forced to manual, including the per-variation overrides:
the source entries set weekly/manual on individual variations, so copying them
unchanged would have left those variations running automatically.

Each copy carries a TODO to restore the original frequencies and drop the
py3.10 entry once SplitCoordinator.stats() no longer serializes the live
executor DatasetStats while the executor appends to metadata['Map(map_fn)'].

Adds 27 manual tests: image_classification (22 variations),
-heterogenous_fixed_size (2), -heterogenous_autoscaling (2) and soak_test (1).

Signed-off-by: elliot-barn <[email protected]>
This reverts commit 99fdf98. The ingest benchmarks are moving to a smaller
Python bump instead of keeping py3.14 copies around.

Signed-off-by: elliot-barn <[email protected]>
elliot-barn added a commit that referenced this pull request Sep 1, 2026
…65775)

## What

Switches the `training_ingest_benchmark` image_classification entries
from `byod: gpu` (the py3.10 `ray-ml` image) to `torch-cu128` on Python
3.11 — the image added in #65774.

| Entry | Expanded tests |
|---|---|
| `training_ingest_benchmark-task=image_classification` | 22 |
| `...-heterogenous_fixed_size` | 2 |
| `...-heterogenous_autoscaling` | 2 |
| `training_ingest_benchmark-soak_test` | 1 |

**27 expanded tests.** Also relaxes `validate_byod_type` (`torch-cu128`
was pinned to Python 3.14, now accepts 3.11 or 3.14) and adds a py3.11
image-name assertion.

**Stacked on #65774**, which builds the image this points at and must
merge first. This branch also carries a temporary cherry-pick of #65757
(`google-cloud-cli` in base-extra); without it the release build cannot
rebuild the `base-extra` layer at all. Drop that commit once #65757
lands.

## Why 3.11 rather than 3.14

These are the tests that hit a Ray Data race on Python 3.14:
`SplitCoordinator.stats()` serialises a live `DatasetStats` while the
executor appends to `metadata['Map(map_fn)']`, failing with
`RuntimeError: list changed size during iteration`. Reproduced twice
each on `skip_training.parquet`, `skip_training.jpeg.local_fs` and
`skip_training.parquet.fault_tolerance` (release builds 105430 and
105432), against 24 of the group's 27 tests passing on py3.14 and all of
them passing on master's py3.10 nightlies.

The py3.11 ray-torch image carries `torch 2.9.0+cu128` — taken from
`requirements_compiled_py3.11.txt`, the same version the py3.10 `ray-ml`
image runs. So this change moves the Python version and the image while
holding torch fixed, which is what makes the result interpretable.

## Dependency check

Everything these tests need is in
`python/deplocks/ray-torch/ray-torch-cu128_base_py3.11.lock`: `torch`,
`torchvision`, `transformers`, `datasets`, `daft`,
`sentence-transformers`. No `python_depset` or `post_build_script`
required.

Two differences worth knowing, both inherited from Ray's compiled pins
(details in #65774): `torchmetrics` is 0.10.3 rather than 1.9.0, and
`langchain-text-splitters` is absent on 3.11. Neither is imported by
these benchmarks.

`training_ingest_benchmark-task=recsys` deliberately stays on `ray-ml` —
it imports torchrec via `byod_install_torchrec.sh`, which is not in the
ray-torch lock. The other 43 `byod: gpu` entries are untouched.

## Testing

```
$ python -m pytest release/ray_release/tests/test_test.py release/ray_release/tests/test_config.py -q
  54 passed

$ parse_test_definition + validate_test + validate_byod_type over all tests
  validation errors: none
  py3.11  torch-cu128    27 tests
  py3.10  gpu            64 tests   (unchanged, incl. recsys)
```

The release run is the real verification, and it is also the only thing
that builds `ray-torch.py3.11.cu12.8.1-cudnn.base` —
`buildkite/microcheck` contains no ray-torch image jobs. Results will be
posted here.

## Known conflict

#65706 moves the same entries to py3.14 / `torch-cu128`. Whichever lands
second needs a rebase; if this one lands, that PR's ingest portion
becomes redundant.

## AI assistance

AI assistance was used for the swap, the validator change, the
dependency check and the failure triage referenced above. Every changed
line was reviewed and every command shown was run with its output
confirmed.

Release test run: https://github.com/ray-project/ray/pull/65775/changes

---------

Signed-off-by: elliot-barn <[email protected]>
nadongjun pushed a commit to nadongjun/ray that referenced this pull request Oct 6, 2026
…ay-project#65775)

## What

Switches the `training_ingest_benchmark` image_classification entries
from `byod: gpu` (the py3.10 `ray-ml` image) to `torch-cu128` on Python
3.11 — the image added in ray-project#65774.

| Entry | Expanded tests |
|---|---|
| `training_ingest_benchmark-task=image_classification` | 22 |
| `...-heterogenous_fixed_size` | 2 |
| `...-heterogenous_autoscaling` | 2 |
| `training_ingest_benchmark-soak_test` | 1 |

**27 expanded tests.** Also relaxes `validate_byod_type` (`torch-cu128`
was pinned to Python 3.14, now accepts 3.11 or 3.14) and adds a py3.11
image-name assertion.

**Stacked on ray-project#65774**, which builds the image this points at and must
merge first. This branch also carries a temporary cherry-pick of ray-project#65757
(`google-cloud-cli` in base-extra); without it the release build cannot
rebuild the `base-extra` layer at all. Drop that commit once ray-project#65757
lands.

## Why 3.11 rather than 3.14

These are the tests that hit a Ray Data race on Python 3.14:
`SplitCoordinator.stats()` serialises a live `DatasetStats` while the
executor appends to `metadata['Map(map_fn)']`, failing with
`RuntimeError: list changed size during iteration`. Reproduced twice
each on `skip_training.parquet`, `skip_training.jpeg.local_fs` and
`skip_training.parquet.fault_tolerance` (release builds 105430 and
105432), against 24 of the group's 27 tests passing on py3.14 and all of
them passing on master's py3.10 nightlies.

The py3.11 ray-torch image carries `torch 2.9.0+cu128` — taken from
`requirements_compiled_py3.11.txt`, the same version the py3.10 `ray-ml`
image runs. So this change moves the Python version and the image while
holding torch fixed, which is what makes the result interpretable.

## Dependency check

Everything these tests need is in
`python/deplocks/ray-torch/ray-torch-cu128_base_py3.11.lock`: `torch`,
`torchvision`, `transformers`, `datasets`, `daft`,
`sentence-transformers`. No `python_depset` or `post_build_script`
required.

Two differences worth knowing, both inherited from Ray's compiled pins
(details in ray-project#65774): `torchmetrics` is 0.10.3 rather than 1.9.0, and
`langchain-text-splitters` is absent on 3.11. Neither is imported by
these benchmarks.

`training_ingest_benchmark-task=recsys` deliberately stays on `ray-ml` —
it imports torchrec via `byod_install_torchrec.sh`, which is not in the
ray-torch lock. The other 43 `byod: gpu` entries are untouched.

## Testing

```
$ python -m pytest release/ray_release/tests/test_test.py release/ray_release/tests/test_config.py -q
  54 passed

$ parse_test_definition + validate_test + validate_byod_type over all tests
  validation errors: none
  py3.11  torch-cu128    27 tests
  py3.10  gpu            64 tests   (unchanged, incl. recsys)
```

The release run is the real verification, and it is also the only thing
that builds `ray-torch.py3.11.cu12.8.1-cudnn.base` —
`buildkite/microcheck` contains no ray-torch image jobs. Results will be
posted here.

## Known conflict

ray-project#65706 moves the same entries to py3.14 / `torch-cu128`. Whichever lands
second needs a rebase; if this one lands, that PR's ingest portion
becomes redundant.

## AI assistance

AI assistance was used for the swap, the validator change, the
dependency check and the failure triage referenced above. Every changed
line was reviewed and every command shown was run with its output
confirmed.

Release test run: https://github.com/ray-project/ray/pull/65775/changes

---------

Signed-off-by: elliot-barn <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-test release test train Ray Train Related Issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants