Skip to content

Conversation

@eellison
Copy link
Contributor

@eellison eellison commented Mar 25, 2022

Stack from ghstack:

As commented in code:

    // Empty List Literals that are not assigned to variables
    // may match to any list type in schema matching,
    // but still default to List[Tensor] if assigned to a variable
    // or returned from a function
    // Restricting empty list matching to temporary values
    // avoids difficult to handle cases such as
    // a = []
    // b = a
    // if cond:
    //    b.append(2)
    // else:
    //    a.append("hi")
    // This is also the same behavior that C++ allows with {}
    // (cannot assign to a variable typed as auto)

Fix for pytorch/torchdynamo#95

Differential Revision: D35362760

@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented Mar 25, 2022

🔗 Helpful links

💊 CI failures summary and remediations

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


  • 1/1 failures introduced in this PR

🕵️ 1 new failure recognized by patterns

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

See GitHub Actions build pull / linux-xenial-py3.7-clang7-asan / test (default, 2, 3, linux.2xlarge) (1/1)

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

2022-04-05T20:19:13.4021740Z SUMMARY: Undefined.../jenkins/workspace/aten/src/ATen/Utils.cpp:20:3 in
2022-04-05T20:19:13.3512453Z     #10 0x55e8ee176c81 in run_mod /home/builder/tkoch/workspace/python_1648536129212/work/Python/pythonrun.c:1037
2022-04-05T20:19:13.3513113Z     #11 0x55e8ee181c69 in PyRun_StringFlags /home/builder/tkoch/workspace/python_1648536129212/work/Python/pythonrun.c:961
2022-04-05T20:19:13.3513813Z     #12 0x55e8ee181ccb in PyRun_SimpleStringFlags /home/builder/tkoch/workspace/python_1648536129212/work/Python/pythonrun.c:455
2022-04-05T20:19:13.3515129Z     #13 0x55e8ee181dc8 in pymain_run_command /home/builder/tkoch/workspace/python_1648536129212/work/Modules/main.c:420
2022-04-05T20:19:13.3515757Z     #14 0x55e8ee181dc8 in pymain_run_python /home/builder/tkoch/workspace/python_1648536129212/work/Modules/main.c:2907
2022-04-05T20:19:13.3516565Z     #15 0x55e8ee181dc8 in pymain_main /home/builder/tkoch/workspace/python_1648536129212/work/Modules/main.c:3460
2022-04-05T20:19:13.3517205Z     #16 0x55e8ee18218b in _Py_UnixMain /home/builder/tkoch/workspace/python_1648536129212/work/Modules/main.c:3495
2022-04-05T20:19:13.4020859Z     #17 0x7f8ce2c5383f in __libc_start_main /build/glibc-S7Ft5T/glibc-2.23/csu/../csu/libc-start.c:291
2022-04-05T20:19:13.4021273Z     #18 0x55e8ee127039 in _start (/opt/conda/bin/python3.7+0x1d8039)
2022-04-05T20:19:13.4021435Z 
2022-04-05T20:19:13.4021740Z SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /var/lib/jenkins/workspace/aten/src/ATen/Utils.cpp:20:3 in 
2022-04-05T20:19:13.4267948Z + retcode=1
2022-04-05T20:19:13.4268192Z + set -e
2022-04-05T20:19:13.4268364Z + return 1
2022-04-05T20:19:13.4271508Z + [[ linux-xenial-py3.7-clang7-asan-default == *-NO_AVX-* ]]
2022-04-05T20:19:13.4271992Z + [[ default == \n\o\g\p\u\_\N\O\_\A\V\X ]]
2022-04-05T20:19:13.4272568Z + [[ linux-xenial-py3.7-clang7-asan-default == *-NO_AVX2-* ]]
2022-04-05T20:19:13.4273067Z + [[ default == \n\o\g\p\u\_\N\O\_\A\V\X\2 ]]
2022-04-05T20:19:13.4273671Z + [[ linux-xenial-py3.7-clang7-asan-default == *-NO_AVX512-* ]]
2022-04-05T20:19:13.4274163Z + [[ default == \n\o\g\p\u\_\N\O\_\A\V\X\5\1\2 ]]
2022-04-05T20:19:13.4275091Z + [[ linux-xenial-py3.7-clang7-asan-default == *tbb* ]]

This comment was automatically generated by Dr. CI (expand for details).

Please report bugs/suggestions to the (internal) Dr. CI Users group.

Click here to manually regenerate this comment.

@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Mar 25, 2022
@eellison eellison changed the title Allow empty temporrary list literalsto be matched to arbitrary types [JIT] Allow empty temporary list literals to be matched to arbitrary types Mar 25, 2022
@eellison eellison requested a review from Chillee March 25, 2022 19:11
… arbitrary types"


