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>
    
  2. 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

  3. Obtain the exported model at https://github.com/pytorch/pytorch/blob/a0043d48401540b0f46a77caaa27f879e13584aa/test/onnx/onnx_test_common.py#L283 with

    model_proto = export_output.model_proto
  4. Obtain the inputs provided in https://github.com/pytorch/pytorch/blob/a0043d48401540b0f46a77caaa27f879e13584aa/test/onnx/onnx_test_common.py#L264-L265

  5. 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)