Parallel experiments#
Submit several jobs, then wait for all of them. run() returns immediately, so
submission is fast.
import runcompute
rates = [1e-4, 3e-4, 1e-3]
with runcompute.Client() as client:
jobs = [
client.run(
name=f"lr-{lr}",
image="ghcr.io/acme/train:v4",
command=["python", "train.py", "--lr", str(lr)],
min_vram=24, work_units=2, budget=6,
)
for lr in rates
]
finished = [job.wait(progress=False) for job in jobs]
for lr, job in zip(rates, finished):
print(lr, job.status.value, f"${job.spend:.2f}")
Each job has its own budget. To cap the whole sweep, divide the total you are willing to spend by the number of jobs.
List what is still running:
runcompute list active