一 使用
1.1 makefile
compile:
nvcc -arch=sm_90a -lcuda -lcublas -std=c++17 matmul_h100_optimal.cu -o test
run:
./test
加入-lcublas,不然会有函数无法被识别
二 代码分析
2.1 kernel外参数分析
2.1.1 基本参数
constexpr int BM = 64*2;
constexpr int BN = 256;
constexpr int BK = 64;
constexpr int NUM_THREADS = 128*3;
constexpr int QSIZE = 3;
constexpr int CLUSTER_M = 2;
constexpr int CLUSTER_N = 1;
constexpr int NUM_SM = 128;
static_assert(NUM_SM % (CLUSTER_M*CLUSTER_N) == 0);
2.1.2 SMem结构体
template <int BM, int BN, int BK, int QSIZE&