[PyTorch Mobile] Allow skipping operator exists check when bytecode model is loaded (#52814)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/52814
Currently, there is no way to load a model on a devvm (CPU) if that model has operators that the runtime doesn't support. This ends up happening (currently) for Metal GPU models, and potentially in the future for other backends that have backend-specific operators that don't have a registered implementation (even a dummy one) on CPU.
There are at least a couple reasons for why this is needed:
1. We want to extract operator list directly from the bytecode (instead of looking it up from `mobile_info.json).
2. We want to be able to trace the quantized operators that are invoked when loading the compressed weights for a model that has prepacked weights. xta0 root-caused this after husthyc discovered that there are untraced operators showing up when loading a Metal GPU model.
If we want to scale out to support different types of models, we absolutely need the ability to load a model on a devvm irrespective of what backend (device/etc...) it is targeted at.
ghstack-source-id: 123284366
Test Plan: The next diff in this stack is using the newly introduced methods.
Reviewed By: iseeyuan
Differential Revision: D26656266
fbshipit-source-id: eed9af2f7b55979e9c18b986b8c3b9a767153297