KEMBAR78
Fix logic errors when accumulating reductions in output (CUDA) by umanwizard · Pull Request #16023 · pytorch/pytorch · GitHub
Skip to content

Conversation

@umanwizard
Copy link
Contributor

@umanwizard umanwizard commented Jan 15, 2019

The correct logic is as follows:

  • If there is an earlier split, we need to combine with its result
  • If there is not a later split, we need to project before saving into the output.

This should partially f i x #15837 . For example:

In [7]: a=torch.ones([1838860800], dtype=torch.float, device="cuda:1")

In [8]: a.mean()
Out[8]: tensor(1., device='cuda:1')

@umanwizard umanwizard requested a review from colesbury January 15, 2019 01:31
@soumith soumith added this to the 1.0.1 milestone Jan 15, 2019
Copy link
Member

@colesbury colesbury left a comment

Choose a reason for hiding this comment

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

Can you add a regression test?

Copy link
Member

@colesbury colesbury left a comment

Choose a reason for hiding this comment

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

Can you add a regression test?

@umanwizard
Copy link
Contributor Author

yep, will do so before landing.

@umanwizard umanwizard changed the title Fix logic errors when accumulating reductions in output Fix logic errors when accumulating reductions in output (CUDA) Jan 15, 2019
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.

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

zdevito pushed a commit to zdevito/ATen that referenced this pull request Jan 16, 2019
Summary:
The correct logic is as follows:

* If there is an earlier split, we need to combine with its result
* If there is *not* a later split, we need to project before saving into the output.

This should partially f i x #15837  . For example:
```
In [7]: a=torch.ones([1838860800], dtype=torch.float, device="cuda:1")

In [8]: a.mean()
Out[8]: tensor(1., device='cuda:1')
```
Pull Request resolved: pytorch/pytorch#16023

Differential Revision: D13678449

Pulled By: umanwizard

fbshipit-source-id: ab5078484c88e96bb30121b5cf24a0e8b0a8c2f8
@soumith soumith added the cherry-picked This PR was cherry-picked onto a release branch from master label Jan 17, 2019
@ezyang ezyang added the merged label Jun 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-picked This PR was cherry-picked onto a release branch from master

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants