
nvmath-python (Beta) is an open source library that gives Python applications high-performance pythonic access to the core mathematical operations implemented in the NVIDIA CUDA-X™ Math Libraries for accelerated library, framework, deep learning compiler, and application development.
Vendor
NVIDIA
Company Website


nvmath-python (Beta) is an open-source library that gives Python applications high-performance pythonic access to the core mathematical operations implemented in the NVIDIA CUDA-X™ Math Libraries. This library is designed for accelerated library, framework, deep learning compiler, and application development. nvmath-python provides freedom of using either stateless (function-style) or stateful (class-style) APIs, depending on how much control of expressiveness a user wants. The library also provides integration with the standard logger library to offer visibility into computational details.
Features
- Truly Pythonic Accelerated Math: nvmath-python provides pythonic host and device APIs for using the highly optimized NVIDIA math libraries in Python applications, without the need for intermediary C or C++ bindings. This allows Python applications across deep learning, data processing, and more to leverage the power of NVIDIA hardware for computations out-of-the-box.
- Interoperability With Python Ecosystem: nvmath-python works in conjunction with popular Python packages. This includes GPU-based packages like CuPy, PyTorch, and RAPIDS and CPU-based packages like NumPy, SciPy, and scikit-learn. You can keep using familiar data structures and workflows while benefiting from accelerated math through nvmath-python. In combination with Python compilers, such as Numba, you can implement device callback functions to customize nvmath-python behavior.
- High Performance: nvmath-python delivers performance comparable to the underlying C libraries. The APIs are designed for minimal overhead, allowing near-native performance for Python applications. Callbacks allow device kernels fusion without the extra overheads of a host.
- Supported Operations: nvmath-python supports advanced matrix-matrix multiplication, Fast Fourier Transforms (FFT), and other core mathematical operations. The library offers a specialized matrix multiplication interface to perform scaled matrix-matrix multiplication with predefined epilogues as a single fused kernel. This can potentially lead to significantly better efficiency. nvmath-python’s stateful APIs decompose such operations into planning, autotuning, and execution phases, which enables amortization of one-time preparatory costs across multiple executions.
Benefits
- Efficient Computations: Leverages the power of NVIDIA hardware for high-performance computations in Python applications.
- Seamless Integration: Works with popular Python packages, allowing users to maintain familiar workflows while benefiting from accelerated math.
- Enhanced Performance: Delivers near-native performance for Python applications, minimizing overhead and maximizing efficiency.
- Versatility: Supports a wide range of mathematical operations, including matrix multiplication and FFT, making it suitable for various applications.