From 2ba1ef10be6fa12e0d282a38945593d0e53c418f Mon Sep 17 00:00:00 2001 From: Adnan Akhundov Date: Mon, 3 Apr 2023 16:01:12 +0200 Subject: [PATCH] Increase max dynamic SMEM size in GemmSoftmax (#903) --- examples/35_gemm_softmax/gemm_with_softmax.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/examples/35_gemm_softmax/gemm_with_softmax.h b/examples/35_gemm_softmax/gemm_with_softmax.h index 6b2fa99c..d15aaf6a 100644 --- a/examples/35_gemm_softmax/gemm_with_softmax.h +++ b/examples/35_gemm_softmax/gemm_with_softmax.h @@ -578,9 +578,21 @@ public: int gemm_smem_size = int(sizeof(typename GemmKernel::SharedStorage)); + cudaError_t result; + + if (gemm_smem_size >= (48 << 10)) { + result = cudaFuncSetAttribute(cutlass::Kernel, + cudaFuncAttributeMaxDynamicSharedMemorySize, + gemm_smem_size); + + if (result != cudaSuccess) { + return Status::kErrorInternal; + } + } + cutlass::Kernel<<>>(params_.gemm); - cudaError_t result = cudaGetLastError(); + result = cudaGetLastError(); if (result != cudaSuccess) { return cutlass::Status::kErrorInternal;