NumPy number crunching on dedicated servers

NumPy underpins almost every scientific Python stack. How fast it runs depends on the linear algebra library underneath, the memory bus and how threads are set, all things a dedicated machine lets you control.

What decides NumPy speed on a server?

Three things. Matrix products, decompositions and solvers go through a BLAS and LAPACK library and scale across cores. Element-wise maths such as a * b + c runs mostly in a single thread and is limited by memory bandwidth. Python loops over array elements are slow wherever they run. Knowing which of the three your code spends time in tells you whether to buy cores, memory channels or a code change.

Which BLAS library am I using?

Ask NumPy. The wheels from PyPI bundle OpenBLAS, which is fast on both AMD and Intel processors; conda packages may use other libraries. Check once on the target machine.

python3 -c "import numpy as np; np.show_config()" | sed -n '/blas/,/lapack/p'
python3 -m pip install threadpoolctl && python3 -m threadpoolctl -i numpy

How do I control BLAS threads?

With environment variables set before NumPy is imported, or threadpoolctl at run time. A single large matrix multiply should use every physical core; many small independent jobs run better as separate processes with one thread each.

export OPENBLAS_NUM_THREADS=32
python3 -c "import numpy as np, time; a=np.random.rand(8000,8000); t=time.time(); a@a; print(round(time.time()-t,2),'s')"

That 8,000 by 8,000 float64 product is about one trillion floating point operations, a handy benchmark to compare machines before a long rental.

Why do memory channels decide element-wise speed?

Most element-wise work moves more bytes than it computes. Adding two arrays of 100 million float64 values reads 1.6 GB and writes 0.8 GB for very little arithmetic. A desktop-class chip with two DDR5 channels moves this quickly for one process, but running 32 such processes at once saturates the bus. Server chips with eight or twelve channels, such as the EPYC models in our Enterprise line and the older EPYC Essentials, keep many processes fed.

WorkloadMachineMemory
Interactive analysis, fast single threadESSENTIAL-S64 GB DDR5
Analysis with larger arraysESSENTIAL-L128 GB DDR5
Parallel jobs, eight DDR4 channelsESSENTIAL-8256 GB DDR4
Bandwidth-bound batch workENTERPRISE-a4 2024128 GB DDR5

Should I use float32 or float64?

float64 is NumPy's default and the safe choice for ill-conditioned problems. float32 halves memory use and bandwidth and doubles the values per vector instruction, so if your results tolerate about seven significant digits, it nearly doubles throughput on bandwidth-bound work. Test both on real data and compare the outputs before switching.

What if an array is larger than memory?

Map it from disk. np.memmap or np.load(..., mmap_mode="r") reads only the pages you touch, and the local NVMe drives return them quickly. Process in chunks that fit in cache-friendly blocks, or move to Dask or Zarr, which split arrays into chunks and process them in parallel.

import numpy as np
x = np.load("/data/sensor_2026.npy", mmap_mode="r")
daily_peak = np.array([x[i:i+86_400].max() for i in range(0, x.shape[0], 86_400)])

How do I go beyond one process?

Run independent slices with multiprocessing or joblib, compile hot loops with Numba, or vectorise more of the code. On a ESSENTIAL-8 with 32 cores and 256 GB DDR4, 32 worker processes each with one BLAS thread often finish a sweep of independent computations in a fraction of the time of a threaded single process. That machine rents for $126.60 a month. See scikit-learn workloads, High performance computing and ECC memory explained; long numeric runs benefit from ECC memory, which every model here has.

Machines for NumPy work

Lowest monthly price of each model across its data centres; the model page shows the price in every location.

ModelProcessorCoresMemoryDrivesPortPer month
ESSENTIAL-SAMD Ryzen 7 9700X864 GB2x 512 GB SSD NVMe1 Gbps unmetered$46.20
ESSENTIAL-MAMD Ryzen 9 9900X1264 GB2x 512 GB SSD NVMe1 Gbps unmetered$70.80
ESSENTIAL-LAMD Ryzen 9 9950X16128 GB2x 960 GB SSD NVMe1 Gbps unmetered$106.20
ESSENTIAL-8AMD EPYC 753232256 GB2x 480 GB SSD SATA1 Gbps unmetered$126.60
BUSINESS-4 2026AMD EPYC 4585PX1664 GB2x 960 GB SSD NVMe3 Gbps unmetered$212.40
ENTERPRISE-a4 2024AMD EPYC GENOA 945448128 GB2x 960 GB SSD NVMe5 Gbps unmetered$460.20

Run the 8,000 by 8,000 matrix test on your code path, then pick cores or memory channels accordingly.

See all servers and prices

Related pages

scikit-learn workloads

Run scikit-learn model searches and batch scoring on dedicated cores: n_jobs, joblib backends, thread oversubscription, memory planning and model persistence.

Read more

High performance computing

Rent many-core EPYC machines for simulations and solvers: MPI process placement, memory bandwidth per core, Slurm on a small cluster and scratch disks.

Read more

ECC memory explained

Why servers use error correcting memory, how full ECC differs from DDR5 on-die ECC, and which of our machines carry which.

Read more

Cores or clock speed: which to buy

How to tell whether your software wants many cores or a few fast ones, with worked numbers from machines on our list.

Read more

Questions and answers

How do I check which BLAS library NumPy uses?

Run np.show_config() or python3 -m threadpoolctl -i numpy. PyPI wheels use OpenBLAS.

Why is NumPy only using one core?

Element-wise operations are mostly single threaded. Only BLAS-backed functions such as matrix products use several cores.

Should I use float32 to speed up NumPy?

If your results tolerate about seven significant digits, yes: it halves memory traffic and often nearly doubles throughput.

How can NumPy handle arrays bigger than RAM?

Use np.memmap or np.load with mmap_mode to read from fast NVMe drives in chunks, or move to Dask or Zarr.

Do your servers have ECC memory?

Yes. Every model has ECC or on-die ECC memory, which protects long numeric runs from silent bit errors.