chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
cloud: {{env["ANYSCALE_CLOUD_NAME"]}}
|
||||
|
||||
# Single GPU node. The torchft linear example trains on CPU (gloo) but the
|
||||
# image ships GPU torch (torch==2.9.0+cu128), so a CUDA node is representative.
|
||||
head_node:
|
||||
instance_type: g4dn.4xlarge
|
||||
|
||||
worker_nodes: []
|
||||
@@ -0,0 +1,39 @@
|
||||
"""Hello-world release test for the torchft Ray ML image variant.
|
||||
|
||||
This is a reference test showing how to run a release test on the custom
|
||||
torchft BYOD image. The image is the core Ray CUDA image (py3.13) with the
|
||||
torchft ML dependency lock installed on top:
|
||||
|
||||
- lock: release/ray_release/byod/ml_torchft_py3.13.lock
|
||||
(generated by ci/raydepsets/configs/release_ml_torchft_tests.depsets.yaml)
|
||||
|
||||
The lock is referenced from the release test via `byod.python_depset`; the BYOD
|
||||
build installs it automatically (`uv pip install --system --no-deps -r
|
||||
python_depset.lock`), so no post_build_script is required.
|
||||
|
||||
See the matching `torchft_hello_world` entry in release/release_tests.yaml for
|
||||
the cluster wiring (byod.type / byod.python_depset).
|
||||
|
||||
The test simply proves the image works end to end: torch 2.9.0 + torchft import
|
||||
cleanly and a tiny Ray Train v2 + torchft training loop runs to completion.
|
||||
"""
|
||||
|
||||
import ray
|
||||
import torch
|
||||
import torchft # noqa: F401 -- provided by torchft-nightly in the image
|
||||
|
||||
from ray.train.v2.examples.pytorch.torchft_linear_example import train_torchft
|
||||
|
||||
|
||||
def main() -> None:
|
||||
print(f"ray=={ray.__version__} torch=={torch.__version__} torchft OK")
|
||||
|
||||
# torchft_linear_example trains a tiny linear model on CPU (gloo backend)
|
||||
# under Ray Train v2 with a torchft TorchftConfig. A short run is enough to
|
||||
# validate that the image's torch + torchft + Ray Train stack works.
|
||||
metrics = train_torchft(num_workers=2, num_steps=20)
|
||||
print(f"torchft hello world succeeded: {metrics}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user