Skip to content

Add Ellipsis constant to the list of recognized tokens#44959

Closed
malfet wants to merge 2 commits intopytorch:masterfrom
malfet:malfet/jit-add-ellipsis-built-in-constant
Closed

Add Ellipsis constant to the list of recognized tokens#44959
malfet wants to merge 2 commits intopytorch:masterfrom
malfet:malfet/jit-add-ellipsis-built-in-constant

Conversation

@malfet
Copy link
Copy Markdown
Contributor

@malfet malfet commented Sep 18, 2020

Per https://docs.python.org/3.6/library/constants.html

Ellipsis is the same as ellipsis literal ...

`Ellipsis` is the same as ellipsis literl `...`
@malfet malfet requested a review from apaszke as a code owner September 18, 2020 16:36
@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Sep 18, 2020
Copy link
Copy Markdown
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.

@malfet malfet changed the title Add Ellipsis constant to the list of recognized token Add Ellipsis constant to the list of recognized tokens Sep 18, 2020
@SplitInfinity
Copy link
Copy Markdown

What's the motivation for this? Is there a particular example of code that does not compile but should compile? We should probably add tests for this.

@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 18, 2020

Codecov Report

Merging #44959 into master will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #44959   +/-   ##
=======================================
  Coverage   67.85%   67.86%           
=======================================
  Files         384      384           
  Lines       49919    49919           
=======================================
+ Hits        33873    33876    +3     
+ Misses      16046    16043    -3     
Impacted Files Coverage Δ
torch/testing/_internal/expecttest.py 78.57% <0.00%> (+1.02%) ⬆️
torch/utils/_benchmark/utils/common.py 79.33% <0.00%> (+1.65%) ⬆️

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 07b7e44...3ae1ee1. Read the comment docs.

Copy link
Copy Markdown
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.

@malfet
Copy link
Copy Markdown
Contributor Author

malfet commented Sep 18, 2020

@SplitInfinity this PR is a prep for a bigger effort to add homogenous tuple support to jit script, see #44774

In particularly this PR (or #44958 ) prevents a crash while trying to parse Tuple[int, Ellipsis] type

@dr-ci
Copy link
Copy Markdown

dr-ci Bot commented Sep 18, 2020

💊 CI failures summary and remediations

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



🕵️ 1 new failure recognized by patterns

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

See CircleCI build pytorch_linux_xenial_py3_6_gcc5_4_ge_config_simple_test (1/1)

Step: "Run tests" (full log | diagnosis details | 🔁 rerun)

Sep 19 00:16:50 [E request_callback_no_python.cpp:618] Received error while processing request type 2: RuntimeError: Can not pickle torch.futures.Future
Sep 19 00:16:50 At: 
Sep 19 00:16:50   /opt/conda/lib/python3.6/site-packages/torch/distributed/rpc/internal.py(94): serialize 
Sep 19 00:16:50   /opt/conda/lib/python3.6/site-packages/torch/distributed/rpc/internal.py(146): serialize 
Sep 19 00:16:50  
Sep 19 00:16:50 [E request_callback_no_python.cpp:618] Received error while processing request type 2: RuntimeError: Can not pickle torch.futures.Future 
Sep 19 00:16:50  
Sep 19 00:16:50 At: 
Sep 19 00:16:50   /opt/conda/lib/python3.6/site-packages/torch/distributed/rpc/internal.py(94): serialize 
Sep 19 00:16:50   /opt/conda/lib/python3.6/site-packages/torch/distributed/rpc/internal.py(146): serialize 
Sep 19 00:16:50  
Sep 19 00:16:50 [E request_callback_no_python.cpp:618] Received error while processing request type 2: RuntimeError: Can not pickle torch.futures.Future 
Sep 19 00:16:50  
Sep 19 00:16:50 At: 
Sep 19 00:16:50   /opt/conda/lib/python3.6/site-packages/torch/distributed/rpc/internal.py(94): serialize 
Sep 19 00:16:50   /opt/conda/lib/python3.6/site-packages/torch/distributed/rpc/internal.py(146): serialize 
Sep 19 00:16:50  
Sep 19 00:16:50 [W tensorpipe_agent.cpp:577] RPC agent for worker3 encountered error when reading incoming request from worker0: EOF: end of file (this is expected to happen during shutdown) 
Sep 19 00:16:50 [W tensorpipe_agent.cpp:577] RPC agent for worker2 encountered error when reading incoming request from worker1: EOF: end of file (this is expected to happen during shutdown) 
Sep 19 00:16:50 [W tensorpipe_agent.cpp:577] RPC agent for worker0 encountered error when reading incoming request from worker1: EOF: end of file (this is expected to happen during shutdown) 
Sep 19 00:16:50 ok (1.537s) 
Sep 19 00:16:52   test_return_future_remote (__main__.TensorPipeRpcTestWithSpawn) ... [W tensorpipe_agent.cpp:577] RPC agent for worker2 encountered error when reading incoming request from worker0: EOF: end of file (this is expected to happen during shutdown) 

❄️ 2 failures tentatively classified as flaky

but reruns have not yet been triggered to confirm:

See CircleCI build pytorch_windows_vs2019_py36_cuda10.1_test2 (1/2)

Step: "Test" (full log | diagnosis details | 🔁 rerun) ❄️

ModuleNotFoundError: No module named 'torch'
[ERROR:VsDevCmd.bat] vsdevcmd.bat [args] for additional details. 
[ERROR:VsDevCmd.bat] Where [value] is: 
[ERROR:VsDevCmd.bat]    1 : basic debug logging 
[ERROR:VsDevCmd.bat]    2 : detailed debug logging 
[ERROR:VsDevCmd.bat]    3 : trace level logging. Redirection of output to a file when using this level is recommended. 
[ERROR:VsDevCmd.bat] Example: set VSCMD_DEBUG=3 
[ERROR:VsDevCmd.bat]          vsdevcmd.bat > vsdevcmd.trace.txt 2>&1 
Traceback (most recent call last): 
  File "run_test.py", line 13, in <module> 
    import torch 
ModuleNotFoundError: No module named 'torch' 
+ cleanup
+ retcode=1
+ set +x

See CircleCI build pytorch_windows_vs2019_py36_cuda10.1_test1 (2/2)

Step: "Test" (full log | diagnosis details | 🔁 rerun) ❄️

ModuleNotFoundError: No module named 'torch'
[ERROR:VsDevCmd.bat] Where [value] is: 
[ERROR:VsDevCmd.bat]    1 : basic debug logging 
[ERROR:VsDevCmd.bat]    2 : detailed debug logging 
[ERROR:VsDevCmd.bat]    3 : trace level logging. Redirection of output to a file when using this level is recommended. 
[ERROR:VsDevCmd.bat] Example: set VSCMD_DEBUG=3 
[ERROR:VsDevCmd.bat]          vsdevcmd.bat > vsdevcmd.trace.txt 2>&1 
Run jit_profiling tests 
Traceback (most recent call last): 
  File "run_test.py", line 13, in <module> 
    import torch 
ModuleNotFoundError: No module named 'torch' 
+ cleanup
+ retcode=1
+ set +x

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

Copy link
Copy Markdown
Member

@suo suo left a comment

Choose a reason for hiding this comment

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

lgtm; can we add some basic tests to ensure that the ellipsis token works as intended?

@malfet
Copy link
Copy Markdown
Contributor Author

malfet commented Sep 22, 2020

lgtm; can we add some basic tests to ensure that the ellipsis token works as intended?

@suo, will add them as part of PR that adds support for variable length Tuples.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@malfet merged this pull request in 63fd257.

@malfet malfet deleted the malfet/jit-add-ellipsis-built-in-constant branch September 23, 2020 14:04
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
Summary:
Per https://docs.python.org/3.6/library/constants.html
> `Ellipsis` is the same as ellipsis literal `...`

Pull Request resolved: pytorch#44959

Reviewed By: suo

Differential Revision: D23785660

Pulled By: malfet

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

Labels

Merged oncall: jit Add this issue/PR to JIT oncall triage queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants