pytorch/torch/csrc/jit/python
Zachary DeVito 60518d10f6 [deploy] torch::deploy API (#51754)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/51754

This API allows you to manage multiple python interpreters in a single
process to deploy PyTorch models packaged with torch.package.

torch/csrc/deploy/deploy.h contains the API definition
torch/csrc/deploy/test_deploy.cpp has some examples.

Notes:
* mutex is added to PyTorchStreamReader to make it safe to use from multiple threads at once.
* USE_DEPLOY is only true for the special libtorch_deployinterpreter.so library, when enabled
  we use a hash table to maintain PyObject <> at::Tensor mappping rather than the internal pointer
  in Tensor since >1 interpreter may have a reference to the tensor.
* serialization.py has some additional functions for creating pickle objects
  but keeping storages in memory for use transfering tensors between interpreters

Test Plan: Imported from OSS

Reviewed By: wconstab

Differential Revision: D26329468

Pulled By: zdevito

fbshipit-source-id: d75f4ebb9a27f1d911179d9996041bcb3ca04a07
2021-02-18 02:30:08 -08:00
..
init.cpp [deploy] torch::deploy API (#51754) 2021-02-18 02:30:08 -08:00
init.h
module_python.h
pybind_utils.cpp Graceful invalidation of Python Node/Value/Block when C++ object is deleted (#50326) 2021-02-04 01:34:46 -08:00
pybind_utils.h [JIT/Futures] support set_exception api (#50983) 2021-02-04 20:22:19 -08:00
pybind.h Graceful invalidation of Python Node/Value/Block when C++ object is deleted (#50326) 2021-02-04 01:34:46 -08:00
python_arg_flatten.cpp [ONNX] ONNX dev branch merge 01-06-2021 (#50163) 2021-01-13 13:51:21 -08:00
python_arg_flatten.h Move torch/csrc/utils/hash.h to c10/util/hash.h. (#42503) 2020-08-29 17:47:00 -07:00
python_custom_class.cpp [JIT] Add static method support for TorchBind (#51177) 2021-02-13 19:41:27 -08:00
python_custom_class.h
python_interpreter.cpp Unify boxed function signature between jit and c10 (#37034) 2020-06-29 19:24:26 -07:00
python_ir.cpp Keep alive graph when creating iterators from it (#51951) 2021-02-10 11:09:51 -08:00
python_ir.h
python_ivalue.h Remove DataPtr extractor from CUDAFuture (#48840) 2020-12-19 11:03:45 -08:00
python_sugared_value.cpp [JIT] Add static method support for TorchBind (#51177) 2021-02-13 19:41:27 -08:00
python_sugared_value.h Fix clang-tidy warnings in python_sugared_value.{h,cpp} (#51703) 2021-02-04 21:29:40 -08:00
python_tracer.cpp [Usability] Capture argument names for traced functions and modules (#51775) 2021-02-10 18:28:08 -08:00
python_tracer.h [Usability] Capture argument names for traced functions and modules (#51775) 2021-02-10 18:28:08 -08:00
python_tree_views.cpp Add dict comprehension (#47774) 2020-12-17 15:25:30 -08:00
python_tree_views.h
script_init.cpp [WIP] Add a _flush_compilation_cache for testing (#52001) 2021-02-16 10:49:38 -08:00
script_init.h
update_graph_executor_opt.cpp
update_graph_executor_opt.h