Reenable cusparse SpMM on cuda 10.2#42556
Conversation
This fixes feature regression introduced by pytorch#42412 which limited all the use of the API to CUDA-11.0+
62aeac8 to
078bc51
Compare
💊 CI failures summary and remediationsAs of commit 078bc51 (more details on the Dr. CI page):
🚧 1 fixed upstream failure:These were probably caused by upstream breakages that were already fixed.
Please rebase on the
|
xwang233
left a comment
There was a problem hiding this comment.
Thank you so much for the update!
facebook-github-bot
left a comment
There was a problem hiding this comment.
@malfet has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
| // Using these APIs in any other systems will result in compile-time or run-time failures. | ||
| // Their support will be extended in the next releases. | ||
|
|
||
| #define IS_SPMM_AVAILABLE() (defined(__CUDACC__) && \ |
There was a problem hiding this comment.
Hey @malfet , looks like this macro caused the Windows failure. The weird thing is that if I replace IS_SPMM_AVAILABLE() with the content in it, it works.
There was a problem hiding this comment.
#include <iostream>
#include <cusparse.h>
using namespace std;
#define IS_SPMM_AVAILABLE() (defined(__CUDACC__) && \
(CUSPARSE_VERSION >= 11100 || \
(!defined(_MSC_VER) && CUSPARSE_VERSION >= 10301)))
int main() {
cout << CUSPARSE_VERSION << endl;
cout << __CUDACC__ << endl;
cout << _MSC_VER << endl;
cout << (__CUDACC__ > 0 && CUSPARSE_VERSION >= 11000) << endl;
cout << (_MSC_VER > 0 && CUSPARSE_VERSION >= 10301) << endl;
#if (defined(__CUDACC__) && (CUSPARSE_VERSION >= 11100 || (!defined(_MSC_VER) && CUSPARSE_VERSION >= 10301)))
cout << "hey" << endl;
#endif
#if IS_SPMM_AVAILABLE()
cout << "yes" << endl;
return 0;
#else
cout << "no" << endl;
return 1;
#endif
}gives the output:
11100
1
1926
1
1
hey
no
There was a problem hiding this comment.
I found something similar cisco/cjose#63.
A fix is at #42643.
There was a problem hiding this comment.
#define __CUDACC__ 1
#define IS_CUDACC() defined(__CUDACC__)
#if defined(__CUDACC__)
#error works
#endif
#if IS_CUDACC()
#error this one doesn't work
#endifThere was a problem hiding this comment.
@peterjc123 yeah, I keep forgetting about this, but defined() is not a macro that returns a value nor is it a function.
This fixes feature regression introduced by #42412 which limited all the use of the API to CUDA-11.0+