Train PyTorch on every GPU you can reach.
One Trainer, from your laptop to many machines. GPUlayer picks the machines and GPUs, starts every process and brings back logs, checkpoints and metrics.
Benchmarks
GPUlayer Trainer against PyTorch Lightning
Same model, data and optimizer, each trainer's defaults. Faster in 27 of 31 GPU cases and every CPU case; slower on a CNN on one GPU of one host and on a CNN across machines. Every number has a script and a log.
- Tesla T4
- 1.08 to 1.38x per step; fp32, bf16, fp16 and torch.compile
- 4x RTX 3070 (PCIe)
- 1.45 to 1.60x on 2 and 4 GPUs; 1.12x slower on one GPU with a CNN
- 8 machines, 1x T4 each (NCCL)
- MLP 1.08 to 1.29x faster; CNN 1.01 to 1.09x slower
- 2x A100 SXM4 (NVLink)
- DDP over NCCL and NVLink; CUDA checks passed
- 4x L4, H200, RTX PRO 6000
- test suite and GPU checks passed; FP8, notebooks and exact resume on L4s
- 1 to 4 L4s, 1 and 2 H200s
- 1.04 to 2.50x faster in all 14 cases; FSDP, DeepSpeed, tensor parallel on one machine
- Apple M2 Pro
- 1.02 to 1.80x on the GPU and the CPU
Capabilities
What you get
A complete training API
Module, DataModule, hooks, callbacks, loggers, profilers and a CLI, with DDP, FSDP, DeepSpeed and tensor parallelism behind one Trainer.
One Trainer, any scale
The same script runs in your process, as DDP on every GPU of a machine, or across machines with Trainer(num_nodes=N). DDP, FSDP and DeepSpeed are validated on GPUs.
Placed where it trains fastest
A run goes only to machines that can train it, on their best-connected GPUs, in one rack or zone when possible. Otherwise it is rejected with a reason per machine.
Every GPU you can reach
Laptops, workstations and servers that join with one command, cloud GPUs on AWS and Vast.ai that join the same way, and Google Cloud VMs created for a run. NVIDIA CUDA and Apple Metal are validated.
Logs, checkpoints, metrics
Logs stream while training runs. Checkpoints and metrics come back to your machine, and a dashboard lists every run. With max_attempts, a run that loses a machine restarts from its newest checkpoint.
Your own loop works too
Any training script runs anywhere with two launch() lines; Runtime handles device, DDP and precision in a custom loop.
How it works
Your script, the machines you can reach
The Trainer asks the control plane for machines that can run it; workers on those machines start every process and send back logs, checkpoints and metrics. One command turns a machine into a server the others join.
Dashboard
Every run and every machine, in one place
gpulayer up serves a dashboard: jobs and their placement, per-rank logs while training runs, the workers with their GPUs, and the reason when a job fails.
Before and after
Training with and without GPUlayer
| Without | With GPUlayer | |
|---|---|---|
| Code on a laptop, GPUs elsewhere | ssh, copy code, rebuild the environment, copy checkpoints back | python train.py --target remote |
| Several GPUs in one machine | torchrun with the right process count and visible devices | Trainer(devices=4) |
| Several machines | torchrun on every node with matching ranks, address and port | Trainer(num_nodes=2, devices=4) |
| An existing PyTorch DDP script | a cluster scheduler or manual torchrun to leave one machine | glt.launch() at the top, the rest unchanged |
With one GPU on the machine you are using, a plain training loop is simpler. Jobs are not sandboxed, so GPUlayer is for people who trust each other. When to use it
Try it on your own machines
Install with curl -fsSL https://gpulayer.dev/install.sh | sh and train one file in your process, with DDP and on two nodes, in about ten minutes.