[CI/Build] Enable FP8 on NVIDIA Thor (#39712)
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
This commit is contained in:
@@ -96,44 +96,14 @@ struct enable_sm90_or_later : Kernel {
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <typename Kernel>
|
template <typename Kernel>
|
||||||
struct enable_sm90_only : Kernel {
|
struct enable_sm100_to_sm120 : Kernel {
|
||||||
template <typename... Args>
|
template <typename... Args>
|
||||||
CUTLASS_DEVICE void operator()(Args&&... args) {
|
CUTLASS_DEVICE void operator()(Args&&... args) {
|
||||||
#if defined __CUDA_ARCH__
|
#if defined __CUDA_ARCH__
|
||||||
#if __CUDA_ARCH__ == 900
|
#if (__CUDA_ARCH__ >= 1000 && __CUDA_ARCH__ < 1200)
|
||||||
Kernel::operator()(std::forward<Args>(args)...);
|
Kernel::operator()(std::forward<Args>(args)...);
|
||||||
#else
|
#else
|
||||||
printf("This kernel only supports sm90.\n");
|
printf("This kernel only supports sm[100, 120).\n");
|
||||||
asm("trap;");
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
template <typename Kernel>
|
|
||||||
struct enable_sm100f_only : Kernel {
|
|
||||||
template <typename... Args>
|
|
||||||
CUTLASS_DEVICE void operator()(Args&&... args) {
|
|
||||||
#if defined __CUDA_ARCH__
|
|
||||||
#if __CUDA_ARCH__ == 1000 || __CUDA_ARCH__ == 1030
|
|
||||||
Kernel::operator()(std::forward<Args>(args)...);
|
|
||||||
#else
|
|
||||||
printf("This kernel only supports sm100f.\n");
|
|
||||||
asm("trap;");
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
template <typename Kernel>
|
|
||||||
struct enable_sm100a_only : Kernel {
|
|
||||||
template <typename... Args>
|
|
||||||
CUTLASS_DEVICE void operator()(Args&&... args) {
|
|
||||||
#if defined __CUDA_ARCH__
|
|
||||||
#if __CUDA_ARCH__ == 1000
|
|
||||||
Kernel::operator()(std::forward<Args>(args)...);
|
|
||||||
#else
|
|
||||||
printf("This kernel only supports sm100a.\n");
|
|
||||||
asm("trap;");
|
asm("trap;");
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@@ -148,7 +118,7 @@ struct enable_sm120_only : Kernel {
|
|||||||
#if __CUDA_ARCH__ == 1200
|
#if __CUDA_ARCH__ == 1200
|
||||||
Kernel::operator()(std::forward<Args>(args)...);
|
Kernel::operator()(std::forward<Args>(args)...);
|
||||||
#else
|
#else
|
||||||
printf("This kernel only supports sm120.\n");
|
printf("This kernel only supports sm120a.\n");
|
||||||
asm("trap;");
|
asm("trap;");
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@@ -160,8 +130,13 @@ template <typename Kernel>
|
|||||||
struct enable_sm120_family : Kernel {
|
struct enable_sm120_family : Kernel {
|
||||||
template <typename... Args>
|
template <typename... Args>
|
||||||
CUTLASS_DEVICE void operator()(Args&&... args) {
|
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>(args)...);
|
Kernel::operator()(std::forward<Args>(args)...);
|
||||||
|
#else
|
||||||
|
printf("This kernel only supports sm120f.\n");
|
||||||
|
asm("trap;");
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ struct cutlass_3x_gemm_sm100 {
|
|||||||
sizeof(typename CollectiveEpilogue::SharedStorage))>,
|
sizeof(typename CollectiveEpilogue::SharedStorage))>,
|
||||||
KernelSchedule>::CollectiveOp;
|
KernelSchedule>::CollectiveOp;
|
||||||
|
|
||||||
using GemmKernel = enable_sm100f_only<cutlass::gemm::kernel::GemmUniversal<
|
using GemmKernel = enable_sm100_to_sm120<cutlass::gemm::kernel::GemmUniversal<
|
||||||
Shape<int, int, int, int>, CollectiveMainloop, CollectiveEpilogue, void>>;
|
Shape<int, int, int, int>, CollectiveMainloop, CollectiveEpilogue, void>>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -125,7 +125,7 @@ struct cutlass_3x_gemm_fp8_blockwise {
|
|||||||
MainloopScheduler
|
MainloopScheduler
|
||||||
>::CollectiveOp>;
|
>::CollectiveOp>;
|
||||||
|
|
||||||
using KernelType = enable_sm100f_only<cutlass::gemm::kernel::GemmUniversal<
|
using KernelType = enable_sm100_to_sm120<cutlass::gemm::kernel::GemmUniversal<
|
||||||
Shape<int, int, int, int>, CollectiveMainloop, CollectiveEpilogue>>;
|
Shape<int, int, int, int>, CollectiveMainloop, CollectiveEpilogue>>;
|
||||||
|
|
||||||
struct GemmKernel : public KernelType {};
|
struct GemmKernel : public KernelType {};
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ struct cutlass_3x_gemm_sm100_fp8 {
|
|||||||
// -----------------------------------------------------------
|
// -----------------------------------------------------------
|
||||||
// Kernel definition
|
// Kernel definition
|
||||||
// -----------------------------------------------------------
|
// -----------------------------------------------------------
|
||||||
using GemmKernel = enable_sm100f_only<cutlass::gemm::kernel::GemmUniversal<
|
using GemmKernel = enable_sm100_to_sm120<cutlass::gemm::kernel::GemmUniversal<
|
||||||
Shape<int, int, int, int>, CollectiveMainloop, CollectiveEpilogue, void>>;
|
Shape<int, int, int, int>, CollectiveMainloop, CollectiveEpilogue, void>>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user