nvmath-python Release Notes#
nvmath-python v1.0.0#
Release Summary#
The first nvmath-python GA release, with key new features including the
single-GPU and distributed dense generic direct solver, performance
improvements to the sparse generic matrix multiplication API, support for
numba-cuda-mlir for device APIs, support for NVFP4 in distributed
matrix multiplication, support for explicit batching in generic matrix
multiplication, and more. As always, we look forward to your feedback
and suggestions as we continue to improve the library to meet your needs.
New Features#
Added
nvmath.bindings for cuSOLVERMp 0.7.2 through 0.8.0.bindings. cusolverMp
Reduced stream parsing overhead in
nvmath..sparse. advanced. direct_solver()
Added
nvmath.bindings for the deprecated cuSolverSp library.bindings. cusolverSp
Added
nvmath.coverage for deprecated cuSPARSE APIs.bindings. cusparse
Added
nvmath.support for cuTENSOR 2.6.0.bindings. cutensor
Added
nvmath., a performance-optimized variant oflinalg. generic. Matmul. reset_operands_unchecked() reset_operands()that skips operand validation and logging.
Added distributed generic direct solver API including
nvmath.anddistributed. linalg. DirectSolver nvmath..distributed. linalg. direct_solver()
Added generic direct solver API including
nvmath.andlinalg. DirectSolver nvmath..linalg. direct_solver()
Added new
nvmath.option to control the layout of contraction output.tensor. ContractionOptions. result_layout
Added experimental free-threaded support on bindings
Improved thread-safety for
nvmath.. Alinalg Matmulinstance should now only be used by its creating thread.
Calling
release_operand(s)more than once is now safe across all stateful APIs; extra calls are a no-op and log an info-level message.
Added
nvmath., the metadata-based counterpart tofft. FFT. create_key_from_metadata() nvmath.. It builds an FFT key from operand metadata (fft. FFT. create_key() shape,dtype, and optionalstrides) together with amemory_space, instead of requiring a fully allocated operand. This is useful, for example, to estimate the workspace size before an operand exists. Theexecutionspace is optional and defaults tomemory_space.
Added support for explicit batching to generic matmul.
The sparse advanced direct solver has been updated to use cuDSS
v0.8.0, and hence benefits from the performance improvements and bug fixes in this version.
The device APIs now support the MLIR-based
numba-cuda-mlircompiler in addition tonumba-cuda. TheFFT,Matmul, andSolverobjects are compiler-agnostic; the compiler is selected by thecuda.jitdecorator used for the kernel. Thenvmath.APIs and the advanceddevice. random MatmulAPIs (opaque tensors, accumulators, and pipelines) remain available only withnumba-cuda.
Added the
float32x4,float64x4, anduint32x4vector types (and the corresponding*_typenumba types) tonvmath..device
The cuBLASDx
DevicePipelinenow accepts any input arrays supporting DLPack or the CUDA Array Interface.
Support DRELU and DRELU_BGRAD epilogues in distributed matrix multiplication.
Distributed matrix multiplication now registers operand B with NCCL symmetric memory whenever possible, which improves Allgather+GEMM performance.
Support for NVFP4 in the distributed matrix multiplication API.
Update
nvmath.to NVPL 26.5.bindings. nvpl. blas
The
nvmath.andsparse. Matmul nvmath.APIs now support UST operands in the CPU memory space for library dispatch as well as code generation.sparse. matmul()
Improved performance of the generic sparse matrix multiplication (SpMM) APIs (
nvmath.andsparse. Matmul nvmath.) for the code generation path with universal sparse tensor operands due to new kernel emitter capabilities.sparse. matmul()
Bugs Fixed#
Silence deprecation warnings from cupy about
cupy.cuda.ExternalStream.
Fixed a cuSPARSE handle leak which occurred when
nvmath.was called multiple times on the same instance.sparse. generic. Matmul. plan()
Fixed
nvmath.compatibility with MKL 2026.0.0.bindings. nvpl
Fixed an incorrectly sized host memory allocation in
nvmath..distributed. linalg. advanced. Matmul
Fixed an incorrect
AttributeErrorwhen reusing anvmath.with block scaling and tensor quantization scales; calling release_operands() → reset_operands() now completes without error.linalg. advanced. Matmul
Fixed
nvmath.to validate the full scale-tensor shape against the operand’s logical block-scaling shape. Previously, only the trailing two dimensions were compared, so scale tensors with permuted batch dimensions could be silently accepted.linalg. advanced. helpers. matmul. to_block_scale()
Fixed logging state leaking from one example test to another
Fixed a crash in
get_current_device_cc()caused by unpacking the 3-fieldComputeCapability.
FFTnow raises a descriptive error instead of a crypticKeyErrorwhen an incompletereal_fft_optionsdict is provided.
Exported
nvmath., which was missing from the public API.device. compile_blas_execute()
Fixed
nvmath.to convert itsdevice. compile_blas_execute() code_typeargument withparse_code_type, matching the behavior of the other device APIs.
Added the
streamargument to thenvmath.methods that were missing one.sparse. ust. Tensor
Breaking Changes#
Changed
nvmath.tobindings. cufftMp. XtSubFormat. FORMAT_FORMAT_UNDEFINED nvmath..bindings. cufftMp. XtSubFormat. FORMAT_UNDEFINED
Deprecated function
get_mxfp8_scale_offsetwas removed. Useget_block_scale_offset()instead.
reset_operand(s)now requires at least one operand to be provided across all stateful APIs; otherwise it raises aValueError.
The common algorithm type (
nvmath.) for the sparse advanced direct solver has been removed in favor of new algorithm types specific to each phase such assparse. advanced. DirectSolverAlgType nvmath.. This is a result of the changes in cuDSSsparse. advanced. DirectSolverFactorizationAlg v0.8.0.
Distributed FFT API: renamed reshape option to redistribute.
Distributed matrix multiplication API is now inplace by default when C is provided (result is stored in C).
Removed the deprecated cuBLASDx API surface from
nvmath.:device. cublasdx the
matmul()factory function (construct theMatmulclass directly instead)the
Matmulmethodsdefinition()andcreate()the
Matmulpropertiesvalue_type,input_type,output_type,shared_memory_size,filesandcodesdirect
Matmul(...)invocation, replaced byMatmul.execute(...)
Removed the deprecated cuFFTDx API surface from
nvmath.:device. cufftdx the
fft()factory function (construct theFFTclass directly instead)the
FFTmethodsdefinition()andcreate()the
FFTpropertiesrequires_workspaceandworkspace_size, together with the associated workspace supportthe
filespropertydirect
FFT(...)invocation, replaced byFFT.execute(...)
Removed the deprecated
makeproperty from the numba vector-type wrappers innvmath.. Use numba types directly.device. types
Distributed reshape has moved to
nvmath.and the API has been generalized to accept any Distribution type as input and output distribution. Note that the specific distributions that are supported depends on the capabilities of the underlying library (currently cuFFTMp).distributed. distribution. Redistribute
Support for
complex32operands in sparse matrix multiplication (nvmath.) has been removed. Passingsparse. generic. matmul() complex32operands now raises aTypeError.
The
semiringandepilogparameters to the generic sparse matrix multiplication (SpMM) plan (nvmath.) have been removed. In addition, prolog cannot be specified for thesparse. Matmul. plan() coperand. We plan to introduce comprehensive support for these in the near future.
Documentation Changes#
Distributed APIs are now described as distributed host APIs.
The device API documentation was refreshed.
The device API examples were restructured to mirror the CUDALibrarySamples layout, and
numba-cuda-mlirvariants of the examples were added.
New cuSOLVERDx examples were added, matching the cuSOLVERDx 0.3 CUDA samples.
Adopted reno as the release notes manager.
Dependency Changes#
The
numbaextra now installsnumba-cuda-mlirin addition tonumba-cuda.
The
nvmath-pythonpackage now requirescuda-core >=0.5, <2(updated fromcuda-core >=0.4.2, <1).
Known Issues#
On Windows, if both
torchandnvmath-python[cpu]are installed, there may be twolibiomp5md.dllfiles present in the environment:one shipped with
torch, andone coming from transitive dependency:
nvmath-python[cpu] -> mkl -> intel_openmp.
By default, OMP will terminate the program with an error when attempting to load both copies. As a workaround, users can:
set
KMP_DUPLICATE_LIB_OK=TRUEenvironment variable to silence the error, orremove one of the
libiomp5md.dllcopies, for instance, by uninstallingintel_openmppackage (e.g.pip uninstall intel-openmp).
Sparse matrix multiplication (
nvmath.) using the CSC format withsparse. generic. matmul() float16orbfloat16operands is not supported on newer CUDA Toolkit versions and raisescuSPARSEError NOT_SUPPORTED.
Using the
nvmath.distribution withdistributed. distributions. Box nvmath.anddistributed. fft. FFT nvmath.APIs may result in a spurious validation error. The workaround is to use an equivalentdistributed. distributions. Redistribute nvmath.distribution.distributed. distributions. Slab
Security Issues#
Added
from_numpy()andas_numpy()so that Matmul plans may be saved without pickle.
nvmath-python v0.9.0#
Beta9 release.
New universal sparse tensor (UST) and generic sparse matrix multiplication API (
nvmath.,sparse. ust nvmath.).sparse. Matmul Support for NVFP4 in the advanced matrix multiplication API, along with new helpers in
nvmath.:linalg. advanced. helpers. matmul quantize_to_fp4(),unpack_fp4(),BlockScalingFormat,to_block_scale(),get_block_scale_offset(), andexpand_block_scale().Distributed matrix multiplication API:
Support for FP8 and MXFP8 datatypes.
Support for epilogs.
Support for inplace operation.
New
release_operand(s)methods onnvmath.,fft. FFT nvmath.,linalg. advanced. Matmul nvmath.,linalg. Matmul nvmath.,tensor. BinaryContraction nvmath.,tensor. TernaryContraction nvmath.,sparse. advanced. DirectSolver nvmath.,distributed. fft. FFT nvmath., anddistributed. linalg. advanced. Matmul nvmath.for releasing operand memory while preserving the plan.distributed. reshape. Reshape New
nvmath.abstraction (distributed. ProcessGroup nvmath.,distributed. MPIProcessGroup nvmath.) for distributed APIs, allowing for initialization ofdistributed. TorchProcessGroup nvmath.with eitherdistributed mpi4pyortorch.distributed(thus makingmpi4pyoptional).nvmath.still directly accepts andistributed. initialize() mpi4pycommunicator for convenience.Added a new pip extra (numba) which installs the appropriate numba toolchain for callback APIs without installing device API dependencies.
New cuSOLVERDx device API in
nvmath.: high-level adapter classes and the lower-leveldevice nvmath.class that mimics the C++ cuSOLVERDx API. The available operations depend on the installed libmathdx version, see the supported functions table for the full list, version notes, and adapter mapping.device. Solver Bindings updated to support libmathdx 0.3.2, which extends cuSOLVERDx functionality, and brings improvements to cuBLASDx and cuFFTDx.
New experimental
reset_operand(s)_uncheckedmethods onnvmath.,linalg. advanced. Matmul nvmath.,tensor. BinaryContraction nvmath., andtensor. TernaryContraction nvmath.to minimize overhead in repeated calls, analogous todistributed. fft. FFT nvmath.which was added in v0.8.0.fft. FFT. reset_operand_unchecked() New
nvmath.free function for estimating FFT workspace size.fft. estimate_workspace_size() Added bindings for new APIs introduced in CTK version 13.2.0
Added support for more compute types in the tensor contraction API and improved property getters for
nvmath..tensor. ContractionPlanPreference Optimized internal
releaseandreset_operand(s)code paths for FFT and tensor contraction by retaining inner tensor references, reducing per-call overhead.New preference classes
nvmath.,sparse. advanced. DirectSolverPlanPreferences nvmath., andsparse. advanced. DirectSolverFactorizationPreferences nvmath.for configuring plan, factorization, and solution phases in a stateless direct sparse solver API call.sparse. advanced. DirectSolverSolutionPreferences Added Python 3.14 support.
Bugs Fixed#
Fixed in-place C2R FFT repeated execution silently producing wrong results due to the input buffer being overwritten.
Fixed some incorrectly named enums in cuFFT bindings.
pivot_eps_algorithm,pivot_eps,hybrid_device_memory_limit, andhybrid_execute_modeproperties were returning the wrong values.cuFFT status codes from CUDA 13 were missing.
FFT.create_key()andFFT.get_key()had mismatched outputs.apply_mxfp8_scale()could overflow.BinaryContractionoutputs were not fully-owned by user and were overwritten by subsequent calls toBinaryContraction.contract().cuDSS
DirectSolverrejected valid F-order matrices with shape(..., m, 1)because stride validation didn’t account for the dummy last dimension (#53).Fixed LTOIR ABI correctness for device APIs where argument names and return types did not match the libmathdx functions.
Fixed a missing synchronization for host-to-device torch tensor copy.
Fixed missing fields in the cuBLASDx Numba matmul cache key, which could lead to stale cached results.
Improved error handling for unsupported cuDSS
FactorizationInfoandPlanInfoattributes, which now raiseRuntimeErrorinstead of silently returning wrong values.Fixed
reset_operands_uncheckedsemantics for FFT to match the checked version, behaving correctly when called after releasing operands.
Breaking Changes#
Removed the dx extra. Users should continue to use the cu12-dx or cu13-dx extra for installing device API dependencies.
cuda-core >=0.4.2is now required.libmathdx >=0.3.1is now required.numba-cuda >=0.28.1is now required.cuTensor >=2.5.0is now required.cuBLASMp >=0.8.1is now required, which no longer uses NVSHMEM. This means that the NVSHMEM backend is no longer required for the distributed matrix multiplication API.The
operandparameter tonvmath.andfft. FFT nvmath.is now positional-only.distributed. fft. FFT The following cusolverDn bindings getter functions now return their value directly:
nvmath.,bindings. cusolverDn. get_math_mode() nvmath.,bindings. cusolverDn. get_emulation_strategy() nvmath.,bindings. cusolverDn. get_fixed_point_emulation_mantissa_control() nvmath.,bindings. cusolverDn. get_fixed_point_emulation_max_mantissa_bit_count() nvmath.,bindings. cusolverDn. get_fixed_point_emulation_mantissa_bit_offset() nvmath..bindings. cusolverDn. get_emulation_special_values_support() reset_operand(s)no longer acceptsNoneto release operands across all stateful APIs. The newrelease_operand(s)methods should be used instead.All parameters to
reset_operands()are now keyword-only for tensor contraction, advanced matmul, generic matmul, distributed matmul, and cuDSS direct solver.nvmath.no longer acceptsdistributed. initialize() Nonefor process group / communicator. It requires a concretenvmath.instance or mpi4py communicator.distributed. ProcessGroup
Known Issues#
cuFFT in CUDA Toolkit 12.8, 12.9 may fail to compile LTO-IR callbacks on Blackwell devices (compute capability 12.0). As a workaround, the
compute_capabilityargument innvmath.andfft. compile_prolog() nvmath.can be set tofft. compile_epilog() '50'.
nvmath-python v0.8.0#
Beta8 release.
New pipeline and supporting features for device matrix multiplication APIs that enable applications such as floating-point emulation.
Support for inplace operation in the advanced Matmul host APIs.
Support for implicit batching in the generic Matmul host APIs.
Windows support for the tensor contraction APIs.
A new experimental
nvmath.API to reduce redundant checking and minimize overhead.fft. FFT. reset_operand_unchecked() Added bindings for new APIs introduced in CTK version 13.1.
cuBLASMp bindings updated to 0.7
Bugs Fixed#
The tensor contraction API always blocked in Beta7, even if asynchronous execution (the default) was requested. This has been fixed.
Fixed the outdated references in the documentation that state the CuPy will be installed as part of nvmath-python extras. This was no longer true from Beta7 onwards.
The internal references to the tensor contraction and direct solver operands held in those objects relied on garbage collection to be released. This has been fixed, so that the references are now released when the context manager exits or when the object is explicitly freed.
A performance issue has been fixed for certain tensor contractions that involve small contraction extents along with large batch extents.
Breaking Changes#
The
transposeoption has been removed from the generic matrix multiplication qualifiers (nvmath.,linalg. GeneralMatrixQualifier nvmath.,linalg. DiagonalMatrixQualifier nvmath.,linalg. SquareMatrixQualifier nvmath.,linalg. HermitianMatrixQualifier nvmath.,linalg. SymmetricMatrixQualifier nvmath.). The transpose operation that the array library provides (linalg. TriangularMatrixQualifier a.T) should be used instead.
Known Issues#
The use of Python logging set to the debug level (
logging.DEBUG) may result in aTypeErrorwhen compiling Numba kernels.
nvmath-python v0.7.0#
Beta7 release.
This release supports CUDA 12 and CUDA 13. Support for CUDA 11 has been dropped.
New binary and ternary tensor contraction host APIs on GPU.
New generic host Matmul APIs that support dense and structured matrices (such as triangular and diagonal) on GPU and CPU.
New distributed Matmul APIs to run on multi-node/multi-GPU systems.
Support for 64-bit integer indexing for the sparse direct solver.
The FFT and Matmul device APIs are now implicitly linked in kernels and the
link=argument tonumba.cuda.jit()is no longer needed.The device APIs now use custom types that lower to NumPy (host) or Numba (device) types. As a result of this,
nvmath.anddevice. FFT. value_type nvmath.return NumPy types.device. Matmul. value_type
Bugs Fixed#
nvmath-python/#47 Fixed a “key error” bug that prevented use of complex-to-real double precision distributed FFT.
cuda-python/#852 An internal symbol table used when loading symbols from libraries was made thread-safe.
Breaking Changes#
nvmath.now requires thedistributed. initialize() backendsargument, which was introduced to support more than one communication backend (NVSHMEM, NCCL, …).The
code_typeargument was replaced by thesmargument innvmath.anddevice. FFT nvmath..device. Matmul
Deprecations#
The
nvmath.anddevice. fft nvmath.utility functions are deprecated. Usedevice. matmul nvmath.anddevice. FFT nvmath.instead.device. Matmul The Slab distribution has moved to
nvmath.anddistributed. distribution nvmath.will be removed in the future. Usedistributed. fft. Slab nvmath.instead.distributed. distribution. Slab
nvmath-python v0.6.0#
Beta6 release.
This will be the last release to support CUDA 11.
Added support for distributed R2C/C2R FFTs, along with support for non-uniform partition sizes across PEs.
The
distributionoption for distributed FFTs is now a required keyword-only argument.To enable making CuPy an optional dependency, an internal
NDBufferdatastructure was introduced that facilitates copying tensors across memory spaces and layouts. Users may notice a one-time latency for each unique layout since the copy kernel is JIT compiled and cached.Replaced internal logic with cuda-pathfinder for locating libraries and components.
Bugs Fixed#
The
nvmath.method in the advanced Matmul APIs may not have selected the best kernel, since the L2-cache wasn’t cleared.linalg. advanced. Matmul. autotune() The return status of an internal call to a CUDA API wasn’t checked, resulting in a misleading error regarding memory limit.
Fixed a use-after-free issue with the batched direct sparse solver.
Fixed a deadlock that may occur in certain circumstances during distributed FFT.
Added appropriate constraints for cuda-bindings based on the CTK version.
Fixed missing logging messages when a Python logger was not created with
force=True.
Known Issues#
The minimum supported versions for CuPy and PyTorch are out-of-date and will be increased in the next release.
An internal symbol table used when loading symbols from libraries needs to be made thread-safe. This will be done in the next release.
nvmath-python v0.5.0#
Beta5 release.
New single-GPU and hybrid CPU-GPU sparse direct solver APIs supporting SciPy, CuPy, and PyTorch.
Known Issues#
Python overhead for matmul host-APIs has increased since v0.3.0 by 21 microseconds on average. We are investigating.
CUDA 12.8.0, 12.8.1 and 12.9.0 have been known to miscompile cuBLASDx in some rare slow-path cases (see cuBLASDx for more details).
nvmath-python v0.4.0#
Beta4 release.
New distributed FFT APIs to run on multi-node/multi-GPU systems.
New device matrix multiplication tensor API to enable advanced techniques such as cooperative copy and floating-point emulation using integer tensor cores.
Transition from CuPy to cuda-python (cuda.core) for core CUDA constructs.
Bugs Fixed#
FFT prolog or epilog fails to compile on
SM >= 100.
Known Issues#
Python overhead for matmul host-APIs has increased since v0.3.0 by 21 microseconds on average. We are investigating.
nvmath-python v0.3.0#
Beta3 release.
FP8 and MXFP8 support for the advanced matrix multiplication API.
Notebook to illustrate use of FP8 and MXFP8 in the advanced matrix multiplication API.
Added bindings for new APIs introduced in CTK version 12.8.
Bugs Fixed#
The advanced matrix multiplication API may return an incorrect result when a bias vector is used along with 1-D A and C operands.
API Changes#
The
last_axis_sizeoption innvmath.is removed in favor offft. FFTOptions last_axis_parityto better reflect its semantics.
nvmath-python v0.2.1#
Beta2 update 1 with improved diagnostics, testing enhancements, and bug fixes.
New tests for batched epilogs and autotuning with epilogs for the advanced matrix multiplication APIs.
Added more hypothesis-based tests for host APIs.
Improved algorithm for detecting overlapping memory operands for certain sliced tensors, thereby supporting such layouts for FFTs.
Added bindings for new APIs introduced in CTK versions 12.5 and 12.6.
Further coding style fixes toward meeting PEP8 recommendations.
Clarified batched semantics for matrix multiplication epilogs in the documentation.
Code snippets in API docstrings are now tested.
Bugs Fixed#
C2R FFT may fail with “illegal memory access” on sliced tensors.
Improved diagnostics to detect incompatible combinations of scale and compute types for matrix multiplication, that previously may have resulted in incorrect results.
Matrix multiplication provided incorrect results when operand A is a vector (number of dimensions=1).
API Changes#
The
last_axis_sizeoption innvmath.is now deprecated in favor offft. FFTOptions last_axis_parityto better reflect its semantics.
Note
Deprecated APIs will be removed in the next release.
nvmath-python v0.2.0#
Beta2 release.
CPU execution space support for FFT libraries that conform to FFTW3 API (for example MKL, NVPL).
Support for prolog and epilog callback for FFT, written in Python.
New device APIs for random number generation.
Notebooks to illustrate use of advanced matrix multiplication APIs.
Introduced hypothesis-based tests for host APIs.
Reduced Python overhead in
executemethods.
Bugs Fixed#
Matrix multiplication may fail with “illegal memory access” for K=1 with DRELU and DGELU epilogs.
Packaging#
Added support for NumPy 2.
Removed Python 3.9 support.
Patching changes and pynvjitlink version.
Known issues#
When
compute_typeargument ofnvmath.is set tolinalg. advanced. Matmul COMPUTE_16F, an incompatible default forscale_typeis chosen, resulting in incorrect results for CTKs older than 12.6 and an error for CTK 12.6 and newer. As a workaround we recommend setting bothcompute_typeandscale_typein a compatible manner according to supported data types table.
nvmath-python v0.1.0#
Initial beta release, with single-GPU support only.
FFT APIs based on cuFFT.
Specialized matrix multiplication APIs based on cuBLASLt.
Device APIs for FFT and matrix multiplication based on the MathDx libraries.
The required and optional dependencies are summarized in the cheatsheet.
Limitations:
Many matrix multiplication epilogs require CTK 11.5+, and a few require CTK 11.8+. Refer to cuBLAS Release Notes for more details.
Disclaimer#
nvmath-python is in a Beta state. Beta products may not be fully functional, may contain errors or design flaws, and may be changed at any time without notice. We appreciate your feedback to improve and iterate on our Beta products.