Skip to content

Conversation

@goldsborough
Copy link
Contributor

Some users are using torch._C.has_cudnn to determine if cudnn is available (e.g. https://github.com/pytorch/pytorch/pull/8313/files#diff-52a3dcb763bfba3076c1cc8aef9b1e72R17). There should probably be a friendlier way of doing this. This PR adds this function.

Please advise if torch._C.has_cudnn is ok, or better torch.backends.cudnn.is_acceptable(torch.tensor(1., device=CUDA_DEVICE)) which I've seen in other code.

@soumith @apaszke @colesbury

This comment was marked as off-topic.

This comment was marked as off-topic.

@ssnl
Copy link
Collaborator

ssnl commented Jun 20, 2018

Why is this under torch.cuda instead of torch.backends.cudnn? What's the general guideline here?

I'm asking because I'm adding some cuFFT specific methods in #8344 and want to know where they should live.

@apaszke
Copy link
Contributor

apaszke commented Jun 20, 2018

Yeah, why are we duplicating this? We have torch.backends.cudnn.is_available()

@goldsborough
Copy link
Contributor Author

@apaszke I don't think this function you mention exists?

I don't mind where it lives, just let me know what you would prefer

@ssnl
Copy link
Collaborator

ssnl commented Jun 20, 2018

@apaszke we only have torch.backends.mkl.is_available(). IMO, it would be better for this to be torch.backends.cudnn.is_available().

@goldsborough
Copy link
Contributor Author

done

@goldsborough goldsborough changed the title Add torch.cuda.cudnn_is_available Add torch.backends.cudnn.is_available Jun 20, 2018
@apaszke
Copy link
Contributor

apaszke commented Jun 20, 2018

Hmm ok, I could swear it exists 😕 Adding it sounds good to me

@goldsborough goldsborough merged commit 0acddd6 into pytorch:master Jun 20, 2018
petrex pushed a commit to petrex/pytorch that referenced this pull request Jun 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants