Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve save_for_mobile cxx binary (pytorch#43721)
Summary: Pull Request resolved: pytorch#43721 We can combine optimization pass and save_for_mobile together to reduce friction. Since lite interpreter model can also be used in full JIT, I don't think we need the option to save it as full JIT model. Also - improved usage message - print op list before and after optimization pass Test Plan: ``` buck run //xplat/caffe2:optimize_for_mobile -- --model=/home/linbin/sparkspot.pt Building: finished in 12.4 sec (100%) 2597/2597 jobs, 2 updated Total time: 12.5 sec pt_operator_library( name = "old_op_library", ops = [ "aten::_convolution", "aten::adaptive_avg_pool2d", "aten::add_.Tensor", "aten::batch_norm", "aten::mul.Tensor", "aten::relu_", "aten::softplus", "aten::sub.Tensor", ], ) pt_operator_library( name = "new_op_library", ops = [ "aten::adaptive_avg_pool2d", "aten::add_.Tensor", "aten::batch_norm", "aten::mul.Tensor", "aten::relu_", "aten::softplus", "aten::sub.Tensor", "prepacked::conv2d_clamp_run", ], ) The optimized model for lite interpreter was saved to /home/linbin/sparkspot_mobile_optimized.bc ``` ``` buck run //xplat/caffe2:optimize_for_mobile -- --model=/home/linbin/sparkspot.pt --backend=vulkan ``` Reviewed By: kimishpatel Differential Revision: D23363533 fbshipit-source-id: f7fd61aaeda5944de5bf198e7f93cacf8368babd
- Loading branch information