pytorch
17495e03 - [PyTorch Mobile] Fix case when error messages are stripped, and stack value isn't popped off in lite-interpreter (#53201)

Commit
3 years ago
[PyTorch Mobile] Fix case when error messages are stripped, and stack value isn't popped off in lite-interpreter (#53201) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/53201 This resulted in [S22350](https://www.internalfb.com/intern/sevmanager/view/s/223540), which caused truoble on Android. 1. The Python has a call to `warnings.warn()`, which resulted in code generated to emit the `WARN` instruction on lite-interpreter. 2. The code for handling that instruction/op-code popped off the value in a call to the `TORCH_WARN()` *macro*. 3. This macro conditionally compiled out evaluation of the arguments if `STRIP_ERROR_MESSAGES` was defined, which resulted in the stack not getting popped, and the lite-interpreter returning the last pushed value on to the stack. I've attempted to re-produce it using this python code: {P243842428} ghstack-source-id: 122990001 (Note: this ignores all push blocking failures!) Test Plan: Created a new unit test to re-produce the failure in the test. Was able to do so locally using the following command: ``` buck test -c pt.strip_error_messages=1 //xplat/caffe2:test_s223540 ``` However, since `pt.strip_error_messages=0` for dev and continuous builds, I have had to check in a separate contbuild config to try and trigger this failure on contbuild. Reviewed By: iseeyuan Differential Revision: D26765662 fbshipit-source-id: 63c3c96d84ce6a9e5471f13d80165aa3718be9a2
Author
Parents
Loading