Skip to content

Commit

Permalink
[FxImporter][TOSA] Enable FxImporter to TOSA e2e tests (llvm#3349)
Browse files Browse the repository at this point in the history
Signed-off-by: Suraj Sudhir <[email protected]>
  • Loading branch information
sjarus authored May 15, 2024
1 parent ccb772c commit 0ca8802
Show file tree
Hide file tree
Showing 2 changed files with 753 additions and 0 deletions.
7 changes: 7 additions & 0 deletions projects/pt1/e2e_testing/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
FX_IMPORTER_CRASHING_SET,
FX_IMPORTER_STABLEHLO_XFAIL_SET,
FX_IMPORTER_STABLEHLO_CRASHING_SET,
FX_IMPORTER_TOSA_XFAIL_SET,
)

# Import tests to register them in the global registry.
Expand All @@ -76,6 +77,7 @@ def _get_argparse():
"onnx",
"fx_importer",
"fx_importer_stablehlo",
"fx_importer_tosa",
]
parser = argparse.ArgumentParser(description="Run torchscript e2e tests.")
parser.add_argument(
Expand All @@ -95,6 +97,7 @@ def _get_argparse():
"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.
""",
)
parser.add_argument(
Expand Down Expand Up @@ -179,6 +182,10 @@ def main():
config = FxImporterTestConfig(LinalgOnTensorsStablehloBackend(), "stablehlo")
xfail_set = FX_IMPORTER_STABLEHLO_XFAIL_SET
crashing_set = FX_IMPORTER_STABLEHLO_CRASHING_SET
elif args.config == "fx_importer_tosa":
config = FxImporterTestConfig(LinalgOnTensorsTosaBackend(), "tosa")
xfail_set = FX_IMPORTER_TOSA_XFAIL_SET
crashing_set = set()
elif args.config == "torchdynamo":
config = TorchDynamoTestConfig(RefBackendLinalgOnTensorsBackend())
xfail_set = TORCHDYNAMO_XFAIL_SET
Expand Down
Loading

0 comments on commit 0ca8802

Please sign in to comment.