diff --git a/py/torch_tensorrt/_compile.py b/py/torch_tensorrt/_compile.py index c26d7a80b7..acae618f1b 100644 --- a/py/torch_tensorrt/_compile.py +++ b/py/torch_tensorrt/_compile.py @@ -627,6 +627,10 @@ def save( raise ValueError( f"Provided output_format {output_format} is not supported. Supported options are exported_program | torchscript" ) + if output_format == "aot_inductor" and platform.system() != "Linux": + raise ValueError( + f"The AOT Inductor format is only supported on Linux, {platform.system()} is not a supported platform for this format" + ) if not file_path: raise ValueError("File path cannot be empty. Please provide a valid file path") diff --git a/tests/py/dynamo/models/test_export_serde.py b/tests/py/dynamo/models/test_export_serde.py index 6166e16949..e8ce2df8e4 100644 --- a/tests/py/dynamo/models/test_export_serde.py +++ b/tests/py/dynamo/models/test_export_serde.py @@ -1,5 +1,6 @@ import importlib import os +import platform import tempfile import unittest @@ -645,6 +646,10 @@ def forward(self, x): @pytest.mark.unit +@unittest.skipIf( + platform.system() != "Linux", + "Save and load in AOT Inductor format is only supported on Linux", +) def test_save_load_aoti(ir, tmp_path): """ This tests save/load API on the AOTI format