Syncing datasets across clusters
cluv sync can also replicate datasets to every cluster listed in your Cluv config.
Configure dataset sync in pyproject.toml
Add data_source and datasets_path under [tool.cluv]:
pyproject.toml
[tool.cluv]
# Source cluster and source path (`hostname:/path`).
data_source = "mila:/network/datasets/cifar10.var/cifar10_torchvision"
# Destination path used on each cluster (can use env vars like $SCRATCH).
datasets_path = "$SCRATCH/datasets/cifar10"
data_sourceis where Cluv pulls the dataset from.datasets_pathis where Cluv stores it on each cluster.
You can override datasets_path per cluster:
Using a local path as the data source
If your dataset is already on the machine where you run cluv sync, you can point
data_source directly at a local path (no hostname: prefix):
[tool.cluv]
# Local path — no hostname prefix.
data_source = "/data/datasets/cifar10"
# Destination path on each cluster.
datasets_path = "$SCRATCH/datasets/cifar10"
Cluv will skip the remote-pull step and push the local directory straight to every configured cluster.
Login to clusters (including the source)
Before syncing, create reusable SSH connections:
If your source is mila:..., make sure the mila connection exists (for example cluv login mila).
Run sync
With dataset sync enabled (default), Cluv will:
- Pull data from
data_sourceto your local/current clusterdatasets_path(remote source only). - Push that dataset to each target cluster at its configured
datasets_path.
Optional: skip dataset replication for one run
If you need to skip the dataset replication step, specify: