pytorch/caffe2/python/onnx
Yinghai Lu 3ea15af630 [Onnxifi] Allow adding timeout for OnnxifOp run (#40081)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/40081

Adding the functionality to enable timeout of OnnxifiOp run. In the case of backend hanging, it can error out quickly.

Test Plan:
```
 buck test glow/fb/test:test_onnxifinnpi -- test_timeout
```

Reviewed By: jackm321

Differential Revision: D22064533

fbshipit-source-id: 25487287c10ab217eb95692f09d48e13e19436ab
2020-06-17 16:21:25 -07:00
..
bin Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
tests [ONNX] Bump up ONNX submodule to a82c6a7010e2e332d8f74ad5b0c726fd47c85376 (#39372) 2020-06-02 21:08:14 -07:00
__init__.py Move onnx-caffe2 inside caffe2 (#1921) 2018-02-20 13:56:52 -08:00
backend_cpp_rep.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
backend_rep.py Add JIT pass to insert permutes for conv ops (#30679) 2019-12-05 18:51:16 -08:00
backend.py Fix typos (#30606) 2019-12-02 20:17:42 -08:00
error.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
frontend.py Fix caffe2 => onnx exporter for ConvTranspose (#14143) 2018-11-26 15:51:42 -08:00
helper.py Add debug logic to c2_ref_test and its helpers (#19359) 2019-04-22 12:08:55 -07:00
onnxifi.py [Onnxifi] Allow adding timeout for OnnxifOp run (#40081) 2020-06-17 16:21:25 -07:00
ONNXOpCoverage.md Fix typos, via a Levenshtein-type corrector (#31523) 2020-01-17 16:03:19 -08:00
README.md Add README and ONNXOpCoverage doc back (#2102) 2018-03-01 17:05:25 -08:00
test_onnxifi.py Skip tests if C2/ONNX models cannot be read (#18494) 2019-03-27 11:21:44 -07:00
workspace.py Disallow using the OOP api workspace as context managers (#6456) 2018-04-09 22:13:54 -07:00

Caffe2 implementation of Open Neural Network Exchange (ONNX)

Usage

Installation

onnx-caffe2 is installed as a part of Caffe2. Please follow the instructions to install Caffe2.

Folder Structure

  • ./: the main folder that all code lies under
    • frontend.py: translate from caffe2 model to onnx model
    • backend.py: execution engine that runs onnx on caffe2
  • tests/: test files

Testing

onnx-caffe2 uses pytest as test driver. In order to run tests, first you need to install pytest:

pip install pytest-cov

After installing pytest, do

pytest

to run tests.

Testing coverage issues/status: https://github.com/caffe2/caffe2/blob/master/caffe2/python/onnx/ONNXOpCoverage.md

Development

During development it's convenient to install caffe2 in development mode:

cd /path/to/caffe2
pip install -e caffe2/

License

MIT License