Registry / ai-ml / nvidia-cudnn-frontend

nvidia-cudnn-frontend

JSON →
library1.27.0pypypi✓ verified 23d ago

The `nvidia-cudnn-frontend` is a Python library that provides a high-level, user-friendly API to interact with the cuDNN deep learning library backend. It facilitates the creation and execution of optimized tensor operations, including various fusions and custom kernels, specifically designed for NVIDIA GPUs. It is currently at version 1.22.1 and maintains an active release cadence, often aligning with new cuDNN backend releases.

pip install nvidia-cudnn-frontend
INSTALL
IMPORT
SIG · NVIDIA-CUDNN-FRONT
N
nvidia-cudnn-frontend
ai-mlpythonv1.27.0
Install
3.1s avg
Import
104ms
Disk
48MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.27.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.1s · import 0.104s · 46MB
48MB installed
● package 48MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

cudnn
import cudnn
import cudnn_frontend

This quickstart demonstrates how to initialize cuDNN frontend, define input tensors, create a convolution operation within a graph, build and execute the graph, and retrieve the output using PyTorch tensors on a CUDA-enabled GPU.

import cudnn_frontend import torch # Ensure CUDA device is available if not torch.cuda.is_available(): raise RuntimeError("CUDA is not available. This library requires a CUDA-enabled GPU.") # Example: Create and execute a simple convolution graph # Define input and weight tensors on CUDA x = torch.randn(1, 1, 28, 28, device="cuda", dtype=torch.float32) w = torch.randn(16, 1, 3, 3, device="cuda", dtype=torch.float32) # Create a cuDNN frontend graph graph = cudnn_frontend.create_graph({"fp8_mode": False}) # fp8_mode can be set to True for FP8 operations # Make input tensors for the graph from PyTorch tensors X = graph.make_input_tensor( "X", cudnn_frontend.DataType.FLOAT, x.shape, x.stride() ) W = graph.make_input_tensor( "W", cudnn_frontend.DataType.FLOAT, w.shape, w.stride() ) # Define a convolution operation Y = graph.make_convolution( X, W, padding=[1, 1], stride=[1, 1], dilation=[1, 1] ) # Mark the output tensor Y.set_output() # Build the operation graph, create execution plans, and check support graph.build_operation_graph() graph.create_execution_plans( [cudnn_frontend.heur_mode.A, cudnn_frontend.heur_mode.FALLBACK] ) graph.check_support() graph.build_plans() # Allocate the output tensor on CUDA y_out = torch.empty(Y.get_output_tensors()[0].get_dim(), device="cuda", dtype=torch.float32) # Execute the graph graph.execute([x, w], [y_out]) print("Graph execution successful!") print(f"Output tensor shape: {y_out.shape}")
Debug
Known issues
breakingThe `nvidia-cudnn-frontend` Python package requires a compatible installation of the NVIDIA CUDA Toolkit and the cuDNN native C++ library on the system. Installing the Python package alone is insufficient for functionality.
fix
Ensure that the NVIDIA CUDA Toolkit and a supported version of the cuDNN backend library are correctly installed and configured on your system (e.g., `LD_LIBRARY_PATH` or system paths). Consult the official cuDNN documentation for installation instructions and compatibility matrix.
affects: All versions
gotchaSpecific `nvidia-cudnn-frontend` versions are often recommended for particular `cuDNN` backend and `CUDA Toolkit` versions. Mismatched versions can lead to runtime errors, performance issues, or inability to leverage new features.
fix
Always refer to the release notes of your `nvidia-cudnn-frontend` version to identify the recommended `cuDNN` backend and `CUDA Toolkit` versions. For example, v1.22.1 is recommended for cuDNN 9.20.0 and later. Ensure your system setup matches these recommendations.
affects: All versions
breakingIn version 1.18.0, the library internally transitioned away from using the older `v0.x API` and now directly calls the cuDNN backend API. This change might break compatibility for users who were relying on or interacting with internal `v0.x` API constructs.
fix
Review your code for any dependencies on internal `v0.x` API elements of `cudnn_frontend`. Update your code to use the officially exposed public API functions and methods, which now directly map to the backend calls.
affects: >=1.18.0
gotchaVersion 1.19.1 was released to address issues with `pybind11` versions and restore `cuda-12` toolkit support accidentally dropped in 1.19.0. Older or incompatible `pybind11` installations can cause installation or runtime failures.
fix
If encountering issues, ensure you are using `nvidia-cudnn-frontend` v1.19.1 or later. If you manage `pybind11` versions explicitly, ensure compatibility or allow `pip` to manage it for `nvidia-cudnn-frontend`.
affects: >=1.19.0
Upgrade
Version history
1.27.0latest on PyPI · released Aug 6, 2026
Audit
Dependencies
torchoptionalCommonly used for tensor operations and integration with PyTorch models, as many custom ops are PyTorch-compatible.
Agent activity
8 hits · last 30 days
node
6
Resources
nvidia-cudnn-frontend — pip install nvidia-cudnn-frontend · libregistry