Skip to content
Open
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
11 changes: 8 additions & 3 deletions transformer_engine/common/comm_gemm/comm_gemm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,9 @@ void GemmRsInitMatrices(NVTECommGemmCtx* ctx, int64_t* ldd, int64_t m, int64_t n
}
if (transb) {
NVTE_CHECK(b1 == n, "Unsupported tensor dimension in B: expected ", n, ", got ", b1);
NVTE_CHECK_CUBLASMP(cublasMpMatrixDescriptorInit(
n, k, block_size(ctx, n), block_size(ctx, k), 0, 0, block_size(ctx, n),
get_cuda_dtype(b->dtype()), ctx->grid_row_major.get(), ctx->b_desc.get()));
NVTE_CHECK_CUBLASMP(cublasMpMatrixDescriptorInit(n, k, block_size(ctx, n), block_size(ctx, k),
0, 0, n, get_cuda_dtype(b->dtype()),
ctx->grid_row_major.get(), ctx->b_desc.get()));
} else {
NVTE_CHECK(b0 == n, "Unsupported tensor dimension in B: expected ", n, ", got ", b0);
NVTE_CHECK_CUBLASMP(cublasMpMatrixDescriptorInit(
Expand All @@ -200,6 +200,11 @@ void GemmRsInitMatrices(NVTECommGemmCtx* ctx, int64_t* ldd, int64_t m, int64_t n
NVTE_CHECK_CUBLASMP(cublasMpMatrixDescriptorInit(m, n, m, block_size(ctx, n), 0, 0, *ldd,
get_cuda_dtype(d->dtype()),
ctx->grid_row_major.get(), ctx->d_desc.get()));

const cudaDataType_t comm_type = get_cuda_dtype(d->dtype());
NVTE_CHECK_CUBLASMP(cublasMpMatmulDescriptorSetAttribute(
ctx->matmul_desc.get(), CUBLASMP_MATMUL_DESCRIPTOR_ATTRIBUTE_COMMUNICATION_TYPE, &comm_type,
sizeof comm_type));
}

void GemmArInitMatrices(NVTECommGemmCtx* ctx, int64_t* ldd, int64_t m, int64_t n, int64_t k,
Expand Down
Loading