-
Notifications
You must be signed in to change notification settings - Fork 594
Replace pytree_assert with production pytree_check. Remove pytree_unreachable #7655
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
Replace pytree_assert with production pytree_check. Remove pytree_unreachable #7655
Conversation
…eachable When handling untrusted input, it's not appropriate to use debug-only checks; we should be checking in prod as these are not programmer errors. pytree_unreachable was similarly being used for input validation. Differential Revision: [D68166301](https://our.internmc.facebook.com/intern/diff/D68166301/) [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/7655
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 73ce658 with merge base b362ab7 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
…eachable When handling untrusted input, it's not appropriate to use debug-only checks; we should be checking in prod as these are not programmer errors. pytree_unreachable was similarly being used for input validation. Differential Revision: [D68166301](https://our.internmc.facebook.com/intern/diff/D68166301/) ghstack-source-id: 261377457 Pull Request resolved: #7655
This pull request was exported from Phabricator. Differential Revision: D68166301 |
… pytree_unreachable" When handling untrusted input, it's not appropriate to use debug-only checks; we should be checking in prod as these are not programmer errors. pytree_unreachable was similarly being used for input validation. Differential Revision: [D68166301](https://our.internmc.facebook.com/intern/diff/D68166301/) [ghstack-poisoned]
…eachable Pull Request resolved: #7655 When handling untrusted input, it's not appropriate to use debug-only checks; we should be checking in prod as these are not programmer errors. pytree_unreachable was similarly being used for input validation. ghstack-source-id: 261987906 Differential Revision: [D68166301](https://our.internmc.facebook.com/intern/diff/D68166301/)
This pull request was exported from Phabricator. Differential Revision: D68166301 |
… pytree_unreachable" When handling untrusted input, it's not appropriate to use debug-only checks; we should be checking in prod as these are not programmer errors. pytree_unreachable was similarly being used for input validation. Differential Revision: [D68166301](https://our.internmc.facebook.com/intern/diff/D68166301/) [ghstack-poisoned]
This pull request was exported from Phabricator. Differential Revision: D68166301 |
…eachable Pull Request resolved: #7655 When handling untrusted input, it's not appropriate to use debug-only checks; we should be checking in prod as these are not programmer errors. pytree_unreachable was similarly being used for input validation. ghstack-source-id: 262028959 Differential Revision: [D68166301](https://our.internmc.facebook.com/intern/diff/D68166301/)
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.
Much nicer behavior than before!
extension/pytree/pybindings.cpp
Outdated
@@ -145,7 +145,8 @@ class PyTree { | |||
} else if (py::isinstance<py::int_>(key)) { | |||
s.key(i) = py::cast<int32_t>(key); | |||
} else { | |||
pytree_assert(false); | |||
throw std::runtime_err( | |||
"invalid key in pytree dict; must be int or string"); |
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.
It'd be helpful to print the key type here, though the old code didn't do it either so not a blocker. Similar for other new throw
messages in this PR.
… pytree_unreachable" When handling untrusted input, it's not appropriate to use debug-only checks; we should be checking in prod as these are not programmer errors. pytree_unreachable was similarly being used for input validation. Differential Revision: [D68166301](https://our.internmc.facebook.com/intern/diff/D68166301/) [ghstack-poisoned]
…eachable Pull Request resolved: #7655 When handling untrusted input, it's not appropriate to use debug-only checks; we should be checking in prod as these are not programmer errors. pytree_unreachable was similarly being used for input validation. ghstack-source-id: 262806899 Differential Revision: [D68166301](https://our.internmc.facebook.com/intern/diff/D68166301/)
This pull request was exported from Phabricator. Differential Revision: D68166301 |
… pytree_unreachable" When handling untrusted input, it's not appropriate to use debug-only checks; we should be checking in prod as these are not programmer errors. pytree_unreachable was similarly being used for input validation. Differential Revision: [D68166301](https://our.internmc.facebook.com/intern/diff/D68166301/) [ghstack-poisoned]
This pull request was exported from Phabricator. Differential Revision: D68166301 |
…eachable Pull Request resolved: #7655 When handling untrusted input, it's not appropriate to use debug-only checks; we should be checking in prod as these are not programmer errors. pytree_unreachable was similarly being used for input validation. ghstack-source-id: 263972123 Differential Revision: [D68166301](https://our.internmc.facebook.com/intern/diff/D68166301/)
… pytree_unreachable" When handling untrusted input, it's not appropriate to use debug-only checks; we should be checking in prod as these are not programmer errors. pytree_unreachable was similarly being used for input validation. Differential Revision: [D68166301](https://our.internmc.facebook.com/intern/diff/D68166301/) [ghstack-poisoned]
…eachable Pull Request resolved: #7655 When handling untrusted input, it's not appropriate to use debug-only checks; we should be checking in prod as these are not programmer errors. pytree_unreachable was similarly being used for input validation. ghstack-source-id: 265152270 Differential Revision: [D68166301](https://our.internmc.facebook.com/intern/diff/D68166301/)
This pull request was exported from Phabricator. Differential Revision: D68166301 |
…eachable Pull Request resolved: #7655 When handling untrusted input, it's not appropriate to use debug-only checks; we should be checking in prod as these are not programmer errors. pytree_unreachable was similarly being used for input validation. ghstack-source-id: 265152270 Differential Revision: [D68166301](https://our.internmc.facebook.com/intern/diff/D68166301/)
…eachable Pull Request resolved: #7655 When handling untrusted input, it's not appropriate to use debug-only checks; we should be checking in prod as these are not programmer errors. pytree_unreachable was similarly being used for input validation. ghstack-source-id: 265152270 Differential Revision: [D68166301](https://our.internmc.facebook.com/intern/diff/D68166301/) Co-authored-by: Github Executorch <github_executorch@arm.com>
Stack from ghstack (oldest at bottom):
When handling untrusted input, it's not appropriate to use debug-only checks; we should be checking in prod as these are not programmer errors. pytree_unreachable was similarly being used for input validation.
Differential Revision: D68166301