Skip to content

Commit

Permalink
Bring the onnx/onnx_tosa test back
Browse files Browse the repository at this point in the history
  • Loading branch information
AmosLewis committed Sep 6, 2024
1 parent 525e5cd commit eb9fc70
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions build_tools/ci/test_posix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ torch_version="${1:-unknown}"

export PYTHONPATH="$repo_root/build/tools/torch-mlir/python_packages/torch_mlir:$repo_root/projects/pt1"

echo "::group::Run ONNX e2e integration tests"
python -m e2e_testing.main --config=onnx -v
echo "::endgroup::"

case $torch_version in
nightly)
# Failing with: NotImplementedError:
Expand Down
7 changes: 5 additions & 2 deletions projects/pt1/e2e_testing/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from torch_mlir_e2e_test.configs import (
LazyTensorCoreTestConfig,
NativeTorchTestConfig,
OnnxBackendTestConfig,
TorchScriptTestConfig,
FxImporterTestConfig,
)
Expand Down Expand Up @@ -70,6 +71,8 @@ def _get_argparse():
"native_torch",
"torchscript",
"lazy_tensor_core",
"onnx",
"onnx_tosa",
"fx_importer",
"fx_importer_stablehlo",
"fx_importer_tosa",
Expand All @@ -89,11 +92,11 @@ def _get_argparse():
"torchscript": compile the model to a torch.jit.ScriptModule, and then run that as-is (useful for verifying TorchScript is modeling the program correctly).
"lazy_tensor_core": run the model through the Lazy Tensor Core frontend and execute the traced graph.
# "torchdynamo": run the model through the TorchDynamo frontend and execute the graph using Linalg-on-Tensors.
# "onnx": export to the model via onnx and reimport using the torch-onnx-to-torch path.
"onnx": export to the model via onnx and reimport using the torch-onnx-to-torch path.
"fx_importer": run the model through the fx importer frontend and execute the graph using Linalg-on-Tensors.
"fx_importer_stablehlo": run the model through the fx importer frontend and execute the graph using Stablehlo backend.
"fx_importer_tosa": run the model through the fx importer frontend and execute the graph using the TOSA backend.
# "onnx_tosa": Import ONNX to Torch via the torch-onnx-to-torch path and execute the graph using the TOSA backend.
"onnx_tosa": Import ONNX to Torch via the torch-onnx-to-torch path and execute the graph using the TOSA backend.
""",
)
parser.add_argument(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@

from .lazy_tensor_core import LazyTensorCoreTestConfig
from .native_torch import NativeTorchTestConfig
from .onnx_backend import OnnxBackendTestConfig
from .torchscript import TorchScriptTestConfig
from .fx_importer_backend import FxImporterTestConfig

0 comments on commit eb9fc70

Please sign in to comment.