Skip to content

Conversation

@peterbell10
Copy link
Collaborator

Fixes gh-42282

This adds a device-mismatch check to addmm on CPU and CUDA. Although it seems like the dispatcher is always selecting the CUDA version here if any of the inputs are on GPU. So in theory the CPU check is unnecessary, but probably better to err on the side of caution.

@dr-ci
Copy link

dr-ci bot commented Aug 24, 2020

💊 CI failures summary and remediations

As of commit e303390 (more details on the Dr. CI page):


💚 💚 Looks good so far! There are no failures yet. 💚 💚


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 8 times.

@ngimel ngimel self-requested a review August 25, 2020 03:50
@ngimel ngimel added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Aug 25, 2020
@ezyang ezyang removed their request for review August 25, 2020 20:21
@ezyang
Copy link
Contributor

ezyang commented Aug 25, 2020

letting @ngimel handle this one

Copy link
Collaborator

@ngimel ngimel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks, I have minor comments

auto m2_strides = m2.strides();
auto m2_sizes = m2.sizes();

TORCH_CHECK(self.device() == kCPU && m1.device() == kCPU &&
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed, multidispatch will always send to cuda if one of the tensors is cuda, so this is not needed

@peterbell10 peterbell10 force-pushed the matmul-device-mismatch branch from 0a32767 to d53064b Compare August 25, 2020 23:03
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.

@ngimel has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

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.

@ngimel has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@ngimel merged this pull request in 42f6c3b.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged open source triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cudaErrorIllegalAddress printing result of torch.nn.Linear(1, 1).cuda()(torch.Tensor([[0.5]]))

5 participants