Skip to content

Reduce memory requirement for test_argminmax_large_axis#40036

Closed
peterbell10 wants to merge 1 commit intopytorch:masterfrom
peterbell10:large-axis-memory-usage
Closed

Reduce memory requirement for test_argminmax_large_axis#40036
peterbell10 wants to merge 1 commit intopytorch:masterfrom
peterbell10:large-axis-memory-usage

Conversation

@peterbell10
Copy link
Collaborator

Closes gh-39060

The TensorIterator splitting is based on can_use_32bit_indexing which assumes 32-bit signed ints, so we can get away with just 2**31 as the axis length. Also tested on an old commit that I can reproduce the test failure on just a 1d tensor, overall quartering the memory requirement for the test.

int64_t max_value = std::numeric_limits<int32_t>::max();

For reference, the test was first added in gh-33310.

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.

@ezyang is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@ezyang merged this pull request in ad86c94.

xwang233 pushed a commit to xwang233/pytorch that referenced this pull request Jun 20, 2020
Summary:
Closes pytorchgh-39060

The `TensorIterator` splitting is based on `can_use_32bit_indexing` which assumes 32-bit signed ints, so we can get away with just 2**31 as the axis length. Also tested on an old commit that I can reproduce the test failure on just a 1d tensor, overall quartering the memory requirement for the test.

https://github.com/pytorch/pytorch/blob/4c7d81f8479bce320cc11d1eb3adaf8ab0b90099/aten/src/ATen/native/TensorIterator.cpp#L879

For reference, the test was first added in pytorchgh-33310.
Pull Request resolved: pytorch#40036

Differential Revision: D22068690

Pulled By: ezyang

fbshipit-source-id: 83199fd31647d1ef106b08f471c0e9517d3516e3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test_argminmax_large_axis_cuda is broken

4 participants