-
Notifications
You must be signed in to change notification settings - Fork 607
Use non-fatal input checks for view operator #9264
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
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/9264
Note: Links to docs will display an error until the docs builds have been completed. ❌ 2 New Failures, 1 Unrelated FailureAs of commit df7b286 with merge base 2bee76e ( NEW FAILURES - The following jobs have failed:
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. |
Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
@pytorchbot label "topic: not user facing" |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
@@ -72,28 +72,38 @@ void et_view(KernelRuntimeContext& context, EValue** stack) { | |||
auto size = (*stack[1]).toIntList(); | |||
auto out = (*stack[2]).toTensor(); | |||
|
|||
ET_CHECK(tensors_have_same_dtype(self, out)); | |||
ET_KERNEL_CHECK( | |||
context, tensors_have_same_dtype(self, out), InvalidArgument, ); |
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.
plz remove the extra ,
on the end of function; same as below
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.
The commas has to be there since it needs an extra, though empty, param passed in for retval
(return value).
Similar commas can be seen in main branch:
executorch/kernels/optimized/cpu/op_add.cpp
Lines 47 to 50 in bb3b623
ET_KERNEL_CHECK( | |
ctx, | |
torch::executor::native::utils::extract_scalar(alpha, &alpha_val), | |
InvalidArgument, ); |
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.
oh yeah you're right i forgot that. Thanks for noticing!
kernels/prim_ops/et_view.cpp
Outdated
internal::set_tensor_data( | ||
out, | ||
/*buffer=*/self.mutable_data_ptr(), | ||
/*buffer_size=*/out.nbytes()) == Error::Ok, | ||
InvalidArgument, |
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.
@manuelcandales know better, but I'm thinking we should use Internal
here?
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.
Updated as suggested.
… into issue/9130 Update exception type of set tensor data to Internal.
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.
shipit (when tests are green)
Hi, @zhenyan-zhang-meta |
Sure, actually I am exploring how to run the relevant tests locally and some of them needs to be updated based on the failed signals. |
@mergennachin The tests are updated to reflecting the changes. Also cc @Gasoonjia @swolchok @manuelcandales @GregoryComer if need another look on tests before I ship. |
I think the current 3 failing checks left are not relevant to the changes I made. |
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.
Looks good to me. Thanks for taking this!
### Summary Fixes pytorch#9130 Use non-fatal input checks for view operator, just like https://github.com/pytorch/executorch/pull/2115/files, since there are existing cases that an internal app crashed due to a check failure. Test is updated as well for `RegisterPrimOpsTest`. ### Test plan Pass updated test: ``` mkdir cmake-out && cd cmake-out && cmake -DEXECUTORCH_BUILD_TESTS=ON .. && cmake --build . --target kernels_prim_ops_test -j9 && ctest -R kernels_prim_ops_test ``` Pass existing CI/CD. cc @GregoryComer
Summary
Fixes #9130
Use non-fatal input checks for view operator, just like https://github.com/pytorch/executorch/pull/2115/files, since there are existing cases that an internal app crashed due to a check failure.
Test is updated as well for
RegisterPrimOpsTest
.Test plan
Pass updated test:
Pass existing CI/CD.
cc @GregoryComer