pytorch/test/cpp
Antonio Kim f3f327e103 Decouple LTC from TS Backend using Lazy IR Builder
Next stage of breaking up https://github.com/pytorch/pytorch/pull/74710

IR builder class introduced to decouple the explicit usage of `TsNode` in core lazy tensors.

Requires https://github.com/pytorch/pytorch/pull/75324 to be merged in first.

**Background**
- there are ~ 5 special ops used in lazy core but defined as :public {Backend}Node.  (DeviceData, Expand, Scalar...)
- we currently require all nodes derive from {Backend}Node, so that backends can make this assumption safely
- it is hard to have shared 'IR classes' in core/ because they depend on 'Node'

**Motivation**

1. avoid copy-paste of "special" node classes for each backend
2. in general decouple and remove all dependencies that LTC has on the TS backend

**Summary of changes**
- new 'IRBuilder' interface that knows how to make 5 special ops
- move 'special' node classes to `ts_backend/`
- implement TSIRBuilder that makes the special TS Nodes
- new backend interface API to get the IRBuilder
- update core code to call the builder

CC: @wconstab @JackCaoG @henrytwo

Partially Fixes #74628

Pull Request resolved: https://github.com/pytorch/pytorch/pull/75433
Approved by: https://github.com/wconstab
2022-04-28 02:07:02 +00:00
..
api Extend jit::load to work on flatbuffer file; Take 2 (#75256) 2022-04-06 17:54:01 +00:00
c10d Add cuda-11.3+clang9 build workflow (take 2) 2022-04-11 17:13:01 +00:00
common
dist_autograd Fix distributed autograd gradients synchronization (#57792) 2021-05-09 17:32:59 -07:00
jit [JIT] Register decomp reland 2022-04-26 23:17:18 +00:00
lazy Decouple LTC from TS Backend using Lazy IR Builder 2022-04-28 02:07:02 +00:00
lite_interpreter_runtime [PyTorch] Add codegen unboxing ability (#69881) 2022-03-01 23:28:13 +00:00
monitor torch/monitor: merge Interval and FixedCount stats (#72009) 2022-01-30 23:21:59 +00:00
profiler [RecordFunction] More effecient machinery to determine which callbacks to run. (#75807) 2022-04-19 20:46:16 +00:00
rpc Remove ProcessGroup from TensorPipeAgent initialization (#68128) 2021-11-11 12:28:55 -08:00
tensorexpr Revert "[nnc] Strides to Tensor (#72962)" 2022-04-25 19:50:00 +00:00
__init__.py remediation of S205607 2020-07-17 17:19:47 -07:00