Device Management
device_cc()
int - Compute capability (e.g., 70, 75, 80, 86, 89, 90, 100)
Use cases:
- Auto-detecting device capabilities
- Selecting appropriate kernel implementations
- Validating feature support
device_id()
int - CUDA device ID (default: 0)
Environment variable: Set CUTLASS_CUDA_DEVICE_ID to override default device.
initialize_cuda_context()
- Creates CUDA context if not already created
- Initializes RMM memory pool if enabled
- Validates CUDA and NVCC versions match
Logging
set_log_level()
int
required
Python logging level constant from the
logging module.logging.DEBUG(10) - Detailed diagnostic informationlogging.INFO(20) - General informational messageslogging.WARNING(30) - Warning messages (default)logging.ERROR(40) - Error messages onlylogging.CRITICAL(50) - Critical errors only
Memory Management
get_memory_pool()
None.
Requirements:
- Python 3.9+
- RMM package installed
None
Note: The memory pool is created on first access with default settings:
- Initial pool size: 1 GB (2^30 bytes)
- Maximum pool size: 4 GB (2^32 bytes)
create_memory_pool()
int
default:"2**30"
Initial memory pool size in bytes.
int
default:"2**32"
Maximum memory pool size in bytes.
Type Utilities
library_type()
DataType enum values.
Supported input types:
- PyTorch dtypes:
torch.float16,torch.float32,torch.float64,torch.bfloat16,torch.int8,torch.int32 - NumPy dtypes:
numpy.float16,numpy.float32,numpy.float64,numpy.int8,numpy.int32 - CUTLASS DataType: passed through unchanged
cutlass.DataType enum value
Compiler Configuration
nvcc_version()
str - NVCC version string
cuda_install_path()
str - Path to CUDA installation directory
Detection order:
CUDA_INSTALL_PATHenvironment variable- Path derived from
nvcclocation
Environment Variables
CUTLASS_PATH
CUDA_INSTALL_PATH
nvcc location
CUTLASS_CUDA_DEVICE_ID
Version Information
version
Cache Management
CUTLASS caches compiled kernels to disk to avoid recompilation.Cache Location
Compiled kernels are cached in:Clearing Cache
To force recompilation, delete the cache file:Error Checking
check()
Constants
SharedMemPerCC
Complete Example
Source Code
- Main module: cutlass/python/cutlass_cppgen/init.py
- Device utilities:
cutlass/python/cutlass_cppgen/backend/utils/device.py - Type utilities:
cutlass/python/cutlass_cppgen/utils/datatypes.py