-
Notifications
You must be signed in to change notification settings - Fork 25.4k
Reenable cusparse SpMM on cuda 10.2 #42556
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
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
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for the update!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found something similar cisco/cjose#63.
A fix is at #42643.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#define __CUDACC__ 1
#define IS_CUDACC() defined(__CUDACC__)
#if defined(__CUDACC__)
#error works
#endif
#if IS_CUDACC()
#error this one doesn't work
#endif
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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+