-
Notifications
You must be signed in to change notification settings - Fork 25.7k
[PyTorch] Add input numel assert for minimal arrayref interface #113577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
We currently have no shape checking on CPU IIUC. Now we at least do numel checking for the minimal arrayref interface. Differential Revision: [D51165703](https://our.internmc.facebook.com/intern/diff/D51165703/) [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/113577
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 749fd40 with merge base de4b2e5 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
…rface" We currently have no shape checking on CPU IIUC. Now we at least do numel checking for the minimal arrayref interface. Differential Revision: [D51165703](https://our.internmc.facebook.com/intern/diff/D51165703/) [ghstack-poisoned]
…rface" We currently have no shape checking on CPU IIUC. Now we at least do numel checking for the minimal arrayref interface. Differential Revision: [D51165703](https://our.internmc.facebook.com/intern/diff/D51165703/) [ghstack-poisoned]
…rface" We currently have no shape checking on CPU IIUC. Now we at least do numel checking for the minimal arrayref interface. Differential Revision: [D51165703](https://our.internmc.facebook.com/intern/diff/D51165703/) [ghstack-poisoned]
Pull Request resolved: #113577 We currently have no shape checking on CPU IIUC. Now we at least do numel checking for the minimal arrayref interface. ghstack-source-id: 208570103 @exported-using-ghexport Differential Revision: [D51165703](https://our.internmc.facebook.com/intern/diff/D51165703/)
…rface" We currently have no shape checking on CPU IIUC. Now we at least do numel checking for the minimal arrayref interface. Differential Revision: [D51165703](https://our.internmc.facebook.com/intern/diff/D51165703/) [ghstack-poisoned]
…rface" We currently have no shape checking on CPU IIUC. Now we at least do numel checking for the minimal arrayref interface. Differential Revision: [D51165703](https://our.internmc.facebook.com/intern/diff/D51165703/) [ghstack-poisoned]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a minor comment. Please fix the linter failure. LGTM otherwise. Thanks!
| continue | ||
|
|
||
| # comparing strides for 0 size tensor is tricky. Ignore them for now. | ||
| if sympy_product(buf.get_size()) == 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious - for 0-size-tensor cases, why can't we have something like assert_num(buf_name, 0)?
…rface" We currently have no shape checking on CPU IIUC. Now we at least do numel checking for the minimal arrayref interface. Differential Revision: [D51165703](https://our.internmc.facebook.com/intern/diff/D51165703/) [ghstack-poisoned]
…rface" We currently have no shape checking on CPU IIUC. Now we at least do numel checking for the minimal arrayref interface. Differential Revision: [D51165703](https://our.internmc.facebook.com/intern/diff/D51165703/) [ghstack-poisoned]
…rface" We currently have no shape checking on CPU IIUC. Now we at least do numel checking for the minimal arrayref interface. Differential Revision: [D51165703](https://our.internmc.facebook.com/intern/diff/D51165703/) [ghstack-poisoned]
…rface" We currently have no shape checking on CPU IIUC. Now we at least do numel checking for the minimal arrayref interface. Differential Revision: [D51165703](https://our.internmc.facebook.com/intern/diff/D51165703/) [ghstack-poisoned]
…rface" We currently have no shape checking on CPU IIUC. Now we at least do numel checking for the minimal arrayref interface. Differential Revision: [D51165703](https://our.internmc.facebook.com/intern/diff/D51165703/) [ghstack-poisoned]
|
@pytorchbot merge (Initiating merge automatically since Phabricator Diff has merged) |
Merge startedYour 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 |
Knocks off a few nanoseconds from CPU inference due to not having to set this field; paths that would've needed it are expensive anyway. Differential Revision: [D51182794](https://our.internmc.facebook.com/intern/diff/D51182794/) Pull Request resolved: #113578 Approved by: https://github.com/khabinov, https://github.com/Neilblaze ghstack dependencies: #112800, #113577
…rch#113577) We currently have no shape checking on CPU IIUC. Now we at least do numel checking for the minimal arrayref interface. Differential Revision: [D51165703](https://our.internmc.facebook.com/intern/diff/D51165703/) Pull Request resolved: pytorch#113577 Approved by: https://github.com/chenyang78, https://github.com/jansel ghstack dependencies: pytorch#112800
Knocks off a few nanoseconds from CPU inference due to not having to set this field; paths that would've needed it are expensive anyway. Differential Revision: [D51182794](https://our.internmc.facebook.com/intern/diff/D51182794/) Pull Request resolved: pytorch#113578 Approved by: https://github.com/khabinov, https://github.com/Neilblaze ghstack dependencies: pytorch#112800, pytorch#113577
…rch#113577) We currently have no shape checking on CPU IIUC. Now we at least do numel checking for the minimal arrayref interface. Differential Revision: [D51165703](https://our.internmc.facebook.com/intern/diff/D51165703/) Pull Request resolved: pytorch#113577 Approved by: https://github.com/chenyang78, https://github.com/jansel ghstack dependencies: pytorch#112800
Knocks off a few nanoseconds from CPU inference due to not having to set this field; paths that would've needed it are expensive anyway. Differential Revision: [D51182794](https://our.internmc.facebook.com/intern/diff/D51182794/) Pull Request resolved: pytorch#113578 Approved by: https://github.com/khabinov, https://github.com/Neilblaze ghstack dependencies: pytorch#112800, pytorch#113577
Stack from ghstack (oldest at bottom):
We currently have no shape checking on CPU IIUC. Now we at least do numel checking for the minimal arrayref interface.
Differential Revision: D51165703
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @aakhundov @ColinPeppler