Last active
June 3, 2024 20:42
-
-
Save woshiyyya/59477b8c7039990ccb530b55b8f0f1bc to your computer and use it in GitHub Desktop.
Minimal training script for testing train dashboard
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import ray | |
| from ray.train.torch import TorchTrainer | |
| from ray.train import RunConfig, ScalingConfig | |
| import time | |
| def train_func(): | |
| print("Training Starts") | |
| time.sleep(100) | |
| datasets = { | |
| "train": ray.data.range(100), | |
| "val": ray.data.range(100) | |
| } | |
| trainer = TorchTrainer( | |
| train_func, | |
| run_config=RunConfig( | |
| name="my_train_run", | |
| storage_path="/mnt/cluster_storage" | |
| ), | |
| scaling_config=ScalingConfig( | |
| num_workers=8, | |
| use_gpu=True | |
| ), | |
| datasets=datasets | |
| ) | |
| trainer.fit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment