
Cutlass
CUDA templates for high-performance GPU linear algebra
Replaces —
Who it's for
Teams implementing custom attention mechanisms, quantized matmuls, or fused epilogues inside PyTorch or JAX use CUTLASS C++ templates or CuTe DSL to author kernels that match cuBLAS throughput while adding custom fusion logic in the epilogue.
You only need standard GEMM operations already covered by cuBLAS or torch.matmul.
Engineers quantizing models to FP8, MXFP4, or NVFP4 for production inference on Hopper or Blackwell GPUs use CUTLASS's block-scaled data type support and Tensor Core specializations to write kernels that exploit the hardware's mixed-precision throughput.
Your quantization targets are already supported by TensorRT or vendor-optimized libraries.
Researchers prototyping new linear algebra algorithms or GPU memory access patterns use CuTe DSL to iterate quickly in Python, inspect PTX and SASS output, and validate against reference implementations -- without the compile-time overhead of full C++ instantiation.
Your research does not involve GPU kernel implementation or does not target NVIDIA hardware.
Scientific computing teams needing high-throughput dense linear algebra on NVIDIA clusters use CUTLASS to build custom GEMM kernels with specific accumulation types, split-K strategies, or problem-size tile configurations not exposed by vendor BLAS libraries.
Standard BLAS interfaces (cuBLAS, MAGMA) already meet your throughput and precision requirements.
The problem
Writing GPU kernels that approach the theoretical peak throughput of NVIDIA Tensor Cores requires deep knowledge of hardware-specific memory hierarchies, warp scheduling, and instruction-level details that change with every GPU generation. Without a principled, reusable abstraction layer, each new data type, architecture, or tiling strategy demands a near-complete kernel rewrite -- a cycle that consumes enormous engineering time and produces brittle, non-composable code.
How it works
The entire CUTLASS C++ library lives under `include/` and requires no separate build step to use. Client applications add the directory to their include path and specialize the templates for their desired tile sizes, data types, and architectures at compile time.
CuTe DSL lets developers write high-performance CUDA kernels in Python using the same layout and tensor abstractions as the C++ library. JIT compilation keeps iteration fast, and the DSL integrates directly with PyTorch and JAX via `cutlass.jax.cutlass_call` without glue code.
CUTLASS covers FP64, FP32, TF32, FP16, BF16, 8-bit FP (e5m2 and e4m3), block scaled formats (NVFP4, MXFP4, MXFP6, MXFP8), 4-bit and 8-bit signed and unsigned integers, and 1-bit binary types -- allowing exploration of quantization strategies without switching frameworks.
CUTLASS runs on NVIDIA GPUs from Volta (compute capability 7.0) through the latest Rubin SM107 architecture, with architecture-accelerated features and Tensor Core instruction specializations for Ampere, Hopper, Blackwell, and Rubin.
2D and 3D convolution operations are reformulated as matrix multiplications via the implicit GEMM algorithm, letting CUTLASS reuse its highly optimized GEMM pipeline rather than maintaining a separate convolution kernel stack.
A command-line utility under `tools/profiler/` launches individual GEMM and convolution kernels, reports achieved GFLOP/s and memory bandwidth, and validates results against a reference. It supports wildcard kernel selection and is useful for benchmarking custom tile configurations.
Features
- Header-only C++ template library
- CuTe DSL: Python-native kernel authoring
- Comprehensive mixed-precision data type support
- Multi-generation architecture support
- Implicit GEMM convolution
- CUTLASS Profiler
How to install
# Python DSL pip install nvidia-cutlass-dsl # C++ header-only (no build required) git clone https://github.com/NVIDIA/cutlass.git # Add cutlass/include/ to your project's include paths # Build examples and tests with CMake export CUDACXX=${CUDA_INSTALL_PATH}/bin/nvcc mkdir build && cd build cmake .. -DCUTLASS_NVCC_ARCHS=90a make test_unit -j
Recommended for this setup
Strengths
- Near-theoretical-peak throughput: CUTLASS primitives achieve nearly optimal utilization of peak theoretical throughput on supported hardware. The CUTLASS 3.8 benchmarks on NVIDIA Blackwell SM100 demonstrate this across a range of input and output data types, making it the reference standard for GPU GEMM performance.
- Python DSL matches C++ performance: CuTe DSL-generated kernels achieve performance within 2% of handwritten C++ implementations on NVIDIA Blackwell architecture while offering JIT compilation, Python-native metaprogramming, and direct framework integration -- removing the need for deep C++ template expertise to reach production-grade kernel performance.
- Composable, reusable abstractions: CuTe's `Layout` and `Tensor` objects handle complex multi-dimensional indexing automatically, and layouts compose via functional operations like tiling and partitioning. This means a new data type or tile size typically requires local changes rather than a full kernel rewrite.
- Broad ecosystem integration: CUTLASS is tested against FlashAttention, FlashInfer, cuDNN-Frontend, PyTorch, and TensorRT-LLM in each release, and forms the kernel substrate for cuBLAS and cuDNN. Its primitives are a common target for deep learning compilers like TVM.
Trade-offs
- Linux-only for CUTLASS 3.x builds: CUTLASS 3.x builds are known to be broken on Windows for all CUDA toolkits as of the current release. Teams working primarily on Windows cannot use the latest C++ templates without a Linux build environment.
- Long compile times when building all kernels: Instantiating every tile size, data type, and layout combination produces tens of thousands of kernels and build times that can run for hours. The profiler and unit tests require targeted `CUTLASS_LIBRARY_KERNELS` selection to remain practical.
- NVIDIA GPUs only: CUTLASS is tightly coupled to CUDA and NVIDIA hardware. It has no AMD ROCm, Intel GPU, or CPU backend, so projects requiring cross-vendor portability must look elsewhere.
- C++ expertise still needed for the full template surface: While CuTe DSL lowers the barrier significantly, achieving optimal results with the C++ templates requires understanding CUDA's thread hierarchy, shared memory, async copy instructions, and C++ template metaprogramming -- concepts with a steep learning curve for developers new to GPU kernel programming.
Tech stack
FAQ
No. CUTLASS is a header-only template library for C++ use. You only need to add its `include/` directory to your project's include paths. Building with CMake is only required to run the unit tests, examples, or the CUTLASS Profiler.
The CuTe DSL is distributed as a pip package. Install it with `pip install nvidia-cutlass-dsl`. SASS dumping requires the optional `[sass]` extra: `pip install nvidia-cutlass-dsl[sass]`.
CUTLASS requires at minimum a Volta GPU (compute capability 7.0) and CUDA Toolkit 11.4. It supports Volta, Turing, Ampere, Ada, Hopper, Blackwell, and the new Rubin (SM107) architecture, which requires the R615 driver shipping with CUDA Toolkit 13.4 GA.
According to the CUTLASS documentation, CuTe DSL-generated kernels achieve performance within 2% of handwritten C++ implementations on the NVIDIA Blackwell architecture. The DSL compiles to the same PTX and SASS instructions as the C++ templates.
CUTLASS 3.0 introduced CuTe as a new core library for expressing layouts and tensors, and redesigned the GEMM template hierarchy around CuTe's composable abstractions. CUTLASS 2.x templates remain available but the 3.x design is the active development surface. CUTLASS 4.0 added the Python CuTe DSL on top of the same 3.x C++ foundations.