Hardware

NVIDIA launches nvmath-python v1.0 for math scale

NVIDIA has launched nvmath-python v1.0, bringing high-performance CUDA-X and NVPL math libraries to Python to accelerate scientific computing across CPUs, GPUs, and distributed systems.

NVIDIA Developer Blog4 days agoHardware
Image: NVIDIA Developer Blog

NVIDIA has announced the general availability of nvmath-python v1.0, a library designed to bring high-performance mathematical operations to the Python scientific community. Serving as a Python-friendly interface for NVIDIA's CUDA-X and NVPL mathematical suites, it supports cuFFT, cuBLASLt, cuDSS, cuSPARSE, cuTENSOR, and cuBLASMp. The package allows developers to run accelerated math seamlessly across CPUs, GPUs, and distributed multi-node systems using cuSOLVERMp and cuFFTMp. It integrates natively with NumPy, CuPy, and PyTorch, facilitating easy code migration.

The library features universal APIs designed for wide compatibility across CPU backends—including NVPL for NVIDIA Grace or ARM v8 CPUs, and Intel MKL for x86 hosts—alongside dedicated APIs tailored for hardware-specific workloads. For example, its advanced matrix multiplication API optimizes the composite operation D = f(alpha * A * B + beta * C) for dense GPU operands. Additionally, nvmath-python introduces a universal sparse tensor (UST) representation via a domain-specific language, allowing users to define custom sparse formats. Detailed computational tracing is supported through Python's standard logging module, recording events at timestamps such as 2025-09-18 14:53:32,166 and 2025-09-18 15:46:22,295 to show where operations execute.

To reduce computational overhead, nvmath-python offers both stateless and stateful programming interfaces. While stateless APIs incur planning and autotuning costs on every call, stateful APIs amortize these costs over multiple executions. In a test with a feed count of 10, reusing a prepared execution plan lowered overall processing costs. Autotuning benefits vary by hardware: in a specific test, the NVIDIA RTX A6000 achieved a 256% speedup, whereas the NVIDIA B200 reached peak performance using built-in heuristics without autotuning.

For custom workflows, the library works with compilers such as numba-cuda for just-in-time compilation of custom Python code. Developers can write custom JIT-compiled FFT callbacks, such as a Gaussian image filter that filters grayscale images scaled between 0 and 1 using complex64 and float32 data types. It also supports device APIs for FFTs, GEMM, dense direct solvers like LU, Cholesky, and QR, and random number generators. For instance, a Geometric Brownian Motion simulation can use StatesPhilox4_32_10 to process 4 normal variates at a time as a float32x4 type across a chunk of 4 time steps, fusing low-intensity operations directly inside GPU kernels.

This is our own summary of reporting by NVIDIA Developer Blog

More in Hardware