Files
pytorch/scripts/onnx
BowenBao 73f6601cfc [ONNX] Refactor heavy memory usage tests
* Move memory heavy tests from `test_pytorch_onnx_onnxruntime.py` to
  `test_models_onnxruntime.py`. The former is run in parallel in CI,
  while the latter is not. A change is that the moved tests are now
  only covered in default opset export.
* Refactor and create base class for tests that export model to ONNX
  and verify with ONNX Runtime. The new base class are parameterized
  with `opset_version` and `is_script`. Further work can be done to
  refactor existing test classes in `test_pytorch_onnx_onnxruntime.py`.
  See #75630
* Reduce unnecessarily large tensor size in
  `test_pytorch_onnx_onnxruntime.py` to further reduce memory usage
  and test time.

After this PR, the running time for `test_pytorch_onnx_onnxruntime.py`
is reduced from `1338.82s (0:22:18)` to `225.07s (0:03:45)`,
benchmarked on 10900x with `-n 10`.

Fixes #79179

Pull Request resolved: https://github.com/pytorch/pytorch/pull/79640

Approved by: https://github.com/justinchuby, https://github.com/garymm
2022-06-18 02:28:00 +00:00
..