pytorch/test/cpp
Elias Ellison 211bac53ef [JIT] Add optimize_for_inference API (#58193)
Summary:
Freezing exists as a pass which partially evaluates your model and applies generic optimizations which should speed it up. Optimize for inference is a counterpart to these optimizations which runs build & server specific optimizations.  The interaction with existing `optimize_frozen_module` is not great, I guess we could just deprecate the API entirely? it was never officially released but just existed to document the `optimize_numerics` keyword.

Eventually, I would like to add a way of adding example inputs but I didnt add that here because they are not being used at all yet. I also have not yet included a way to blacklist individual optimizations, and would like to wait until we move this to Beta and have a little more clarity on how everything will fit together. I also think blacklisting will be an uncommon use case for the current optimizations.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/58193

Reviewed By: bertmaher, navahgar

Differential Revision: D28443714

Pulled By: eellison

fbshipit-source-id: b032355bb2585720a6d2f00c89d0d9a7ef60e649
2021-05-15 15:50:14 -07:00
..
api Add inference mode python bindings and tests (#58045) 2021-05-13 08:55:35 -07:00
common
dist_autograd Fix distributed autograd gradients synchronization (#57792) 2021-05-09 17:32:59 -07:00
jit [JIT] Add optimize_for_inference API (#58193) 2021-05-15 15:50:14 -07:00
lite_interpreter_runtime Revert D27958477: [PyTorch][Edge] Add v4 and v5 models and remove unused model 2021-04-23 14:42:01 -07:00
rpc Use RPC context streams to cover serde ops (#57926) 2021-05-11 07:07:51 -07:00
tensorexpr [TensorExpr] Implement 'call_raw' in IREval. (#57882) 2021-05-12 14:08:18 -07:00
__init__.py