pytorch/caffe2/opt
Janet Yang 86eac5b456 [caffe2] Check for number of created subnets and optionally throw an error (#57366)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/57366

We often get error messages such as
```
Model failed AOT (glow ahead-of-time compilation) with exception: Error during AOT optimization (non-provisioned addNetwork):
Non-recoverable device error when adding network:
Error code: PARTITIONER_ERROR
Error message: Did not find a partition with an SLS node

Error return stack:
--------------------------------------------------------------------------------
glow/glow/lib/Partitioner/Partitioner.cpp:1244
--------------------------------------------------------------------------------
glow/glow/lib/Runtime/HostManager/HostManager.cpp:375
--------------------------------------------------------------------------------
```
This makes the error message more clear by checking for the number of OnnixifiOp created before going into Glow. The check is enabled with the `verify_only_single_subnet` flag, and is disabled by default.

Test Plan: Unit tests pass

Reviewed By: khabinov

Differential Revision: D28097674

fbshipit-source-id: 0eefd8f6ec1a82546b759be8e541256bf271a673
2021-07-08 14:29:03 -07:00
..
custom
nql
annotations.cc
annotations.h
backend_cutting.cc [caffe2] Check for number of created subnets and optionally throw an error (#57366) 2021-07-08 14:29:03 -07:00
backend_cutting.h [caffe2] Check for number of created subnets and optionally throw an error (#57366) 2021-07-08 14:29:03 -07:00
backend_cutting_test.cc [caffe2] Check for number of created subnets and optionally throw an error (#57366) 2021-07-08 14:29:03 -07:00
backend_transformer_base.cc
backend_transformer_base.h
bound_shape_inference_test.cc [clang-tidy] Exclude cppcoreguidelines-avoid-magic-numbers (#57841) 2021-05-07 20:02:33 -07:00
bound_shape_inferencer.cc [clang-tidy] Exclude cppcoreguidelines-avoid-magic-numbers (#57841) 2021-05-07 20:02:33 -07:00
bound_shape_inferencer.h
CMakeLists.txt
converter.cc
converter.h
converter_nomigraph_test.cc [clang-tidy] Exclude cppcoreguidelines-avoid-magic-numbers (#57841) 2021-05-07 20:02:33 -07:00
dead_code_elim.cc
dead_code_elim_test.cc
device.cc
device.h
device_test.cc [clang-tidy] Exclude cppcoreguidelines-avoid-magic-numbers (#57841) 2021-05-07 20:02:33 -07:00
distributed.cc
distributed.h
distributed_converter.cc
distributed_test.cc [clang-tidy] Exclude cppcoreguidelines-avoid-magic-numbers (#57841) 2021-05-07 20:02:33 -07:00
fakefp16_transform.cc Add support for MatMul to BatchMatMulFP16Acc{16,32}Fake Op Mapping 2021-06-02 08:32:21 -07:00
fakefp16_transform.h
fusion.cc
fusion.h
glow_net_transform.cc [caffe2] Check for number of created subnets and optionally throw an error (#57366) 2021-07-08 14:29:03 -07:00
glow_net_transform.h [caffe2] Check for number of created subnets and optionally throw an error (#57366) 2021-07-08 14:29:03 -07:00
mobile.cc
mobile.h
mobile_test.cc [clang-tidy] Exclude cppcoreguidelines-avoid-magic-numbers (#57841) 2021-05-07 20:02:33 -07:00
onnx_convert.h
onnxifi_op.cc [caffe2][glow] Share info about current batch_size (#58902) 2021-06-01 01:21:42 -07:00
onnxifi_op.h [caffe2][glow] Share info about current batch_size (#58902) 2021-06-01 01:21:42 -07:00
onnxifi_transformer.cc [caffe2] Check for number of created subnets and optionally throw an error (#57366) 2021-07-08 14:29:03 -07:00
onnxifi_transformer.h [caffe2] Check for number of created subnets and optionally throw an error (#57366) 2021-07-08 14:29:03 -07:00
optimize_ideep.cc [clang-tidy] Exclude cppcoreguidelines-avoid-magic-numbers (#57841) 2021-05-07 20:02:33 -07:00
optimize_ideep.h
optimizer.cc
optimizer.h
passes.cc
passes.h
shape_info.cc
shape_info.h
split_slss_test.cc [clang-tidy] Exclude cppcoreguidelines-avoid-magic-numbers (#57841) 2021-05-07 20:02:33 -07:00
tvm_transformer.cc [caffe2] Check for number of created subnets and optionally throw an error (#57366) 2021-07-08 14:29:03 -07:00
tvm_transformer.h