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

Benchmarks: micro benchmarks - add int8 support for cublaslt function #574

Merged
merged 5 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
update format
  • Loading branch information
yukirora committed Nov 17, 2023
commit 089f0b9153390531201ee274a9b22aa21082441b
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ using bf16 = nv_bfloat16;
using fp8e4m3 = __nv_fp8_e4m3;
using fp8e5m2 = __nv_fp8_e5m2;
using int8= int8_t;
yukirora marked this conversation as resolved.
Show resolved Hide resolved

struct Args {
int m = 16;
int n = 16;
Expand Down Expand Up @@ -85,7 +86,7 @@ template <typename T> cudaDataType_t get_datatype() {
if (std::is_same<T, fp8e5m2>::value)
return CUDA_R_8F_E5M2;
if (std:: is_same<T, int8>::value)
yukirora marked this conversation as resolved.
Show resolved Hide resolved
return CUDA_R_8I;
return CUDA_R_8I;
throw std::invalid_argument("Unknown type");
}

Expand Down Expand Up @@ -165,7 +166,7 @@ int main(int argc, char **argv) {
else if (args.in_type == "fp8e5m2")
run<fp8e5m2, fp8e4m3, fp16>(&args);
else if (args.in_type == "int8")
run<int8>(&args);
run<int8>(&args);
else
throw std::invalid_argument("Unknown type " + args.in_type);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ void cublasLtGemm::Setup(int m, int n, int k, int batch, int lda, int ldb, int l
if (a_type == CUDA_R_64F || b_type == CUDA_R_64F)
gemm_compute_type = CUBLAS_COMPUTE_64F;
if (a_type==CUDA_R_8I)
yukirora marked this conversation as resolved.
Show resolved Hide resolved
gemm_compute_type = CUBLAS_COMPUTE_32I;
gemm_compute_type = CUBLAS_COMPUTE_32I;

cublasLtMatmulDesc_t op_desc = nullptr;
CUBLAS_CHECK(cublasLtMatmulDescCreate(&op_desc, gemm_compute_type, CUDA_R_32F));
op_desc_.reset(op_desc);
Expand Down
Loading