Skip to content

[fx] Don't use __module__ to test if a function is bound from C++#75896

Closed
peterbell10 wants to merge 5 commits intogh/peterbell10/304/basefrom
gh/peterbell10/304/head
Closed

[fx] Don't use __module__ to test if a function is bound from C++#75896
peterbell10 wants to merge 5 commits intogh/peterbell10/304/basefrom
gh/peterbell10/304/head

Conversation

@peterbell10
Copy link
Collaborator

@peterbell10 peterbell10 commented Apr 15, 2022

Stack from ghstack (oldest at bottom):

The new test_public_bindings.py test means __module__ will be set
correctly in future, even for functions bound from C++. Instead, just
test directly that the function is of the BuiltinFunctionType which
only passes for functions exported with the CPython API.

The new `test_public_bindings.py` test means `__module__` will be set
correctly in future, even for functions bound from C++. Instead, just
test directly that the function is of the `BuiltinFunctionType` which
only passes for functions exported with the CPython API.

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented Apr 15, 2022

🔗 Helpful links

💊 CI failures summary and remediations

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

Expand to see more

💚 💚 Looks good so far! There are no failures yet. 💚 💚


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.

…rom C++"

The new `test_public_bindings.py` test means `__module__` will be set
correctly in future, even for functions bound from C++. Instead, just
test directly that the function is of the `BuiltinFunctionType` which
only passes for functions exported with the CPython API.

[ghstack-poisoned]
@peterbell10 peterbell10 marked this pull request as ready for review April 15, 2022 20:47
…rom C++"

The new `test_public_bindings.py` test means `__module__` will be set
correctly in future, even for functions bound from C++. Instead, just
test directly that the function is of the `BuiltinFunctionType` which
only passes for functions exported with the CPython API.

[ghstack-poisoned]
Copy link
Collaborator

@albanD albanD left a comment

Choose a reason for hiding this comment

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

SGTM

@albanD
Copy link
Collaborator

albanD commented Apr 21, 2022

@pytorchbot merge this please

@pytorchmergebot
Copy link
Collaborator

Merge failed due to Command git -C /home/runner/work/pytorch/pytorch push origin master returned non-zero exit code 1
To https://github.com/pytorch/pytorch
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/pytorch/pytorch'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Raised by https://github.com/pytorch/pytorch/actions/runs/2204416663

@albanD
Copy link
Collaborator

albanD commented Apr 21, 2022

cc @peterbell10 looks like this needs a rebase!
Feel free to land once CI is green after that though!

…rom C++"

The new `test_public_bindings.py` test means `__module__` will be set
correctly in future, even for functions bound from C++. Instead, just
test directly that the function is of the `BuiltinFunctionType` which
only passes for functions exported with the CPython API.

[ghstack-poisoned]
…rom C++"

The new `test_public_bindings.py` test means `__module__` will be set
correctly in future, even for functions bound from C++. Instead, just
test directly that the function is of the `BuiltinFunctionType` which
only passes for functions exported with the CPython API.

[ghstack-poisoned]
@peterbell10
Copy link
Collaborator Author

@pytorchbot merge this

@github-actions
Copy link
Contributor

Hey @peterbell10.
You've committed this PR, but it does not have both a 'release notes: ...' and 'topics: ...' label. Please add one of each to the PR. The 'release notes: ...' label should represent the part of PyTorch that this PR changes (fx, autograd, distributed, etc) and the 'topics: ...' label should represent the kind of PR it is (not user facing, new feature, bug fix, perf improvement, etc). The list of valid labels can be found here for the 'release notes: ...' and here for the 'topics: ...'.
For changes that are 'topic: not user facing' there is no need for a release notes label.

@peterbell10 peterbell10 added release notes: fx release notes category topic: bug fixes topic category labels Apr 23, 2022
pytorchmergebot pushed a commit that referenced this pull request Apr 23, 2022
This xfail'ed test was fixed by #75896 but didn't show up in CI because it's a slow test.

Pull Request resolved: #76268
Approved by: https://github.com/ngimel
@facebook-github-bot facebook-github-bot deleted the gh/peterbell10/304/head branch April 26, 2022 14:17
facebook-github-bot pushed a commit that referenced this pull request Apr 26, 2022
…5896)

Summary:
The new `test_public_bindings.py` test means `__module__` will be set
correctly in future, even for functions bound from C++. Instead, just
test directly that the function is of the `BuiltinFunctionType` which
only passes for functions exported with the CPython API.

Pull Request resolved: #75896

Approved by: https://github.com/albanD

Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/7a80fc2ce7568212b4620ef014f9a70f2efc0772

Reviewed By: seemethere, osalpekar

Differential Revision: D35874477

fbshipit-source-id: 450e86c4e08ac9a344d30d2e716e3a86e38f3d54
facebook-github-bot pushed a commit that referenced this pull request Apr 26, 2022
Summary:
This xfail'ed test was fixed by #75896 but didn't show up in CI because it's a slow test.

Pull Request resolved: #76268
Approved by: https://github.com/ngimel

Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/1a7e43be141ce01469d7605075cb1008bf19abd7

Reviewed By: seemethere, osalpekar

Differential Revision: D35874478

fbshipit-source-id: 5f5a8e4cf665fea273017691ff8d15c973178771
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.

5 participants