As commented in code:
```
    // Empty List Literals that are not assigned to variables
    // may match to any list type in schema matching,
    // but still default to List[Tensor] if assigned to a variable
    // or returned from a function
    // Restricting empty list matching to temporary values
    // avoids difficult to handle cases such as
    // a = []
    // b = a
    // if cond:
    //    b.append(2)
    // else:
    //    a.append("hi")
    // This is also the same behavior that C++ allows with {}
    // (cannot assign to a variable typed as auto)
```

Fix for pytorch/torchdynamo#95

[ghstack-poisoned]
… arbitrary types"


As commented in code:
```
    // Empty List Literals that are not assigned to variables
    // may match to any list type in schema matching,
    // but still default to List[Tensor] if assigned to a variable
    // or returned from a function
    // Restricting empty list matching to temporary values
    // avoids difficult to handle cases such as
    // a = []
    // b = a
    // if cond:
    //    b.append(2)
    // else:
    //    a.append("hi")
    // This is also the same behavior that C++ allows with {}
    // (cannot assign to a variable typed as auto)
```

Fix for pytorch/torchdynamo#95

[ghstack-poisoned]
… arbitrary types"


As commented in code:
```
    // Empty List Literals that are not assigned to variables
    // may match to any list type in schema matching,
    // but still default to List[Tensor] if assigned to a variable
    // or returned from a function
    // Restricting empty list matching to temporary values
    // avoids difficult to handle cases such as
    // a = []
    // b = a
    // if cond:
    //    b.append(2)
    // else:
    //    a.append("hi")
    // This is also the same behavior that C++ allows with {}
    // (cannot assign to a variable typed as auto)
```

Fix for pytorch/torchdynamo#95

[ghstack-poisoned]
eellison pushed a commit that referenced this pull request Mar 25, 2022
@eellison eellison requested a review from ansley March 25, 2022 22:17
Copy link
Collaborator

@Chillee Chillee left a comment

Choose a reason for hiding this comment

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

Looks good! I'll approve it but might be better for somebody else familiar with Torchscript to take a look.

… arbitrary types"


As commented in code:
```
    // Empty List Literals that are not assigned to variables
    // may match to any list type in schema matching,
    // but still default to List[Tensor] if assigned to a variable
    // or returned from a function
    // Restricting empty list matching to temporary values
    // avoids difficult to handle cases such as
    // a = []
    // b = a
    // if cond:
    //    b.append(2)
    // else:
    //    a.append("hi")
    // This is also the same behavior that C++ allows with {}
    // (cannot assign to a variable typed as auto)
```

Fix for pytorch/torchdynamo#95

[ghstack-poisoned]
@eellison
Copy link
Contributor Author

eellison commented Apr 4, 2022

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

… arbitrary types"


As commented in code:
```
    // Empty List Literals that are not assigned to variables
    // may match to any list type in schema matching,
    // but still default to List[Tensor] if assigned to a variable
    // or returned from a function
    // Restricting empty list matching to temporary values
    // avoids difficult to handle cases such as
    // a = []
    // b = a
    // if cond:
    //    b.append(2)
    // else:
    //    a.append("hi")
    // This is also the same behavior that C++ allows with {}
    // (cannot assign to a variable typed as auto)
```

Fix for pytorch/torchdynamo#95

Differential Revision: [D35362760](https://our.internmc.facebook.com/intern/diff/D35362760)

[ghstack-poisoned]
@eellison
Copy link
Contributor Author

eellison commented Apr 5, 2022

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

facebook-github-bot pushed a commit that referenced this pull request Apr 6, 2022
…types (#74768)

Summary:
Pull Request resolved: #74768

As commented in code:
```
    // Empty List Literals that are not assigned to variables
    // may match to any list type in schema matching,
    // but still default to List[Tensor] if assigned to a variable
    // or returned from a function
    // Restricting empty list matching to temporary values
    // avoids difficult to handle cases such as
    // a = []
    // b = a
    // if cond:
    //    b.append(2)
    // else:
    //    a.append("hi")
    // This is also the same behavior that C++ allows with {}
    // (cannot assign to a variable typed as auto)
```

Fix for pytorch/torchdynamo#95

Test Plan: Imported from OSS

Reviewed By: ejguan

Differential Revision: D35362760

Pulled By: eellison

fbshipit-source-id: da23e8889312001b60d64a1758da5c578b6fe5ea
@facebook-github-bot facebook-github-bot deleted the gh/eellison/287/head branch April 10, 2022 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants