Skip to content

[collections.abc] Ensure that binop calls works with UserDefinedObjects#159865

Closed
guilhermeleobas wants to merge 11 commits intogh/guilhermeleobas/223/basefrom
gh/guilhermeleobas/223/head
Closed

[collections.abc] Ensure that binop calls works with UserDefinedObjects#159865
guilhermeleobas wants to merge 11 commits intogh/guilhermeleobas/223/basefrom
gh/guilhermeleobas/223/head

Conversation

@guilhermeleobas
Copy link
Collaborator

@guilhermeleobas guilhermeleobas commented Aug 5, 2025

Stack from ghstack (oldest at bottom):

Changes:
(1) Replace UserDefinedSetVariable by UserDefinedObjectVariable in all binop calls

Test plan:
(1) The three tests from CPython test_collections.py ensures that Dynamo can trace through a dunder method (e.g. add, ixor, etc) defined in a user defined class

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @chauhang @amjames @Lucaskabela

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Aug 5, 2025

🔗 Helpful Links

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

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

✅ You can merge normally! (1 Unrelated Failure)

As of commit 1fa8ce5 with merge base e299926 (image):

BROKEN TRUNK - The following job failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

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

guilhermeleobas added a commit that referenced this pull request Aug 5, 2025
Changes:
(1) Replace UserDefinedSetVariable by UserDefinedObjectVariable in all binop calls

Test plan:
(1) The three tests from CPython `test_collections.py` ensures that Dynamo can trace through a dunder method (e.g. __add__, __ixor__, etc) defined in a user defined class


ghstack-source-id: 2c6cda7
Pull-Request: #159865
[ghstack-poisoned]
guilhermeleobas added a commit that referenced this pull request Aug 5, 2025
Changes:
(1) Replace UserDefinedSetVariable by UserDefinedObjectVariable in all binop calls

Test plan:
(1) The three tests from CPython `test_collections.py` ensures that Dynamo can trace through a dunder method (e.g. __add__, __ixor__, etc) defined in a user defined class


ghstack-source-id: d658d5e
Pull-Request: #159865
@guilhermeleobas guilhermeleobas marked this pull request as ready for review August 5, 2025 16:04
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
guilhermeleobas added a commit that referenced this pull request Aug 14, 2025
Changes:
(1) Replace UserDefinedSetVariable by UserDefinedObjectVariable in all binop calls

Test plan:
(1) The three tests from CPython `test_collections.py` ensures that Dynamo can trace through a dunder method (e.g. __add__, __ixor__, etc) defined in a user defined class


ghstack-source-id: 998de79
Pull-Request: #159865
[ghstack-poisoned]
guilhermeleobas added a commit that referenced this pull request Aug 14, 2025
Changes:
(1) Replace UserDefinedSetVariable by UserDefinedObjectVariable in all binop calls

Test plan:
(1) The three tests from CPython `test_collections.py` ensures that Dynamo can trace through a dunder method (e.g. __add__, __ixor__, etc) defined in a user defined class


ghstack-source-id: e70f3c7
Pull-Request: #159865
[ghstack-poisoned]
guilhermeleobas added a commit that referenced this pull request Aug 15, 2025
Changes:
(1) Replace UserDefinedSetVariable by UserDefinedObjectVariable in all binop calls

Test plan:
(1) The three tests from CPython `test_collections.py` ensures that Dynamo can trace through a dunder method (e.g. __add__, __ixor__, etc) defined in a user defined class


ghstack-source-id: ecbd132
Pull-Request: #159865
guilhermeleobas added a commit that referenced this pull request Aug 15, 2025
Changes:
(1) Replace UserDefinedSetVariable by UserDefinedObjectVariable in all binop calls

Test plan:
(1) The three tests from CPython `test_collections.py` ensures that Dynamo can trace through a dunder method (e.g. __add__, __ixor__, etc) defined in a user defined class


ghstack-source-id: ecbd132
Pull-Request: #159865
@mlazos
Copy link
Contributor

mlazos commented Aug 15, 2025

Do we just graph break in the case where these binops aren't support on the user defined obj?

@guilhermeleobas
Copy link
Collaborator Author

Do we just graph break in the case where these binops aren't support on the user defined obj?

Yes! I'll add a test case for this case.

[ghstack-poisoned]
guilhermeleobas added a commit that referenced this pull request Aug 15, 2025
Changes:
(1) Replace UserDefinedSetVariable by UserDefinedObjectVariable in all binop calls

Test plan:
(1) The three tests from CPython `test_collections.py` ensures that Dynamo can trace through a dunder method (e.g. __add__, __ixor__, etc) defined in a user defined class

ghstack-source-id: 18d6a6d
Pull-Request: #159865
[ghstack-poisoned]
guilhermeleobas added a commit that referenced this pull request Aug 15, 2025
Changes:
(1) Replace UserDefinedSetVariable by UserDefinedObjectVariable in all binop calls

Test plan:
(1) The three tests from CPython `test_collections.py` ensures that Dynamo can trace through a dunder method (e.g. __add__, __ixor__, etc) defined in a user defined class

ghstack-source-id: 9028efc
Pull-Request: #159865
@mlazos
Copy link
Contributor

mlazos commented Aug 15, 2025

Do we just graph break in the case where these binops aren't support on the user defined obj?

Yes! I'll add a test case for this case.

Yeah this might get reverted if we add any graph breaks, but I suppose before we were always graph breaking on them before and now we graph break only when it's not supported. Is my interpretation correct?

@guilhermeleobas
Copy link
Collaborator Author

That's correct!

[ghstack-poisoned]
@guilhermeleobas
Copy link
Collaborator Author

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Aug 16, 2025
@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

pytorchmergebot pushed a commit that referenced this pull request Aug 18, 2025
can-gaa-hou pushed a commit to can-gaa-hou/pytorch that referenced this pull request Aug 22, 2025
…ts (pytorch#159865)

Changes:
(1) Replace UserDefinedSetVariable by UserDefinedObjectVariable in all binop calls

Test plan:
(1) The three tests from CPython `test_collections.py` ensures that Dynamo can trace through a dunder method (e.g. __add__, __ixor__, etc) defined in a user defined class

Pull Request resolved: pytorch#159865
Approved by: https://github.com/mlazos
ghstack dependencies: pytorch#159365, pytorch#159366, pytorch#159368, pytorch#159483, pytorch#159902, pytorch#159864
can-gaa-hou pushed a commit to can-gaa-hou/pytorch that referenced this pull request Aug 22, 2025
@github-actions github-actions bot deleted the gh/guilhermeleobas/223/head branch September 16, 2025 02:08
markc-614 pushed a commit to markc-614/pytorch that referenced this pull request Sep 17, 2025
…ts (pytorch#159865)

Changes:
(1) Replace UserDefinedSetVariable by UserDefinedObjectVariable in all binop calls

Test plan:
(1) The three tests from CPython `test_collections.py` ensures that Dynamo can trace through a dunder method (e.g. __add__, __ixor__, etc) defined in a user defined class

Pull Request resolved: pytorch#159865
Approved by: https://github.com/mlazos
ghstack dependencies: pytorch#159365, pytorch#159366, pytorch#159368, pytorch#159483, pytorch#159902, pytorch#159864
markc-614 pushed a commit to markc-614/pytorch that referenced this pull request Sep 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants