pytorch/caffe2/utils
Hao Lu 39b4701d31 [caffe2][redo] Reimplement RemoveOpsByType with SSA (#41606)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/41606

The previous diff (D22220798 (59294fbbb9) and D22220797) was recently reverted (D22492356 (28291d3cf8), D22492355) because of a bug associated with the op AsyncIf. The AsyncIf op has net_defs as args and the SSA rewriting didn't take that into account. It has a special path for the op If, but not for AsyncIf. Several changes I made to fix the bug:
1) Add op AsyncIf to the special path for If op in SSA rewriting
2) clear inputs/outputs of the netdefs that are args in If/AsyncIf ops because they're no longer valid
3) revert renamed inputs/outputs in the arg netdefs that are in the external_outputs in the parent netdef

2) and 3) are existing bugs in the `SsaRewrite` function that were just never exposed before.

The algorithm for `RemoveOpsByType` is the same as in my previous diff D22220798 (59294fbbb9). The only new changes in this diff are in `onnx::SsaRewrite` and a few newly added unit tests.

(Note: this ignores all push blocking failures!)

Reviewed By: yinghai

Differential Revision: D22588652

fbshipit-source-id: ebb68ecd1662ea2bae14d4be8f61a75cd8b7e3e6
2020-07-17 16:06:43 -07:00
..
hip
math
threadpool Re-apply PyTorch pthreadpool changes 2020-06-23 19:26:21 -07:00
bench_utils.cc
bench_utils.h
cast.h
cast_test.cc
cblas.h
CMakeLists.txt Re-apply PyTorch pthreadpool changes 2020-06-23 19:26:21 -07:00
conversions.h
cpu_neon.h
cpuid.cc
cpuid.h
cpuid_test.cc
eigen_utils.h
fatal_signal_asan_no_sig_test.cc
filler.h
fixed_divisor.h
fixed_divisor_test.cc
GpuBitonicSort.cuh
GpuDefs.cuh
GpuScanUtils.cuh
map_utils.h
math-detail.h
math.h
math_cpu.cc
math_gpu.cu
math_gpu_test.cc
math_test.cc
murmur_hash3.cc
murmur_hash3.h
proto_convert.cc
proto_convert.h
proto_utils.cc [caffe2][redo] Reimplement RemoveOpsByType with SSA (#41606) 2020-07-17 16:06:43 -07:00
proto_utils.h
proto_utils_test.cc
proto_wrap.cc
proto_wrap.h
signal_handler.cc
signal_handler.h
simple_queue.h
simple_queue_test.cc
smart_tensor_printer.cc
smart_tensor_printer.h
smart_tensor_printer_test.cc
string_utils.cc
string_utils.h
zmq_helper.h