Simplify USE_CUBLAS in config.cmake

Since cuBLAS is along with CUDA, everyone who has installed CUDA should have cuBLAS available as well. It seems not necessary to let user specify USE_CUDA and USE_CUBLAS separately. What happened to me was that I forgot to enable cuBLAS when I was building TVM, and later on I got the following runtime error:

File "tvm/src/runtime/module_util.cc", line 73
TVMError: Check failed: ret == 0 (-1 vs. 0) : Assert fail: (dev_type == 2), device_type need to be 2

I spent some time on figuring out what this error means and re-built TVM with USE_CUBLAS ON. After that the problem was resolved. Accordingly, Iā€™d like to suggest we either automatically turn cuBLAS on when building TVM if USE_CUDA is ON, or at least refine the error message when cuBLAS is unavailable for the TVM runtime.

@tqchen @haichen @Laurawly do you have any suggestions?

Thanks.

3 Likes

Hi @comaniac

I think current error message cannot reflect this situation directly so far, maybe we should consider a better way to provide detailed error message in case someone spend too much time to identify the misconfiguration.

It is indeed something we can improve. have a clear error message seems to be a good first step

Make sense. Will look into this when I get chance.

Hi @comaniac

I would appreciate if you could provide the minimum code to reproduce the error.

many thanks,