Skip to content

Conversation

malfet
Copy link
Contributor

@malfet malfet commented Aug 4, 2020

This fixes feature regression introduced by #42412 which limited all the use of the API to CUDA-11.0+

@malfet malfet requested review from ezyang, ngimel and xwang233 August 4, 2020 19:25
malfet added 2 commits August 4, 2020 12:26
This fixes feature regression introduced by pytorch#42412 which limited all the use of the API to CUDA-11.0+
@malfet malfet force-pushed the malfet/reenable-cusparse-Xcsrmm2-on-CUDA-10.2 branch from 62aeac8 to 078bc51 Compare August 4, 2020 19:26
@dr-ci
Copy link

dr-ci bot commented Aug 4, 2020

💊 CI failures summary and remediations

As 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 viable/strict branch (expand for instructions)

Since your merge base is older than viable/strict, run these commands:

git fetch https://github.com/pytorch/pytorch viable/strict
git rebase FETCH_HEAD

Check out the recency history of this "viable master" tracking branch.


ci.pytorch.org: 1 failed


This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group.

See how this bot performed.

This comment has been revised 5 times.

Copy link
Collaborator

@xwang233 xwang233 left a 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!

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a 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.

@facebook-github-bot
Copy link
Contributor

@malfet merged this pull request in 3c7fccc.

// 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__) && \
Copy link
Collaborator

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.

Copy link
Collaborator

@peterjc123 peterjc123 Aug 6, 2020

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

Copy link
Collaborator

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.

Copy link
Collaborator

@peterjc123 peterjc123 Aug 6, 2020

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

Copy link
Contributor Author

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.

@malfet malfet deleted the malfet/reenable-cusparse-Xcsrmm2-on-CUDA-10.2 branch August 6, 2020 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants