NVIDIA / CUDALibrarySamples

CUDA Library Samples
Other
1.62k stars 348 forks source link

cuSPARSELt API errors cusparseLtMatmulDescriptorInit #195

Closed pna961 closed 4 months ago

pna961 commented 4 months ago

CHECK_CUSPARSE( cusparseLtMatmulDescriptorInit( handle.get(), &matmul, opA, opB, &matA, &matB, &matC, &matC, compute_type) ) Cry for help:when I use cuSPARSELt API to do 2:4 SPGEMM, the cusparseLtMatmulDescriptorInit always has errors as follows: "On entry to cusparseLtMatmulDescriptorInit() parameter number 9 (computeType) had an illegal value: (cusparseComputeType) UNKNOWN=(cusparseComputeType) 2". Strangely, when compute_type=CUSPARSE_COMPUTE_32F and no matter what type of A, B or C is, it's always the same error. I have already updated newest cuSPARSELt version(0.6.1). PS: I was implementing 2:4 spgemm plugins in TensorRT-LLM. The code is written in enqueue function.

j4yan commented 4 months ago

@pna961 What's your types of A, B, C? Is it possible to make a reproducer?

pna961 commented 4 months ago

@j4yan ummm.....Problems already solved. Anyway, type_AB = CUDA_R_16F; type_C = CUDA_R_16F; computeType = CUSPARSE_COMPUTE_32F. Actually, it's not the code that went wrong. It's because that I'm using pybind11 and forget to link libcusparseLt.so to the project. Also because I included as header files, the compiler doesn't report any errors or warnings when compiling the project. But when running the project, the errors appeared. After I link the library, it works smoothly.

j4yan commented 4 months ago

@pna961 Good to know. We can close.