Check for maximum numel in NCCL broadcasting#11466
Closed
ssnl wants to merge 3 commits intopytorch:masterfrom
Closed
Check for maximum numel in NCCL broadcasting#11466ssnl wants to merge 3 commits intopytorch:masterfrom
ssnl wants to merge 3 commits intopytorch:masterfrom
Conversation
soumith
reviewed
Sep 10, 2018
torch/csrc/cuda/nccl.cpp
Outdated
| } | ||
|
|
||
| namespace { | ||
| // NCCL changed the umerical type used for count between NCCL1 and NCCL2. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
soumith
approved these changes
Sep 10, 2018
Contributor
facebook-github-bot
left a comment
There was a problem hiding this comment.
SsnL has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Contributor
facebook-github-bot
left a comment
There was a problem hiding this comment.
SsnL has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
PenghuiCheng
pushed a commit
to PenghuiCheng/pytorch
that referenced
this pull request
Sep 11, 2018
Summary: NCCL1 uses `int` as its numerical type for fields like `count`, which makes broadcasting tensors larger than `2 << 31 - 1` impossible, and raises opaque error `invalid arguments`. NCCL2 greatly increase the limit on many platforms by using `size_t`. This patch statically detects this type, and raises properly if the broadcast tensor exceeds the limit. No test because I don't think our test suite should broadcast big tensors. Pull Request resolved: pytorch#11466 Differential Revision: D9754753 Pulled By: SsnL fbshipit-source-id: 73506450cae047e06b5b225b39efdb42d5d26685
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NCCL1 uses
intas its numerical type for fields likecount, which makes broadcasting tensors larger than2 << 31 - 1impossible, and raises opaque errorinvalid arguments. NCCL2 greatly increase the limit on many platforms by usingsize_t. This patch statically detects this type, and raises properly if the broadcast tensor exceeds the limit.No test because I don't think our test suite should broadcast big tensors.