Skip to content

TorchLib Debug torch.onnx.dynamo_export integration tests

Justin Chu edited this page Oct 24, 2023 · 3 revisions
  1. The tests are in pytorch/test/onnx/test_fx_op_consistency.py at main · pytorch/pytorch (github.com). To run, use
pytest test/onnx/test_op_consistency.py -k <operator name>
  1. Edit the code and filter the desired test case in https://github.com/pytorch/pytorch/blob/a0043d48401540b0f46a77caaa27f879e13584aa/test/onnx/test_fx_op_consistency.py#L710
  2. Obtain the exported model at https://github.com/pytorch/pytorch/blob/a0043d48401540b0f46a77caaa27f879e13584aa/test/onnx/onnx_test_common.py#L283 with a. model_proto = export_output.model_proto
  3. Obtain the inputs provided in https://github.com/pytorch/pytorch/blob/a0043d48401540b0f46a77caaa27f879e13584aa/test/onnx/onnx_test_common.py#L264-L265
  4. After getting the model proto, run it with ONNX Runtime and compare results with the corresponding torch API (e.g. torch.embedding_bag) (not the torch.ops.aten API, because the integration test tests the torch API)
Clone this wiki locally