KEMBAR78
[dynamo] add infinite generators `itertools.{count, repeat, cycle}` by jon-chuang · Pull Request #110967 · pytorch/pytorch · GitHub
Skip to content

Conversation

@jon-chuang
Copy link
Collaborator

@jon-chuang jon-chuang commented Oct 10, 2023

Fixes https://github.com/pytorch/pytorch/pull/110953/files#r1352868935

Depends on: #110953

Why not use these for repeat(item, count):

These are not preferred as they return an opaque VariableTracker. In particular, one cannot do enumerate(repeat(1)). repeat(1, 10) benefits from the integration enjoyed by ListVariableIterator

Follow ups:

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @chenyang78 @aakhundov @kadeng @ezyang

@pytorch-bot
Copy link

pytorch-bot bot commented Oct 10, 2023

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/110967

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 9d1692c with merge base f74d766 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@jon-chuang
Copy link
Collaborator Author

@pytorchbot label "release notes: dynamo"

Copy link
Contributor

@ezyang ezyang left a comment

Choose a reason for hiding this comment

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

mutable VTs no good

@jon-chuang jon-chuang marked this pull request as ready for review October 10, 2023 21:49
@cpuhrsch cpuhrsch added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Oct 11, 2023
@jon-chuang

This comment was marked as outdated.

Copy link
Contributor

@ezyang ezyang left a comment

Choose a reason for hiding this comment

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

Thanks!

@jon-chuang
Copy link
Collaborator Author

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Oct 31, 2023
@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

xuhancn pushed a commit to xuhancn/pytorch that referenced this pull request Nov 7, 2023
…ytorch#110967)

Fixes https://github.com/pytorch/pytorch/pull/110953/files#r1352868935

Depends on: pytorch#110953

Why not use these for `repeat(item, count)`:
> These are not preferred as they return an opaque VariableTracker. In particular, one cannot do `enumerate(repeat(1))`. `repeat(1, 10)` benefits from the integration enjoyed by `ListVariableIterator`

Follow ups:
- [ ] make listiterator an IteratorVariable, define iterator integrations on base IteratorVariable where unspecialized pytorch#110967 (comment)
    - Please make a new issue for this
- [ ] explore integrating cpython itertools test suite pytorch#110967 (comment)
- [ ] Use something other than `StopIteration` to handle iterator termination pytorch#110967 (comment)
- [ ] Add test case for consuming iterator simultaneously from two code points https://github.com/pytorch/pytorch/pull/110967/files#r1358325511

Pull Request resolved: pytorch#110967
Approved by: https://github.com/ezyang
Skylion007 pushed a commit to Skylion007/pytorch that referenced this pull request Nov 14, 2023
…ytorch#110967)

Fixes https://github.com/pytorch/pytorch/pull/110953/files#r1352868935

Depends on: pytorch#110953

Why not use these for `repeat(item, count)`:
> These are not preferred as they return an opaque VariableTracker. In particular, one cannot do `enumerate(repeat(1))`. `repeat(1, 10)` benefits from the integration enjoyed by `ListVariableIterator`

Follow ups:
- [ ] make listiterator an IteratorVariable, define iterator integrations on base IteratorVariable where unspecialized pytorch#110967 (comment)
    - Please make a new issue for this
- [ ] explore integrating cpython itertools test suite pytorch#110967 (comment)
- [ ] Use something other than `StopIteration` to handle iterator termination pytorch#110967 (comment)
- [ ] Add test case for consuming iterator simultaneously from two code points https://github.com/pytorch/pytorch/pull/110967/files#r1358325511

Pull Request resolved: pytorch#110967
Approved by: https://github.com/ezyang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/inductor ciflow/trunk Trigger trunk jobs on your pull request Merged module: dynamo open source release notes: dynamo 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.

5 participants