Skip to content

Conversation

@Kiyosora
Copy link
Contributor

@Kiyosora Kiyosora commented Nov 19, 2020

Fixes #48114

Before:

>>> torch.empty(2 * 10 ** 20)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: empty(): argument 'size' must be tuple of ints, but found element of type int at pos 1

After fix:

>>> torch.empty(2 * 10 ** 20)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: Overflow when unpacking long

Unclear whether we need a separate test for this case, I can add one if it's necessary...

@dr-ci
Copy link

dr-ci bot commented Nov 19, 2020

💊 CI failures summary and remediations

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


  • 2/2 failures possibly* introduced in this PR
    • 2/2 non-CircleCI failure(s)

Extra GitHub checks: 1 failed


codecov.io: 1 failed


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

@codecov
Copy link

codecov bot commented Nov 19, 2020

Codecov Report

Merging #48250 (e3f3a36) into master (22c6daf) will increase coverage by 0.01%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master   #48250      +/-   ##
==========================================
+ Coverage   80.61%   80.62%   +0.01%     
==========================================
  Files        1875     1875              
  Lines      202765   202769       +4     
==========================================
+ Hits       163467   163492      +25     
+ Misses      39298    39277      -21     

@Kiyosora Kiyosora changed the title [WIP] Fix bad error message when int overflow Fix bad error message when int overflow Nov 19, 2020
@Kiyosora Kiyosora marked this pull request as ready for review November 19, 2020 14:18
@izdeby izdeby requested review from ezyang and izdeby November 19, 2020 22:44
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.

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

@izdeby izdeby added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Nov 19, 2020
@Kiyosora
Copy link
Contributor Author

Hey, @izdeby ! Thanks for reviewing this PR.
I rebased it on the latest code, since it has been a while.
BTW, if there still have something I can do for this PR, I‘d like to be the assist. 😄

@Kiyosora
Copy link
Contributor Author

@izdeby @ezyang Gentle ping.
I have rebased the code, please kindly take a look if it's convient for you.

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 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@Kiyosora Kiyosora deleted the fix_int_overflows branch December 17, 2020 01:35
@facebook-github-bot
Copy link
Contributor

@ezyang merged this pull request in c675727.

@facebook-github-bot
Copy link
Contributor

This pull request has been reverted by eb131cf.

hwangdeyu pushed a commit to hwangdeyu/pytorch that referenced this pull request Jan 6, 2021
Summary:
Fixes pytorch#48114

Before:
```
>>> torch.empty(2 * 10 ** 20)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: empty(): argument 'size' must be tuple of ints, but found element of type int at pos 1
```

After fix:
```
>>> torch.empty(2 * 10 ** 20)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: Overflow when unpacking long
```

Unclear whether we need a separate test for this case, I can add one if it's necessary...

Pull Request resolved: pytorch#48250

Reviewed By: linbinyu

Differential Revision: D25105217

Pulled By: ezyang

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

Labels

cla signed Merged open source Reverted 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.

Bad error message when int overflows

4 participants