PyTorch on dedicated CPU machines
PyTorch runs well on modern server processors when the job fits them: inference of compact models, embedding generation, evaluation runs and fine-tuning small networks. Our machines are CPU only, and these are the settings that matter.
What PyTorch work suits a CPU server?
Inference for classification, ranking, speech and small transformer models; sentence embedding generation for search; evaluation of checkpoints; data preprocessing; and training or fine-tuning networks with up to a few hundred million parameters when time is not critical. Large-scale pre-training needs accelerators, which we do not rent. Many teams split the work: train elsewhere, then serve and batch-score on rented CPUs where the cost per request is lower and capacity is fixed.
How do I install PyTorch without GPU libraries?
Use the CPU wheel index. The default Linux wheels bundle large CUDA libraries you will never load; the CPU build is far smaller and installs in seconds.
python3 -m venv /opt/torch && . /opt/torch/bin/activate pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu python -c "import torch; print(torch.__version__, torch.get_num_threads(), torch.backends.mkldnn.is_available())"
How many threads should PyTorch use?
One per physical core for a single large process, fewer per process when you run several. PyTorch defaults to the number of physical cores it sees, but containers and multiple workers confuse that guess. For a serving fleet on a 48 core machine, six processes of eight threads each, every one pinned to its own cores, usually beat one process with 48 threads.
OMP_NUM_THREADS=8 taskset -c 0-7 python serve.py --port 9101 & OMP_NUM_THREADS=8 taskset -c 8-15 python serve.py --port 9102 &
Does reduced precision help on a CPU?
Yes, on recent chips. Zen 4 and Zen 5 processors have AVX-512 bfloat16 instructions, and Xeon processors from the fourth generation onward add AMX tiles that multiply bfloat16 and int8 matrices much faster than float32. Wrap inference in autocast and check accuracy on a validation set before switching.
model.eval()
with torch.inference_mode(), torch.autocast(device_type="cpu", dtype=torch.bfloat16):
scores = model(batch)
Is torch.compile worth trying?
Often. It traces the model and generates fused CPU kernels, typically giving a noticeable speed-up for inference after a one-off compile at start-up. Compile once per process, warm it with a representative batch, then serve. Exporting to ONNX and running under ONNX Runtime is a second route that also removes Python overhead from the hot path.
Can I train across several servers?
Yes, with DistributedDataParallel and the gloo backend, which is the one designed for CPUs. Because we do not sell a private network, connect nodes with a WireGuard mesh and point the rendezvous at a tunnel address. Gradient exchange crosses the public port each step, so this scales best with larger batches and compact models.
torchrun --nnodes=2 --nproc-per-node=4 --rdzv-backend=c10d --rdzv-endpoint=10.90.0.1:29400 train.py --backend gloo
| Job | Machine | Monthly |
|---|---|---|
| Embedding generation for a search index | ESSENTIAL-L | $106.20 |
| bfloat16 inference on AMX | ENTERPRISE-i3 2024 | $432.00 |
| Newer AMX host with larger NVMe | ENTERPRISE-i2 2026 | $446.40 |
| Batch scoring and fine-tuning | ENTERPRISE-a5 2026 | $579.60 |
How do I estimate RAM for a PyTorch model?
Parameters times bytes each, plus activations and, for training, gradients and optimiser state. A 350 million parameter model takes about 0.7 GB in bfloat16 for inference, while training it with Adam in float32 needs roughly 16 bytes per parameter, about 5.6 GB, before activations. Every machine above has at least 128 GB DDR5, so memory is rarely the constraint for this class of model. Related pages: TensorFlow on CPU servers, CPU inference for AI models and NumPy number crunching.
CPU machines for PyTorch
Lowest monthly price of each model across its data centres; the model page shows the price in every location.
| Model | Processor | Cores | Memory | Drives | Port | Per month |
|---|---|---|---|---|---|---|
| ESSENTIAL-L | AMD Ryzen 9 9950X | 16 | 128 GB | 2x 960 GB SSD NVMe | 1 Gbps unmetered | $106.20 |
| ESSENTIAL-XL | AMD EPYC TURIN 9455 | 48 | 128 GB | 2x 1.92 TB SSD NVMe | 1 Gbps unmetered | $212.40 |
| ENTERPRISE-i3 2024 | Intel Xeon Gold 6438M | 32 | 128 GB | 2x 960 GB SSD NVMe | 5 Gbps unmetered | $432.00 |
| ENTERPRISE-i2 2026 | Intel Xeon 6527P | 24 | 128 GB | 2x 1.92 TB SSD NVMe | 5 Gbps unmetered | $446.40 |
| ENTERPRISE-a5 2026 | AMD EPYC TURIN 9555 | 64 | 128 GB | 2x 1.92 TB SSD NVMe | 5 Gbps unmetered | $579.60 |
Benchmark one batch size per thread count on the target machine, then scale processes out.
Related pages
TensorFlow on CPU servers
Serve and train TensorFlow models on many-core CPUs: oneDNN kernels, thread settings, TensorFlow Serving, batching and when a CPU machine is the right call.
Read moreCPU inference for AI models
Run quantised language and vision models on many-core EPYC and Xeon 6 processors with AVX-512 and plenty of DDR5.
Read moreNumPy number crunching
Speed up NumPy on dedicated hardware: BLAS backends, thread variables, memory bandwidth, float32 versus float64, memmap for big arrays and scaling past one process.
Read moreQuestions and answers
Can PyTorch run on a CPU-only server?
Yes. Install the CPU wheels from the PyTorch CPU index and set threads to match physical cores.
Do you offer GPUs for PyTorch training?
No, we rent CPU machines only. They suit inference, embeddings, evaluation and training of small models.
Does bfloat16 speed up PyTorch on CPUs?
Yes, on Zen 4 and Zen 5 chips with AVX-512 bfloat16 and on fourth generation Xeon and newer with AMX. Check accuracy first.
Which backend should distributed PyTorch use on CPUs?
gloo. Run it over a WireGuard mesh between servers, since we do not provide a private network.
Is torch.compile useful for CPU inference?
Often yes. It generates fused kernels after a one-off compile; warm it up with a sample batch before serving.