pytorch
dea8b274 - [Pytorch Edge] Make some torchbind classes selective (#67340)

Commit
3 years ago
[Pytorch Edge] Make some torchbind classes selective (#67340) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/67340 Currently Torchbind classes arent selective. This makes is a rough granularity pass that will remove entire classes if they arent selected. If we need finer granularity in the future we can make individual methods within classes Selective though instrumenting that will be significantly more involved I think. On a linux build only __torch__.torch.classes._nnapi.Compilation remains unselective. I cant find where its registered :P (theres a couple Android only ones and presumably some metal only ones as well) Many of the classes registered in functions returned a reference to the class that was created. I talked with dreiss about it and we decided that this seemingly didnt serve any purpose, and leaving it like that would make the return value difficult (but possible) to create with selectivity. Since it seems useless anyway I just changed them to return an int so that they can still be called from a global scope, but not have any issues with the return type. ghstack-source-id: 141690776 Test Plan: CI, model unit tests, test models in prod apps Reviewed By: dhruvbird Differential Revision: D31092564 fbshipit-source-id: 657f7eb83490292436c15cf134ceca9b72fb9e1a
Author
Parents
Loading