v4.2 release. (#2587)
* Fix default cluster callback values to 1 to avoid profiler failure when these values are not set in command line. * v4.2 release.
This commit is contained in:
@@ -54,13 +54,15 @@
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if (defined(CUTLASS_ARCH_MMA_SM100A_ENABLED) || defined(CUTLASS_ARCH_MMA_SM101A_ENABLED) ||\
|
||||
defined(CUTLASS_ARCH_MMA_SM120A_ENABLED))
|
||||
defined(CUTLASS_ARCH_MMA_SM103A_ENABLED) || defined(CUTLASS_ARCH_MMA_SM120A_ENABLED) ||\
|
||||
defined(CUTLASS_ARCH_MMA_SM121A_ENABLED))
|
||||
# define CUTE_ARCH_TMA_SM90_ENABLED
|
||||
# define CUTE_ARCH_DEVICE_MODIFIABLE_TMA_SM90_ENABLED
|
||||
# define CUTE_ARCH_STSM_SM90_ENABLED
|
||||
#endif
|
||||
|
||||
#if (defined(CUTLASS_ARCH_MMA_SM100A_ENABLED) || defined(CUTLASS_ARCH_MMA_SM101A_ENABLED))
|
||||
#if (defined(CUTLASS_ARCH_MMA_SM100A_ENABLED) || defined(CUTLASS_ARCH_MMA_SM101A_ENABLED) ||\
|
||||
defined(CUTLASS_ARCH_MMA_SM103A_ENABLED))
|
||||
# define CUTE_ARCH_TCGEN05_TF32_MMA_ENABLED
|
||||
# define CUTE_ARCH_TCGEN05_F16F32_MMA_ENABLED
|
||||
# define CUTE_ARCH_TCGEN05_MXF8F6F4_MMA_ENABLED
|
||||
@@ -68,11 +70,12 @@
|
||||
# define CUTE_ARCH_TCGEN05_MXF4NVF4_MMA_ENABLED
|
||||
#endif
|
||||
|
||||
#if defined(CUTLASS_ARCH_MMA_SM100A_ENABLED)
|
||||
#if defined(CUTLASS_ARCH_MMA_SM100A_ENABLED) || defined(CUTLASS_ARCH_MMA_SM103A_ENABLED)
|
||||
# define CUTE_ARCH_TCGEN05_F16BF16_MMA_SCALED_ENABLED
|
||||
#endif
|
||||
|
||||
#if (defined(CUTLASS_ARCH_MMA_SM100F_ENABLED) || defined(CUTLASS_ARCH_MMA_SM101F_ENABLED))
|
||||
#if (defined(CUTLASS_ARCH_MMA_SM100F_ENABLED) || defined(CUTLASS_ARCH_MMA_SM101F_ENABLED) ||\
|
||||
defined(CUTLASS_ARCH_MMA_SM103F_ENABLED))
|
||||
# define CUTE_ARCH_TMA_SM90_ENABLED
|
||||
# define CUTE_ARCH_DEVICE_MODIFIABLE_TMA_SM90_ENABLED
|
||||
# define CUTE_ARCH_STSM_SM90_ENABLED
|
||||
@@ -83,32 +86,59 @@
|
||||
# define CUTE_ARCH_TCGEN05_MXF4NVF4_MMA_ENABLED
|
||||
#endif
|
||||
|
||||
#if defined(CUTLASS_ARCH_MMA_SM100F_ENABLED)
|
||||
#if defined(CUTLASS_ARCH_MMA_SM100F_ENABLED) || defined(CUTLASS_ARCH_MMA_SM103F_ENABLED)
|
||||
# define CUTE_ARCH_TCGEN05_F16BF16_MMA_SCALED_ENABLED
|
||||
#endif
|
||||
|
||||
#if (defined(CUTLASS_ARCH_MMA_SM120F_ENABLED))
|
||||
#if (defined(CUTLASS_ARCH_MMA_SM120F_ENABLED) || defined(CUTLASS_ARCH_MMA_SM121F_ENABLED))
|
||||
# define CUTE_ARCH_TMA_SM90_ENABLED
|
||||
# define CUTE_ARCH_DEVICE_MODIFIABLE_TMA_SM90_ENABLED
|
||||
# define CUTE_ARCH_STSM_SM90_ENABLED
|
||||
#endif
|
||||
|
||||
|
||||
// SM110 specific configs
|
||||
#if (defined(CUTLASS_ARCH_MMA_SM110A_ENABLED) || defined(CUTLASS_ARCH_MMA_SM110F_ENABLED))
|
||||
# define CUTE_ARCH_TMA_SM90_ENABLED
|
||||
# define CUTE_ARCH_DEVICE_MODIFIABLE_TMA_SM90_ENABLED
|
||||
# define CUTE_ARCH_STSM_SM90_ENABLED
|
||||
# define CUTE_ARCH_TCGEN05_TF32_MMA_ENABLED
|
||||
# define CUTE_ARCH_TCGEN05_F16F32_MMA_ENABLED
|
||||
# define CUTE_ARCH_TCGEN05_MXF8F6F4_MMA_ENABLED
|
||||
# define CUTE_ARCH_TCGEN05_MXF4_MMA_ENABLED
|
||||
# define CUTE_ARCH_TCGEN05_MXF4NVF4_MMA_ENABLED
|
||||
# define CUTE_ARCH_TCGEN05_S8_MMA_ENABLED
|
||||
# define CUTE_ARCH_LDSM_SM100A_ENABLED
|
||||
# define CUTE_ARCH_STSM_SM100A_ENABLED
|
||||
# define CUTE_ARCH_TCGEN05_TMEM_ENABLED
|
||||
# define CUTE_ARCH_TMA_SM100_ENABLED
|
||||
# define CUTE_ARCH_LOAD256_SM100A_ENABLED
|
||||
# define CUTE_ARCH_STORE256_SM100A_ENABLED
|
||||
# define CUTE_ARCH_FLOAT2_MATH_ENABLED
|
||||
#endif
|
||||
|
||||
#if (defined(CUTLASS_ARCH_MMA_SM110A_ENABLED))
|
||||
# define CUTE_ARCH_TCGEN05_S8_MMA_ENABLED
|
||||
#endif
|
||||
|
||||
#if (defined(CUTLASS_ARCH_MMA_SM100A_ENABLED) || defined(CUTLASS_ARCH_MMA_SM101A_ENABLED))
|
||||
# define CUTE_ARCH_TCGEN05_S8_MMA_ENABLED
|
||||
#endif
|
||||
|
||||
#if (defined(CUTLASS_ARCH_MMA_SM100A_ENABLED) || defined(CUTLASS_ARCH_MMA_SM101A_ENABLED) ||\
|
||||
defined(CUTLASS_ARCH_MMA_SM120A_ENABLED))
|
||||
defined(CUTLASS_ARCH_MMA_SM103A_ENABLED) || defined(CUTLASS_ARCH_MMA_SM120A_ENABLED) ||\
|
||||
defined(CUTLASS_ARCH_MMA_SM120A_ENABLED) || defined(CUTLASS_ARCH_MMA_SM121A_ENABLED))
|
||||
# define CUTE_ARCH_LDSM_SM100A_ENABLED
|
||||
# define CUTE_ARCH_STSM_SM100A_ENABLED
|
||||
#endif
|
||||
|
||||
#if (defined(CUTLASS_ARCH_MMA_SM100A_ENABLED) || defined(CUTLASS_ARCH_MMA_SM101A_ENABLED))
|
||||
#if (defined(CUTLASS_ARCH_MMA_SM100A_ENABLED) || defined(CUTLASS_ARCH_MMA_SM101A_ENABLED) ||\
|
||||
defined(CUTLASS_ARCH_MMA_SM103A_ENABLED))
|
||||
# define CUTE_ARCH_TCGEN05_TMEM_ENABLED
|
||||
#endif
|
||||
|
||||
#if (defined(CUTLASS_ARCH_MMA_SM100A_ENABLED) || defined(CUTLASS_ARCH_MMA_SM101A_ENABLED))
|
||||
#if (defined(CUTLASS_ARCH_MMA_SM100A_ENABLED) || defined(CUTLASS_ARCH_MMA_SM101A_ENABLED) ||\
|
||||
defined(CUTLASS_ARCH_MMA_SM103A_ENABLED))
|
||||
# define CUTE_ARCH_TMA_SM100_ENABLED
|
||||
#endif
|
||||
|
||||
@@ -120,12 +150,13 @@
|
||||
# define CUTE_ARCH_FLOAT2_MATH_ENABLED
|
||||
#endif
|
||||
|
||||
#if defined(CUTLASS_ARCH_MMA_SM120_ENABLED) || defined(CUTLASS_ARCH_MMA_SM120A_ENABLED)
|
||||
#if (defined(CUTLASS_ARCH_MMA_SM120_ENABLED) || defined(CUTLASS_ARCH_MMA_SM120A_ENABLED) ||\
|
||||
defined(CUTLASS_ARCH_MMA_SM121_ENABLED) || defined(CUTLASS_ARCH_MMA_SM121A_ENABLED))
|
||||
# define CUTE_ARCH_MMA_SM120_ENABLED
|
||||
# define CUTE_ARCH_TMA_SM120_ENABLED
|
||||
#endif
|
||||
|
||||
#if defined(CUTLASS_ARCH_MMA_SM120_ENABLED) || defined(CUTLASS_ARCH_MMA_SM120A_ENABLED)
|
||||
#if (defined(CUTLASS_ARCH_MMA_SM120_ENABLED) || defined(CUTLASS_ARCH_MMA_SM120A_ENABLED))
|
||||
# if (__CUDACC_VER_MAJOR__ > 12 || (__CUDACC_VER_MAJOR__ == 12 && __CUDACC_VER_MINOR__ >= 8))
|
||||
# define CUTE_ARCH_F8F6F4_MMA_ENABLED
|
||||
# define CUTE_ARCH_MXF8F6F4_MMA_ENABLED
|
||||
@@ -134,7 +165,16 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(CUTLASS_ARCH_MMA_SM100F_ENABLED)
|
||||
#if (defined(CUTLASS_ARCH_MMA_SM121_ENABLED) || defined(CUTLASS_ARCH_MMA_SM121A_ENABLED))
|
||||
# if (__CUDACC_VER_MAJOR__ > 12 || (__CUDACC_VER_MAJOR__ == 12 && __CUDACC_VER_MINOR__ >= 9))
|
||||
# define CUTE_ARCH_F8F6F4_MMA_ENABLED
|
||||
# define CUTE_ARCH_MXF8F6F4_MMA_ENABLED
|
||||
# define CUTE_ARCH_MXF4NVF4_2X_UE8M0_MMA_ENABLED
|
||||
# define CUTE_ARCH_MXF4NVF4_4X_UE4M3_MMA_ENABLED
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(CUTLASS_ARCH_MMA_SM100F_ENABLED) || defined(CUTLASS_ARCH_MMA_SM103F_ENABLED)
|
||||
# define CUTE_ARCH_LDSM_SM100A_ENABLED
|
||||
# define CUTE_ARCH_STSM_SM100A_ENABLED
|
||||
# define CUTE_ARCH_TCGEN05_TMEM_ENABLED
|
||||
@@ -149,14 +189,16 @@
|
||||
# define CUTE_ARCH_TMA_SM100_ENABLED
|
||||
#endif
|
||||
|
||||
#if defined(CUTLASS_ARCH_MMA_SM120F_ENABLED)
|
||||
#if (defined(CUTLASS_ARCH_MMA_SM120F_ENABLED) || defined(CUTLASS_ARCH_MMA_SM121F_ENABLED))
|
||||
# define CUTE_ARCH_LDSM_SM100A_ENABLED
|
||||
# define CUTE_ARCH_STSM_SM100A_ENABLED
|
||||
#endif
|
||||
|
||||
#if (defined(CUTLASS_ARCH_MMA_SM100A_ENABLED) || defined(CUTLASS_ARCH_MMA_SM100F_ENABLED) ||\
|
||||
defined(CUTLASS_ARCH_MMA_SM101A_ENABLED) || defined(CUTLASS_ARCH_MMA_SM101F_ENABLED) ||\
|
||||
defined(CUTLASS_ARCH_MMA_SM120A_ENABLED) || defined(CUTLASS_ARCH_MMA_SM120F_ENABLED))
|
||||
defined(CUTLASS_ARCH_MMA_SM103A_ENABLED) || defined(CUTLASS_ARCH_MMA_SM103F_ENABLED) ||\
|
||||
defined(CUTLASS_ARCH_MMA_SM120A_ENABLED) || defined(CUTLASS_ARCH_MMA_SM120F_ENABLED) ||\
|
||||
defined(CUTLASS_ARCH_MMA_SM121A_ENABLED) || defined(CUTLASS_ARCH_MMA_SM121F_ENABLED))
|
||||
# if (__CUDACC_VER_MAJOR__ > 12 || (__CUDACC_VER_MAJOR__ == 12 && __CUDACC_VER_MINOR__ >= 9))
|
||||
# define CUTE_ARCH_LOAD256_SM100A_ENABLED
|
||||
# define CUTE_ARCH_STORE256_SM100A_ENABLED
|
||||
@@ -168,3 +210,7 @@
|
||||
#define CUTE_ARCH_FLOAT2_MATH_ENABLED
|
||||
#endif
|
||||
|
||||
#if defined(CUTLASS_ARCH_MMA_SM103_ENABLED) || defined(CUTLASS_ARCH_MMA_SM100F_ENABLED)
|
||||
# define CUTE_ARCH_TCGEN05_MXF4NVF4_MMA_ULTRA_ENABLED
|
||||
#endif
|
||||
|
||||
|
||||
@@ -41,6 +41,51 @@ namespace cute {
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Global Memory Load and Store PTX definitions
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
struct SM100_LOAD_256bit_CACHE_NOALLOCATION
|
||||
{
|
||||
using SRegisters = uint256_t[1];
|
||||
using DRegisters = uint32_t[8];
|
||||
|
||||
CUTE_HOST_DEVICE static void
|
||||
copy(uint256_t const& gmem_addr,
|
||||
uint32_t& dst0, uint32_t& dst1, uint32_t& dst2, uint32_t& dst3,
|
||||
uint32_t& dst4, uint32_t& dst5, uint32_t& dst6, uint32_t& dst7)
|
||||
{
|
||||
#if defined(CUTE_ARCH_LOAD256_SM100A_ENABLED)
|
||||
asm volatile("ld.global.L1::no_allocate.v8.f32 {%0, %1, %2, %3, %4, %5, %6, %7}, [%8];\n"
|
||||
: "=r"(dst0), "=r"(dst1), "=r"(dst2), "=r"(dst3), "=r"(dst4), "=r"(dst5), "=r"(dst6), "=r"(dst7)
|
||||
: "l"(&gmem_addr) );
|
||||
#else
|
||||
CUTE_INVALID_CONTROL_PATH("Trying to use LOAD.256 without CUTE_ARCH_LOAD256_SM100A_ENABLED.");
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
struct SM100_STORE_256bit_CACHE_NOALLOCATION
|
||||
{
|
||||
using SRegisters = uint32_t[8];
|
||||
using DRegisters = uint256_t[1];
|
||||
|
||||
CUTE_HOST_DEVICE static void
|
||||
copy(uint32_t const& src0, uint32_t const& src1, uint32_t const& src2, uint32_t const& src3,
|
||||
uint32_t const& src4, uint32_t const& src5, uint32_t const& src6, uint32_t const& src7,
|
||||
uint256_t& gmem_addr)
|
||||
{
|
||||
#if defined(CUTE_ARCH_STORE256_SM100A_ENABLED)
|
||||
asm volatile("st.global.L1::no_allocate.v8.f32 [%0], {%1, %2, %3, %4, %5, %6, %7, %8};\n"
|
||||
:: "l"(&gmem_addr), "r"(src0), "r"(src1), "r"(src2), "r"(src3), "r"(src4), "r"(src5), "r"(src6), "r"(src7));
|
||||
#else
|
||||
CUTE_INVALID_CONTROL_PATH("Trying to use stg.256 without CUTE_ARCH_STORE256_SM100A_ENABLED.");
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// LDSM PTX definitions
|
||||
|
||||
@@ -37,6 +37,8 @@
|
||||
|
||||
#include <cute/arch/copy.hpp>
|
||||
#include <cute/arch/copy_sm90.hpp>
|
||||
#include "cutlass/arch/synclog.hpp"
|
||||
|
||||
namespace cute
|
||||
{
|
||||
|
||||
|
||||
@@ -41,11 +41,13 @@
|
||||
// * https://reviews.llvm.org/D121666
|
||||
// * https://reviews.llvm.org/D126846
|
||||
#define CUTE_ARCH_CLANG_SUPPORTS_LDSM_SM75 (__clang_major__ >= 15)
|
||||
#define CUTE_ARCH_CLANG_SUPPORTS_MOVM_SM75 (__clang_major__ >= 15)
|
||||
#endif
|
||||
|
||||
#if defined(__NVCC__) || defined(__CUDACC_RTC__)
|
||||
// ldmatrix PTX instruction added in CUDA 10.2+
|
||||
#define CUTE_ARCH_NVCC_SUPPORTS_LDSM_SM75 ((__CUDACC_VER_MAJOR__ == 10 && __CUDACC_VER_MINOR__ >= 2) || __CUDACC_VER_MAJOR__ >= 11)
|
||||
#define CUTE_ARCH_NVCC_SUPPORTS_MOVM_SM75 ((__CUDACC_VER_MAJOR__ == 10 && __CUDACC_VER_MINOR__ >= 2) || __CUDACC_VER_MAJOR__ >= 11)
|
||||
#endif
|
||||
|
||||
#if ! defined(CUTE_ARCH_LDSM_SM75_SUPPORTED)
|
||||
@@ -60,12 +62,19 @@
|
||||
#define CUTE_ARCH_LDSM_SM75_ACTIVATED 1
|
||||
#endif
|
||||
|
||||
#if defined(__CUDA_ARCH__) && (__CUDA_ARCH__ >= 750)
|
||||
#define CUTE_ARCH_MOVM_SM75_ACTIVATED 1
|
||||
#else
|
||||
#define CUTE_ARCH_MOVM_SM75_ACTIVATED 0
|
||||
#if ! defined(CUTE_ARCH_MOVM_SM75_SUPPORTED)
|
||||
#define CUTE_ARCH_MOVM_SM75_SUPPORTED (CUTE_ARCH_NVCC_SUPPORTS_MOVM_SM75 || CUTE_ARCH_CLANG_SUPPORTS_MOVM_SM75)
|
||||
#endif
|
||||
|
||||
#if ! defined(CUTE_ARCH_MOVM_SM75_ENABLED)
|
||||
#define CUTE_ARCH_MOVM_SM75_ENABLED (CUTE_ARCH_MOVM_SM75_SUPPORTED)
|
||||
#endif
|
||||
|
||||
#if (CUTE_ARCH_MOVM_SM75_ENABLED) && defined(__CUDA_ARCH__) && __CUDA_ARCH__ >= 750
|
||||
#define CUTE_ARCH_MOVM_SM75_ACTIVATED 1
|
||||
#endif
|
||||
|
||||
|
||||
namespace cute
|
||||
{
|
||||
|
||||
@@ -207,7 +216,6 @@ struct SM75_U32x1_MOVM_T
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
//
|
||||
// Legacy LDSM interfaces that aren't very useful
|
||||
//
|
||||
|
||||
@@ -265,7 +265,7 @@ to_CUtensorMapSwizzle(SmemSwizzleBits const& t, SmemSwizzleBase const& b) {
|
||||
inline CUtensorMapFloatOOBfill
|
||||
to_CUtensorMapFloatOOBfill(OOBFill const& t) {
|
||||
switch(t) {
|
||||
default: throw std::runtime_error("Unknown OOBFill!");
|
||||
default: throw std::runtime_error("Unknown OOBFill!");
|
||||
case OOBFill::ZERO: return CU_TENSOR_MAP_FLOAT_OOB_FILL_NONE;
|
||||
case OOBFill::CONSTANT: return CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA;
|
||||
}
|
||||
|
||||
@@ -459,7 +459,7 @@ union InstrDescriptorBlockScaled
|
||||
scale_format_ : 1, // bit [23,24) : 0=E4M3, 1=E8M0
|
||||
m_dim_ : 5, // bit [24,29) : 4 LSBs not included. Valid values are: 4 (M=64), 8 (M=128), 16 (M=256)
|
||||
a_sf_id_ : 2, // bit [29,31) : Matrix A Scale Factor ID
|
||||
: 1; //
|
||||
k_size_ : 1; // bit [31,32) : MMA-K Dim. MXF8F6F4Format: 0=[dense: K32, sparse: K64]. S8Format: 0=[dense: K32, sparse: invalid]. MXF4Format: 0=[dense: K64, sparse: K128], 1=[dense: K96, sparse: invalid].
|
||||
};
|
||||
|
||||
// Decay to a uint32_t
|
||||
|
||||
@@ -46,10 +46,8 @@ template <class a_type, class b_type, class c_type,
|
||||
struct SM100_MMA_TF32_SS
|
||||
{
|
||||
static_assert(M == 64 || M == 128, "SM100_MMA_TF32 M-mode size should be 64 or 128 for 1 CTA cluster MMA.");
|
||||
static_assert((M == 64 && (N % 8 == 0) && (8 <= N) && (N <= 256)) ||
|
||||
(M == 128 && (N % 16 == 0) && (16 <= N) && (N <= 256)),
|
||||
"SM100_MMA_TF32 N-mode size should be a multiple of 8 between 8 and 256 for M=64,\
|
||||
or a multiple of 16 between 16 and 256 for M=128.");
|
||||
static_assert((N % 8 == 0) && (8 <= N) && (N <= 256),
|
||||
"SM100_MMA_TF32 N-mode size should be a multiple of 8 between 8 and 256.");
|
||||
|
||||
using DRegisters = void;
|
||||
using ARegisters = uint64_t[1];
|
||||
@@ -88,10 +86,8 @@ template <class a_type, class b_type, class c_type,
|
||||
struct SM100_MMA_F16BF16_SS
|
||||
{
|
||||
static_assert(M == 64 || M == 128, "SM100_MMA_F16BF16 M-mode size should be 64 or 128 for 1 CTA cluster MMA.");
|
||||
static_assert((M == 64 && (N % 8 == 0) && (8 <= N) && (N <= 256)) ||
|
||||
(M == 128 && (N % 16 == 0) && (16 <= N) && (N <= 256)),
|
||||
"SM100_MMA_F16BF16 N-mode size should be a multiple of 8 between 8 and 256 for M=64,\
|
||||
or a multiple of 16 between 16 and 256 for M=128.");
|
||||
static_assert((N % 8 == 0) && (8 <= N) && (N <= 256),
|
||||
"SM100_MMA_F16BF16 N-mode size should be a multiple of 8 between 8 and 256.");
|
||||
|
||||
using DRegisters = void;
|
||||
using ARegisters = uint64_t[1];
|
||||
@@ -218,10 +214,8 @@ template <class a_type, class b_type, class c_type,
|
||||
struct SM100_MMA_F16BF16_SS_SCALED
|
||||
{
|
||||
static_assert(M == 64 || M == 128, "SM100_MMA_F16BF16_SS_SCALED M-mode size should be 64 or 128 for 1 CTA cluster MMA.");
|
||||
static_assert((M == 64 && (N % 8 == 0) && (8 <= N) && (N <= 256)) ||
|
||||
(M == 128 && (N % 16 == 0) && (16 <= N) && (N <= 256)),
|
||||
"SM100_MMA_F16BF16_SS_SCALED N-mode size should be a multiple of 8 between 8 and 256 for M=64,\
|
||||
or a multiple of 16 between 16 and 256 for M=128.");
|
||||
static_assert((N % 8 == 0) && (8 <= N) && (N <= 256),
|
||||
"SM100_MMA_F16BF16_SS_SCALED N-mode size should be a multiple of 8 between 8 and 256.");
|
||||
|
||||
using DRegisters = void;
|
||||
using ARegisters = uint64_t[1];
|
||||
@@ -306,10 +300,8 @@ template <class a_type, class b_type, class c_type,
|
||||
struct SM100_MMA_TF32_SS_SPARSE
|
||||
{
|
||||
static_assert(M == 64 || M == 128, "SM100_MMA_TF32_SS_SPARSE M-mode size should be 64 or 128 for 1 CTA cluster MMA.");
|
||||
static_assert((M == 64 && (N % 8 == 0) && (8 <= N) && (N <= 256)) ||
|
||||
(M == 128 && (N % 16 == 0) && (16 <= N) && (N <= 256)),
|
||||
"SM100_MMA_TF32_SS_SPARSE N-mode size should be a multiple of 8 between 8 and 256 for M=64,\
|
||||
or a multiple of 16 between 16 and 256 for M=128.");
|
||||
static_assert((N % 8 == 0) && (8 <= N) && (N <= 256),
|
||||
"SM100_MMA_TF32_SS_SPARSE N-mode size should be a multiple of 8 between 8 and 256.");
|
||||
|
||||
using DRegisters = void;
|
||||
using ARegisters = uint64_t[1];
|
||||
@@ -349,10 +341,8 @@ template <class a_type, class b_type, class c_type,
|
||||
struct SM100_MMA_F16BF16_SS_SPARSE
|
||||
{
|
||||
static_assert(M == 64 || M == 128, "SM100_MMA_F16BF16_SS_SPARSE M-mode size should be 64 or 128 for 1 CTA cluster MMA.");
|
||||
static_assert((M == 64 && (N % 8 == 0) && (8 <= N) && (N <= 256)) ||
|
||||
(M == 128 && (N % 16 == 0) && (16 <= N) && (N <= 256)),
|
||||
"SM100_MMA_F16BF16_SS_SPARSE N-mode size should be a multiple of 8 between 8 and 256 for M=64,\
|
||||
or a multiple of 16 between 16 and 256 for M=128.");
|
||||
static_assert((N % 8 == 0) && (8 <= N) && (N <= 256),
|
||||
"SM100_MMA_F16BF16_SS_SPARSE N-mode size should be a multiple of 8 between 8 and 256.");
|
||||
|
||||
using DRegisters = void;
|
||||
using ARegisters = uint64_t[1];
|
||||
@@ -392,7 +382,7 @@ template <class a_type, class b_type, class c_type,
|
||||
struct SM100_MMA_TF32_2x1SM_SS
|
||||
{
|
||||
static_assert(M == 128 || M == 256, "SM100_MMA_TF32_2x1SM_SS M-mode size should be 128 or 256 for 2 CTA cluster MMA.");
|
||||
static_assert((N % 32 == 0) && (32 <= N) && (N <= 256), "SM100_MMA_TF32_2x1SM_SS N-mode size should be a multiple of 32 between 32 and 256.");
|
||||
static_assert((N % 16 == 0) && (16 <= N) && (N <= 256), "SM100_MMA_TF32_2x1SM_SS N-mode size should be a multiple of 16 between 16 and 256.");
|
||||
|
||||
using DRegisters = void;
|
||||
using ARegisters = uint64_t[1];
|
||||
@@ -432,7 +422,7 @@ template <class a_type, class b_type, class c_type,
|
||||
struct SM100_MMA_F16BF16_2x1SM_SS
|
||||
{
|
||||
static_assert(M == 128 || M == 256, "SM100_MMA_F16BF16_2x1SM_SS M-mode size should be 128 or 256 for 2 CTA cluster MMA.");
|
||||
static_assert((N % 32 == 0) && (32 <= N) && (N <= 256), "SM100_MMA_F16BF16_2x1SM_SS N-mode size should be a multiple of 32 between 32 and 256.");
|
||||
static_assert((N % 16 == 0) && (16 <= N) && (N <= 256), "SM100_MMA_F16BF16_2x1SM_SS N-mode size should be a multiple of 16 between 16 and 256.");
|
||||
|
||||
using DRegisters = void;
|
||||
using ARegisters = uint64_t[1];
|
||||
@@ -556,7 +546,7 @@ template <class a_type, class b_type, class c_type,
|
||||
struct SM100_MMA_F16BF16_2x1SM_SS_SCALED
|
||||
{
|
||||
static_assert(M == 128 || M == 256, "SM100_MMA_F16BF16_2x1SM_SS_SCALED M-mode size should be 128 or 256 for 2 CTA cluster MMA.");
|
||||
static_assert((N % 32 == 0) && (32 <= N) && (N <= 256), "SM100_MMA_F16BF16_2x1SM_SS_SCALED N-mode size should be a multiple of 32 between 32 and 256.");
|
||||
static_assert((N % 16 == 0) && (16 <= N) && (N <= 256), "SM100_MMA_F16BF16_2x1SM_SS_SCALED N-mode size should be a multiple of 16 between 16 and 256.");
|
||||
|
||||
using DRegisters = void;
|
||||
using ARegisters = uint64_t[1];
|
||||
@@ -640,7 +630,7 @@ template <class a_type, class b_type, class c_type,
|
||||
struct SM100_MMA_TF32_2x1SM_SS_SPARSE
|
||||
{
|
||||
static_assert(M == 128 || M == 256, "SM100_MMA_TF32_2x1SM_SS_SPARSE M-mode size should be 128 or 256 for 2 CTA cluster MMA.");
|
||||
static_assert((N % 32 == 0) && (32 <= N) && (N <= 256), "SM100_MMA_TF32_2x1SM_SS_SPARSE N-mode size should be a multiple of 32 between 32 and 256.");
|
||||
static_assert((N % 16 == 0) && (16 <= N) && (N <= 256), "SM100_MMA_TF32_2x1SM_SS_SPARSE N-mode size should be a multiple of 16 between 16 and 256.");
|
||||
|
||||
using DRegisters = void;
|
||||
using ARegisters = uint64_t[1];
|
||||
@@ -681,7 +671,7 @@ template <class a_type, class b_type, class c_type,
|
||||
struct SM100_MMA_F16BF16_2x1SM_SS_SPARSE
|
||||
{
|
||||
static_assert(M == 128 || M == 256, "SM100_MMA_F16BF16_2x1SM_SS_SPARSE M-mode size should be 128 or 256 for 2 CTA cluster MMA.");
|
||||
static_assert((N % 32 == 0) && (32 <= N) && (N <= 256), "SM100_MMA_F16BF16_2x1SM_SS_SPARSE N-mode size should be a multiple of 32 between 32 and 256.");
|
||||
static_assert((N % 16 == 0) && (16 <= N) && (N <= 256), "SM100_MMA_F16BF16_2x1SM_SS_SPARSE N-mode size should be a multiple of 16 between 16 and 256.");
|
||||
|
||||
using DRegisters = void;
|
||||
using ARegisters = uint64_t[1];
|
||||
@@ -1645,4 +1635,143 @@ struct SM100_MMA_MXF4NVF4_2x1SM_SS_SPARSE
|
||||
}
|
||||
};
|
||||
|
||||
namespace SM103 {
|
||||
template <class a_type, class b_type, class c_type, class sf_type,
|
||||
int M, int N, int VS, UMMA::Major a_major, UMMA::Major b_major,
|
||||
UMMA::ScaleIn a_neg = UMMA::ScaleIn::One, UMMA::ScaleIn b_neg = UMMA::ScaleIn::One>
|
||||
struct SM103_MXF4_ULTRA_SS_VS
|
||||
{
|
||||
static_assert(M == 128, "MMA M-mode size should be 128 for 1 CTA cluster MMA.");
|
||||
static_assert((N % 16 == 0) && (16 <= N) && (N <= 256), "MMA N-mode size should be a multiple of 16 between 16 and 256.");
|
||||
static_assert(((VS == 32) & (is_same_v<a_type, cutlass::float_e2m1_t> && is_same_v<sf_type, cutlass::float_ue8m0_t>)) || (VS == 16),
|
||||
"Vector size can only be 4x mode (VS=16) or 2x mode (VS=32) for MMA. 2x mode only supports float_e2m1_t for a/b types and ue8m0_t for sf type");
|
||||
|
||||
using DRegisters = void;
|
||||
using ARegisters = uint64_t[1];
|
||||
using BRegisters = uint64_t[1];
|
||||
using CRegisters = uint32_t[1];
|
||||
using SFARegisters = uint32_t[1];
|
||||
using SFBRegisters = uint32_t[1];
|
||||
|
||||
CUTE_HOST_DEVICE static void
|
||||
fma(uint64_t const& desc_a,
|
||||
uint64_t const& desc_b,
|
||||
uint32_t const& tmem_c,
|
||||
uint32_t const& scaleC,
|
||||
uint64_t const& idescE,
|
||||
uint32_t const& tsfa_addr,
|
||||
uint32_t const& tsfb_addr)
|
||||
{
|
||||
#if defined(CUTE_ARCH_TCGEN05_MXF4NVF4_MMA_ULTRA_ENABLED)
|
||||
if constexpr (VS == 16) {
|
||||
if (cute::elect_one_sync()) {
|
||||
asm volatile(
|
||||
"{\n\t"
|
||||
".reg .pred p;\n\t"
|
||||
"setp.ne.b32 p, %4, 0;\n\t"
|
||||
#if (__CUDACC_VER_MAJOR__ > 12) || (__CUDACC_VER_MAJOR__ == 12 && __CUDACC_VER_MINOR__ >= 9)
|
||||
"tcgen05.mma.cta_group::1.kind::mxf4nvf4.block_scale.block16 [%0], %1, %2, %3, [%5], [%6], p; \n\t"
|
||||
#else
|
||||
"tcgen05.mma.cta_group::1.kind::mxf4nvf4.block_scale.scale_vec::4X [%0], %1, %2, %3, [%5], [%6], p; \n\t"
|
||||
#endif
|
||||
"}\n"
|
||||
:
|
||||
: "r"(tmem_c), "l"(desc_a), "l"(desc_b), "r"(uint32_t(idescE>>32)), "r"(scaleC),
|
||||
"r"(tsfa_addr), "r"(tsfb_addr));
|
||||
}
|
||||
}
|
||||
else if constexpr (VS == 32) {
|
||||
if (cute::elect_one_sync()) {
|
||||
asm volatile(
|
||||
"{\n\t"
|
||||
".reg .pred p;\n\t"
|
||||
"setp.ne.b32 p, %4, 0;\n\t"
|
||||
#if (__CUDACC_VER_MAJOR__ > 12) || (__CUDACC_VER_MAJOR__ == 12 && __CUDACC_VER_MINOR__ >= 9)
|
||||
"tcgen05.mma.cta_group::1.kind::mxf4nvf4.block_scale.block32 [%0], %1, %2, %3, [%5], [%6], p; \n\t"
|
||||
#else
|
||||
"tcgen05.mma.cta_group::1.kind::mxf4nvf4.block_scale.scale_vec::2X [%0], %1, %2, %3, [%5], [%6], p; \n\t"
|
||||
#endif
|
||||
"}\n"
|
||||
:
|
||||
: "r"(tmem_c), "l"(desc_a), "l"(desc_b), "r"(uint32_t(idescE>>32)), "r"(scaleC),
|
||||
"r"(tsfa_addr), "r"(tsfb_addr));
|
||||
}
|
||||
}
|
||||
#else
|
||||
CUTE_INVALID_CONTROL_PATH("Attempting to use SM103_MXF4_ULTRA_SS_VS without CUTE_ARCH_MMA_SM103A_ENABLED");
|
||||
#endif
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
template <class a_type, class b_type, class c_type, class sf_type,
|
||||
int M, int N, int VS, UMMA::Major a_major, UMMA::Major b_major,
|
||||
UMMA::ScaleIn a_neg = UMMA::ScaleIn::One, UMMA::ScaleIn b_neg = UMMA::ScaleIn::One>
|
||||
struct SM103_MXF4_ULTRA_2x1SM_SS_VS
|
||||
{
|
||||
static_assert(M == 128 || M == 256, "MMA M-mode size should be 128 or 256 for 2 CTA cluster MMA.");
|
||||
static_assert((N % 16 == 0) && (16 <= N) && (N <= 256), "MMA N-mode size should be a multiple of 16 between 16 and 256.");
|
||||
static_assert(((VS == 32) & (is_same_v<a_type, cutlass::float_e2m1_t> && is_same_v<sf_type, cutlass::float_ue8m0_t>)) || (VS == 16),
|
||||
"Vector size can only be 4x mode (VS=16) or 2x mode (VS=32) for MMA. 2x mode only supports float_e2m1_t for a/b types and ue8m0_t for sf type");
|
||||
|
||||
using DRegisters = void;
|
||||
using ARegisters = uint64_t[1];
|
||||
using BRegisters = uint64_t[1];
|
||||
using CRegisters = uint32_t[1];
|
||||
using SFARegisters = uint32_t[1];
|
||||
using SFBRegisters = uint32_t[1];
|
||||
|
||||
CUTE_HOST_DEVICE static void
|
||||
fma(uint64_t const& desc_a,
|
||||
uint64_t const& desc_b,
|
||||
uint32_t const& tmem_c,
|
||||
uint32_t const& scaleC,
|
||||
uint64_t const& idescE,
|
||||
uint32_t const& tsfa_addr,
|
||||
uint32_t const& tsfb_addr)
|
||||
{
|
||||
#if defined(CUTE_ARCH_TCGEN05_MXF4NVF4_MMA_ULTRA_ENABLED)
|
||||
if constexpr (VS == 16) {
|
||||
if (cute::elect_one_sync()) {
|
||||
asm volatile(
|
||||
"{\n\t"
|
||||
".reg .pred p;\n\t"
|
||||
"setp.ne.b32 p, %4, 0;\n\t"
|
||||
#if (__CUDACC_VER_MAJOR__ > 12) || (__CUDACC_VER_MAJOR__ == 12 && __CUDACC_VER_MINOR__ >= 9)
|
||||
"tcgen05.mma.cta_group::2.kind::mxf4nvf4.block_scale.block16 [%0], %1, %2, %3, [%5], [%6], p; \n\t"
|
||||
#else
|
||||
"tcgen05.mma.cta_group::2.kind::mxf4nvf4.block_scale.scale_vec::4X [%0], %1, %2, %3, [%5], [%6], p; \n\t"
|
||||
#endif
|
||||
"}\n"
|
||||
:
|
||||
: "r"(tmem_c), "l"(desc_a), "l"(desc_b), "r"(uint32_t(idescE>>32)), "r"(scaleC),
|
||||
"r"(tsfa_addr), "r"(tsfb_addr));
|
||||
}
|
||||
}
|
||||
else if constexpr (VS == 32) {
|
||||
if (cute::elect_one_sync()) {
|
||||
asm volatile(
|
||||
"{\n\t"
|
||||
".reg .pred p;\n\t"
|
||||
"setp.ne.b32 p, %4, 0;\n\t"
|
||||
#if (__CUDACC_VER_MAJOR__ > 12) || (__CUDACC_VER_MAJOR__ == 12 && __CUDACC_VER_MINOR__ >= 9)
|
||||
"tcgen05.mma.cta_group::2.kind::mxf4nvf4.block_scale.block32 [%0], %1, %2, %3, [%5], [%6], p; \n\t"
|
||||
#else
|
||||
"tcgen05.mma.cta_group::2.kind::mxf4nvf4.block_scale.scale_vec::2X [%0], %1, %2, %3, [%5], [%6], p; \n\t"
|
||||
#endif
|
||||
"}\n"
|
||||
:
|
||||
: "r"(tmem_c), "l"(desc_a), "l"(desc_b), "r"(uint32_t(idescE>>32)), "r"(scaleC),
|
||||
"r"(tsfa_addr), "r"(tsfb_addr));
|
||||
}
|
||||
}
|
||||
#else
|
||||
CUTE_INVALID_CONTROL_PATH("Attempting to use SM103_MXF4_ULTRA_2x1SM_SS_VS without CUTE_ARCH_MMA_SM103A_ENABLED");
|
||||
#endif
|
||||
}
|
||||
|
||||
};
|
||||
} // namespace SM103
|
||||
|
||||
} // end namespace cute
|
||||
|
||||
@@ -292,4 +292,5 @@ struct SM89_16x8x32_F16E5M2E5M2F16_TN
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace cute
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
#include <cute/config.hpp> // CUTE_HOST_DEVICE
|
||||
#include <cute/arch/mma_sm90_gmma.hpp> // GMMA::Major, etc.
|
||||
|
||||
#include "cutlass/arch/synclog.hpp"
|
||||
|
||||
namespace cute {
|
||||
|
||||
namespace SM90::GMMA::SPARSE {
|
||||
|
||||
Reference in New Issue
Block a user