pytorch/torch/csrc/jit
Shiyan Deng 19ca883f8b [pytorch][jit] allow passing in obj loader in unpickle api (#109730)
Summary: We are trying to use wired message to pass python objects like KJT. In order to make JIT be able to unpickle it, we need to provide a type resolver as well as an obj loader. This diff modify the interface to let we be able to do that.

Test Plan:
Rely on current CI to make sure existing usage doesn't break.

In the next diff, test e2e

Differential Revision: D49438569

Pull Request resolved: https://github.com/pytorch/pytorch/pull/109730
Approved by: https://github.com/davidberard98
2023-09-26 23:50:20 +00:00
..
api [Reland] Move torch::make_unique to std::make_unique (#109780) 2023-09-21 18:30:21 +00:00
backends [PyTorch][Coreml] Bubble up NSError from loadModel (#109444) 2023-09-19 20:08:37 +00:00
codegen Revert "[1/N] Cleanup header inclusions in torch_cpu by iwyu (#101178)" 2023-09-25 20:05:25 +00:00
cuda add additional stream priority for cuda streams (#101956) 2023-05-27 02:36:16 +00:00
docs fix typo in serialization.md (#106191) 2023-07-29 00:01:59 +00:00
frontend Revert "[1/N] Cleanup header inclusions in torch_cpu by iwyu (#101178)" 2023-09-25 20:05:25 +00:00
ir [Reland] Move torch::make_unique to std::make_unique (#109780) 2023-09-21 18:30:21 +00:00
mobile Revert "[1/N] Cleanup header inclusions in torch_cpu by iwyu (#101178)" 2023-09-25 20:05:25 +00:00
operator_upgraders [RELAND] Remove some unnecessary <iostream> includes from headers (#108150) 2023-09-20 21:55:15 +00:00
passes Revert "[1/N] Cleanup header inclusions in torch_cpu by iwyu (#101178)" 2023-09-25 20:05:25 +00:00
python Allow inferring size-nature from sizes passed to empty constructor (#109720) 2023-09-21 17:57:40 +00:00
runtime Revert "[1/N] Cleanup header inclusions in torch_cpu by iwyu (#101178)" 2023-09-25 20:05:25 +00:00
serialization [pytorch][jit] allow passing in obj loader in unpickle api (#109730) 2023-09-26 23:50:20 +00:00
tensorexpr Revert "[1/N] Cleanup header inclusions in torch_cpu by iwyu (#101178)" 2023-09-25 20:05:25 +00:00
testing [Reland] Eliminate invocations of c10::stoi,c10::stod,c10::stoull,c10::stoll (#109566) 2023-09-19 07:15:25 +00:00
jit_log.cpp [RELAND] Remove some unnecessary <iostream> includes from headers (#108150) 2023-09-20 21:55:15 +00:00
jit_log.h
jit_opt_limit.cpp [Reland] Eliminate invocations of c10::stoi,c10::stod,c10::stoull,c10::stoll (#109566) 2023-09-19 07:15:25 +00:00
jit_opt_limit.h Fix typo in jit_opt_limit.h (#106684) 2023-08-07 13:51:55 +00:00
JIT-AUTOCAST.md Fix missing mandatory device_type argument in autocast docstring (#97223) 2023-06-27 01:54:54 +00:00
OVERVIEW.md
README.md
resource_guard.h

PyTorch JIT

This folder contains (most of) the C++ code for the PyTorch JIT, a language and compiler stack for executing PyTorch models portably and efficiently. To learn more about the JIT from a user perspective, please consult our reference documentation and tutorials.

A brief summary of the source tree:

  • OVERVIEW.md: High-level technical overview of the JIT.
  • frontend/: Taking PyTorch modules in Python and translating them into the JIT IR.
  • ir/: Core IR abstractions.
  • runtime/: Interpreter, graph execution, and JIT operators.
  • codegen/: Generating efficient, hardware-specific code for JIT subgraphs.
  • serialization/: Saving and loading modules.
  • api/: Any user-facing C++ or Python interfaces.
  • python/: Binding stuff into Python or accessing information from the Python environment.
  • testing/: Utilities and helpers for testing.
  • mobile/: Mobile-specific implementations of runtime components.
  • passes/: IR-to-IR passes, generally for optimization and lowering.
  • generated/: This folder is generated by the PyTorch build, and contains bindings for native PyTorch operators into the JIT.

Refer to each folder for more in-depth documentation.

Other relevant parts of the codebase not contained here:

  • aten/src/ATen/core: contains JIT code re-used by other elements of the runtime system (eager, mobile, etc.)