pytorch
7b556db6 - [PyTorch Mobile] Skip inferring function schema from the C++ function type (#50457)

Commit
3 years ago
[PyTorch Mobile] Skip inferring function schema from the C++ function type (#50457) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/50457 The code to infer function schema from a C++ function relies on templates and code expansion. This uses valuable binary size. We can avoid inferring the schema from the C++ function type (arguments, name, return value) in case that the function implementation is being added to the dispatcher via `m.impl`. In this case, it is assumed that we have a schema registered already. Adding an implementation via `m.def` still triggers schema inferrence. In addition, we don't do schema schema checks on mobile, so the schema is not needed in the first place. ghstack-source-id: 120915259 Test Plan: Auto-unit tests succeed. ### Size test: igios ``` D25853094-V1 (https://www.internalfb.com/intern/diff/D25853094/?dest_number=119632217) igios: Succeeded Change in Download Size for arm64 + 3x assets variation: -21.8 KiB Change in Uncompressed Size for arm64 + 3x assets variation: -45.5 KiB Mbex Comparison: https://our.intern.facebook.com/intern/mbex/bsb:261049318687117@base/bsb:261049318687117@diff/ ``` ### Size test: fbios ``` D25853094-V1 (https://www.internalfb.com/intern/diff/D25853094/?dest_number=119632217) fbios: Succeeded Change in Download Size for arm64 + 3x assets variation: -27.2 KiB Change in Uncompressed Size for arm64 + 3x assets variation: -80.1 KiB Mbex Comparison: https://our.intern.facebook.com/intern/mbex/bsb:454289062251865@base/bsb:454289062251865@diff/ ``` Reviewed By: smessmer Differential Revision: D25853094 fbshipit-source-id: e138d9dff7561d424bfb732f3a5898466f018f60
Author
Parents
Loading