warp.get_cuda_max_cluster_dim#
- warp.get_cuda_max_cluster_dim(
- kernel,
- device=None,
- *,
- block_dim=None,
- dynamic_smem_bytes=0,
Return the maximum
cluster_dimkernel can launch with on device.Probes the CUDA driver via
cuOccupancyMaxActiveClustersfor cluster sizes from 16 down to 2 and returns the largest one the driver reports as launchable. The result reflects actual hardware capability: integrated Hopper+ SoCs (NVIDIA Thor sm_101, DGX Spark sm_121) cap at the portable 8, while Hopper and Blackwell desktop parts typically support 16.For a plain kernel (no
cluster_dimdeclared) the result is the device’s true cluster limit. For a kernel withcluster_dimdeclared, the driver only accepts that declared size, so the function returns the declared value when the device supports it, or1when it does not.- Parameters:
kernel – A
@warp.kernel-decorated kernel instance.device (Device | str | None) – Target device. Defaults to the current device.
block_dim (int | None) – Threads per block at launch. If
None, uses the kernel’s module-resolvedblock_dim.dynamic_smem_bytes (int) – Dynamic shared memory bytes used at launch.
- Returns:
The maximum
cluster_dimas a 1D CTA count. Returns1on devices with compute capability < 9.0, on non-CUDA devices, and on driver error.- Return type: