Skip to content

Instantly share code, notes, and snippets.

@woshiyyya
Last active June 3, 2024 20:42
Show Gist options
  • Select an option

  • Save woshiyyya/59477b8c7039990ccb530b55b8f0f1bc to your computer and use it in GitHub Desktop.

Select an option

Save woshiyyya/59477b8c7039990ccb530b55b8f0f1bc to your computer and use it in GitHub Desktop.
Minimal training script for testing train dashboard
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