Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix gemm_float8 build failure on CUDA 11.3-11.7 #18760

Merged
merged 2 commits into from
Dec 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions onnxruntime/contrib_ops/cuda/math/gemm_float8.cu
Original file line number Diff line number Diff line change
Expand Up @@ -251,15 +251,21 @@ Status GemmFloat8::ComputeGemm(
CUBLAS_RETURN_IF_ERROR(cublasLtMatmulDescSetAttribute(
operationDesc, CUBLASLT_MATMUL_DESC_TRANSB, &ctransb, sizeof(ctransb)));

#if CUDA_VERSION >= 11060
// CUBLASLT_MATMUL_DESC_SM_COUNT_TARGET exists from https://docs.nvidia.com/cuda/archive/11.6.0/pdf/CUBLAS_Library.pdf
if (sm_count_ != 0) {
int math_sm_count = static_cast<int>(sm_count_);
CUBLAS_RETURN_IF_ERROR(cublasLtMatmulDescSetAttribute(
operationDesc, CUBLASLT_MATMUL_DESC_SM_COUNT_TARGET, &math_sm_count,
sizeof(math_sm_count)));
}
#endif

if (has_scales) {
// gemm float 8
#if CUDA_VERSION >= 11080
// CUBLASLT_MATMUL_DESC_FAST_ACCUM, CUBLASLT_MATMUL_DESC_A_SCALE_POINTER, CUBLASLT_MATMUL_DESC_B_SCALE_POINTER,
// CUBLASLT_MATMUL_DESC_D_SCALE_POINTER exist from https://docs.nvidia.com/cuda/archive/11.8.0/pdf/CUBLAS_Library.pdf
const int8_t ifast_accumulation_mode = 1;
CUBLAS_RETURN_IF_ERROR(cublasLtMatmulDescSetAttribute(
operationDesc,
Expand All @@ -274,6 +280,7 @@ Status GemmFloat8::ComputeGemm(
CUBLAS_RETURN_IF_ERROR(cublasLtMatmulDescSetAttribute(
operationDesc, CUBLASLT_MATMUL_DESC_D_SCALE_POINTER, &p_scale_y,
sizeof(p_scale_b)));
#endif

// float 8
#if !defined(DISABLE_FLOAT8_TYPES)
Expand Down
Loading