diff --git a/csrc/cutlass_extensions/common.hpp b/csrc/cutlass_extensions/common.hpp index c32d3a0606..ca96b0ef3f 100644 --- a/csrc/cutlass_extensions/common.hpp +++ b/csrc/cutlass_extensions/common.hpp @@ -96,44 +96,14 @@ struct enable_sm90_or_later : Kernel { }; template -struct enable_sm90_only : Kernel { +struct enable_sm100_to_sm120 : Kernel { template CUTLASS_DEVICE void operator()(Args&&... args) { #if defined __CUDA_ARCH__ - #if __CUDA_ARCH__ == 900 + #if (__CUDA_ARCH__ >= 1000 && __CUDA_ARCH__ < 1200) Kernel::operator()(std::forward(args)...); #else - printf("This kernel only supports sm90.\n"); - asm("trap;"); - #endif -#endif - } -}; - -template -struct enable_sm100f_only : Kernel { - template - CUTLASS_DEVICE void operator()(Args&&... args) { -#if defined __CUDA_ARCH__ - #if __CUDA_ARCH__ == 1000 || __CUDA_ARCH__ == 1030 - Kernel::operator()(std::forward(args)...); - #else - printf("This kernel only supports sm100f.\n"); - asm("trap;"); - #endif -#endif - } -}; - -template -struct enable_sm100a_only : Kernel { - template - CUTLASS_DEVICE void operator()(Args&&... args) { -#if defined __CUDA_ARCH__ - #if __CUDA_ARCH__ == 1000 - Kernel::operator()(std::forward(args)...); - #else - printf("This kernel only supports sm100a.\n"); + printf("This kernel only supports sm[100, 120).\n"); asm("trap;"); #endif #endif @@ -148,7 +118,7 @@ struct enable_sm120_only : Kernel { #if __CUDA_ARCH__ == 1200 Kernel::operator()(std::forward(args)...); #else - printf("This kernel only supports sm120.\n"); + printf("This kernel only supports sm120a.\n"); asm("trap;"); #endif #endif @@ -160,8 +130,13 @@ template struct enable_sm120_family : Kernel { template CUTLASS_DEVICE void operator()(Args&&... args) { -#if defined __CUDA_ARCH__ && (__CUDA_ARCH__ >= 1200 && __CUDA_ARCH__ < 1300) +#if defined __CUDA_ARCH__ + #if (__CUDA_ARCH__ >= 1200 && __CUDA_ARCH__ < 1300) Kernel::operator()(std::forward(args)...); + #else + printf("This kernel only supports sm120f.\n"); + asm("trap;"); + #endif #endif } }; diff --git a/csrc/libtorch_stable/quantization/w8a8/cutlass/c3x/scaled_mm.cuh b/csrc/libtorch_stable/quantization/w8a8/cutlass/c3x/scaled_mm.cuh index 546e1eec64..e98433bed2 100644 --- a/csrc/libtorch_stable/quantization/w8a8/cutlass/c3x/scaled_mm.cuh +++ b/csrc/libtorch_stable/quantization/w8a8/cutlass/c3x/scaled_mm.cuh @@ -141,7 +141,7 @@ struct cutlass_3x_gemm_sm100 { sizeof(typename CollectiveEpilogue::SharedStorage))>, KernelSchedule>::CollectiveOp; - using GemmKernel = enable_sm100f_only, CollectiveMainloop, CollectiveEpilogue, void>>; }; diff --git a/csrc/libtorch_stable/quantization/w8a8/cutlass/c3x/scaled_mm_blockwise_sm100_fp8_dispatch.cuh b/csrc/libtorch_stable/quantization/w8a8/cutlass/c3x/scaled_mm_blockwise_sm100_fp8_dispatch.cuh index cf84fc3a6d..8f74f29914 100644 --- a/csrc/libtorch_stable/quantization/w8a8/cutlass/c3x/scaled_mm_blockwise_sm100_fp8_dispatch.cuh +++ b/csrc/libtorch_stable/quantization/w8a8/cutlass/c3x/scaled_mm_blockwise_sm100_fp8_dispatch.cuh @@ -125,7 +125,7 @@ struct cutlass_3x_gemm_fp8_blockwise { MainloopScheduler >::CollectiveOp>; - using KernelType = enable_sm100f_only, CollectiveMainloop, CollectiveEpilogue>>; struct GemmKernel : public KernelType {}; diff --git a/csrc/libtorch_stable/quantization/w8a8/cutlass/c3x/scaled_mm_sm100_fp8_dispatch.cuh b/csrc/libtorch_stable/quantization/w8a8/cutlass/c3x/scaled_mm_sm100_fp8_dispatch.cuh index 46c36d13ec..5cd55f0198 100644 --- a/csrc/libtorch_stable/quantization/w8a8/cutlass/c3x/scaled_mm_sm100_fp8_dispatch.cuh +++ b/csrc/libtorch_stable/quantization/w8a8/cutlass/c3x/scaled_mm_sm100_fp8_dispatch.cuh @@ -92,7 +92,7 @@ struct cutlass_3x_gemm_sm100_fp8 { // ----------------------------------------------------------- // Kernel definition // ----------------------------------------------------------- - using GemmKernel = enable_sm100f_only, CollectiveMainloop, CollectiveEpilogue, void>>; };