Skip to content

Conversation

@malfet
Copy link
Contributor

@malfet malfet commented Sep 29, 2020

Fix torch._C._autocast_*_nesting declarations in init.pyi

Fix iterable constructor logic: not every iterable can be constructed using type(val)(val) trick, for example it would not work for val=range(10) although isinstance(val, Iterable) is True
Change optional resolution logic to meet mypy expectations

Fixes #45436

@malfet malfet added module: typing Related to mypy type annotations triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module labels Sep 29, 2020
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.

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

@dr-ci
Copy link

dr-ci bot commented Sep 29, 2020

💊 CI failures summary and remediations

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


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

🕵️ 2 new failures recognized by patterns

The following CI failures do not appear to be due to upstream breakages:

See CircleCI build pytorch_linux_xenial_py3_clang5_android_ndk_r19c_vulkan_x86_32_build (1/2)

Step: "Set Up CI Environment After attach_workspace" (full log | diagnosis details | 🔁 rerun)

E: Unable to locate package expect-dev
E: Unable to locate package expect-dev 
+ sudo apt-get -y install moreutils expect-dev 
Reading package lists... 100%  Reading package lists... Done  
Building dependency tree... 50%  Building dependency tree         
Reading state information... 0%  Reading state information... Done  
Package moreutils is not available, but is referred to by another package. 
This may mean that the package is missing, has been obsoleted, or 
is only available from another source 
 
E: Package 'moreutils' has no installation candidate 
E: Unable to locate package expect-dev 

See CircleCI build pytorch_linux_bionic_rocm3_7_py3_6_build (2/2)

Step: "Set Up CI Environment After attach_workspace" (full log | diagnosis details | 🔁 rerun)

E: Unable to locate package expect-dev
E: Unable to locate package expect-dev 
+ sudo apt-get -y install moreutils expect-dev 
Reading package lists... 100%  Reading package lists... Done  
Building dependency tree... 50%  Building dependency tree         
Reading state information... 0%  Reading state information... Done  
Package moreutils is not available, but is referred to by another package. 
This may mean that the package is missing, has been obsoleted, or 
is only available from another source 
 
E: Package 'moreutils' has no installation candidate 
E: Unable to locate package expect-dev 

1 failure confirmed as flaky and can be ignored:

  • pytorch_bazel_build

ci.pytorch.org: 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 9 times.

@codecov
Copy link

codecov bot commented Sep 29, 2020

Codecov Report

Merging #45480 into master will decrease coverage by 0.01%.
The diff coverage is 15.90%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #45480      +/-   ##
==========================================
- Coverage   68.47%   68.46%   -0.02%     
==========================================
  Files         405      405              
  Lines       51821    51836      +15     
==========================================
+ Hits        35485    35489       +4     
- Misses      16336    16347      +11     
Impacted Files Coverage Δ
torch/cuda/amp/autocast_mode.py 18.30% <0.00%> (-0.81%) ⬇️
torch/cuda/amp/grad_scaler.py 24.40% <17.50%> (+0.54%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 208df1a...51ba7b5. Read the comment docs.

Fix `torch._C._autocast_*_nesting` declarations in __init__.pyi

Fix iterable constructor logic: not every iterable can be constructed using `type(val)(val)` trick, for example it would not work for `val=range(10)` although `isinstance(val, Iterable)` is True
Change optional resolution logic to meet mypy expectations
@malfet malfet force-pushed the malfet/enable-torch.cuda.amp-typechecking branch from a085ec6 to 51ba7b5 Compare September 29, 2020 14:19
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.

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

@rgommers
Copy link
Collaborator

This crash may be related:

test_autocast_torch_fp32 (__main__.TestCuda) ... Memory exception on virtual address 0x0, node id 4 : Page not present

The pytorch-linux-bionic-rocm3.7-py3.6 job is failing on other PRs right now, but not with this crash.

Other than that, LGTM.

@malfet
Copy link
Contributor Author

malfet commented Sep 29, 2020

This crash may be related:

test_autocast_torch_fp32 (__main__.TestCuda) ... Memory exception on virtual address 0x0, node id 4 : Page not present

This is currently broken on master, so hopefully unrelated.

@facebook-github-bot
Copy link
Contributor

@malfet merged this pull request in b3135c2.

@malfet malfet deleted the malfet/enable-torch.cuda.amp-typechecking branch September 30, 2020 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged module: typing Related to mypy type annotations 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.

Enable torch.cuda.amp typechecking during CI

5 participants