diff --git a/.github/workflows/build-test-linux-x86_64.yml b/.github/workflows/build-test-linux-x86_64.yml index 4a2f1d6913..da3124c472 100644 --- a/.github/workflows/build-test-linux-x86_64.yml +++ b/.github/workflows/build-test-linux-x86_64.yml @@ -398,7 +398,7 @@ jobs: set -euo pipefail pushd . cd tests/py/dynamo - python -m pytest -ra --junitxml=${RUNNER_TEST_RESULTS_DIR}/l2_dynamo_core_tests_results.xml --ignore runtime/test_000_* --ignore runtime/test_001_* --ignore runtime/gen_hw_compat* runtime/* + python -m pytest -ra --junitxml=${RUNNER_TEST_RESULTS_DIR}/l2_dynamo_core_tests_results.xml -k "not test_000_ and not test_001_" runtime/* popd L2-dynamo-plugin-tests: diff --git a/.github/workflows/build-test-linux-x86_64_rtx.yml b/.github/workflows/build-test-linux-x86_64_rtx.yml index 0de6086900..c771b4ce67 100644 --- a/.github/workflows/build-test-linux-x86_64_rtx.yml +++ b/.github/workflows/build-test-linux-x86_64_rtx.yml @@ -342,7 +342,7 @@ jobs: set -euo pipefail pushd . cd tests/py/dynamo - python -m pytest -ra --junitxml=${RUNNER_TEST_RESULTS_DIR}/l2_dynamo_core_tests_results.xml --ignore runtime/test_001_* --ignore runtime/test_000_* --ignore runtime/gen_hw_compat* runtime/* + python -m pytest -ra --junitxml=${RUNNER_TEST_RESULTS_DIR}/l2_dynamo_core_tests_results.xml -k "not test_000_ and not test_001_" runtime/* popd L2-dynamo-plugin-tests: diff --git a/.github/workflows/build-test-windows.yml b/.github/workflows/build-test-windows.yml index b1c037d6ff..86324f68f9 100644 --- a/.github/workflows/build-test-windows.yml +++ b/.github/workflows/build-test-windows.yml @@ -371,7 +371,7 @@ jobs: set -euo pipefail pushd . cd tests/py/dynamo - ../../../packaging/vc_env_helper.bat python -m pytest -ra --junitxml=${RUNNER_TEST_RESULTS_DIR}/l2_dynamo_core_tests_results.xml --ignore runtime/test_000_* --ignore runtime/gen_hw_compat* --ignore runtime/test_001_* runtime/* + ../../../packaging/vc_env_helper.bat python -m pytest -ra --junitxml=${RUNNER_TEST_RESULTS_DIR}/l2_dynamo_core_tests_results.xml -k "not test_000_ and not test_001_" runtime/* popd L2-dynamo-plugin-tests: diff --git a/.github/workflows/build-test-windows_rtx.yml b/.github/workflows/build-test-windows_rtx.yml index 7072361ccb..d6aa3f5764 100644 --- a/.github/workflows/build-test-windows_rtx.yml +++ b/.github/workflows/build-test-windows_rtx.yml @@ -326,7 +326,7 @@ jobs: set -euo pipefail pushd . cd tests/py/dynamo - ../../../packaging/vc_env_helper.bat python -m pytest -ra --junitxml=${RUNNER_TEST_RESULTS_DIR}/l2_dynamo_core_tests_results.xml --ignore runtime/test_000_* --ignore runtime/gen_hw_compat* --ignore runtime/test_001_* --ignore runtime/test_000_* runtime/* + ../../../packaging/vc_env_helper.bat python -m pytest -ra --junitxml=${RUNNER_TEST_RESULTS_DIR}/l2_dynamo_core_tests_results.xml -k "not test_000_ and not test_001_" runtime/* popd L2-dynamo-plugin-tests: @@ -352,7 +352,7 @@ jobs: set -euo pipefail pushd . cd tests/py/dynamo - ../../../packaging/vc_env_helper.bat python -m pytest -ra --junitxml=${RUNNER_TEST_RESULTS_DIR}/l2_dynamo_plugins_tests_results.xml --ignore automatic_plugin/ + ../../../packaging/vc_env_helper.bat python -m pytest -ra --junitxml=${RUNNER_TEST_RESULTS_DIR}/l2_dynamo_plugins_tests_results.xml automatic_plugin/ popd diff --git a/py/torch_tensorrt/_compile.py b/py/torch_tensorrt/_compile.py index 8d8c51cbfc..f9df21856c 100644 --- a/py/torch_tensorrt/_compile.py +++ b/py/torch_tensorrt/_compile.py @@ -283,14 +283,15 @@ def _fx_input_interface( return compiled_fx_module elif target_ir == _IRType.dynamo: # Prepare torch and torchtrt inputs - if not arg_inputs and not inputs: + if arg_inputs is None and inputs is None: raise AssertionError("'arg_inputs' and 'inputs' should not both be None.") - elif arg_inputs and inputs: + elif arg_inputs is not None and inputs is not None: raise AssertionError( "'arg_inputs' and 'inputs' should not be used at the same time." ) - arg_inputs = inputs or arg_inputs + if inputs is not None: + arg_inputs = inputs if kwarg_inputs is None: kwarg_inputs = {} @@ -383,10 +384,10 @@ def cross_compile_for_windows( ) # Prepare torch and torchtrt inputs - if not arg_inputs and not inputs: + if arg_inputs is None and inputs is None: raise AssertionError("'arg_inputs' and 'inputs' should not both be None.") - elif arg_inputs and inputs: + elif arg_inputs is not None and inputs is not None: raise AssertionError( "'arg_inputs' and 'inputs' should not be used at the same time." ) @@ -484,10 +485,10 @@ def convert_method_to_trt_engine( enabled_precisions if enabled_precisions is not None else {torch.float} ) - if not arg_inputs and not inputs: + if arg_inputs is None and inputs is None: raise AssertionError("'arg_inputs' and 'inputs' should not both be None.") - elif arg_inputs and inputs: + elif arg_inputs is not None and inputs is not None: raise AssertionError( "'arg_inputs' and 'inputs' should not be used at the same time." ) diff --git a/py/torch_tensorrt/dynamo/_compiler.py b/py/torch_tensorrt/dynamo/_compiler.py index f4fc806fde..c8ad938032 100644 --- a/py/torch_tensorrt/dynamo/_compiler.py +++ b/py/torch_tensorrt/dynamo/_compiler.py @@ -268,12 +268,12 @@ def cross_compile_for_windows( "When enable_weight_streaming is enabled, it requires use_explicit_typing to be set to True" ) # Aliasing inputs to arg_inputs for better understanding - if not arg_inputs and not kwarg_inputs and not inputs: + if arg_inputs is None and kwarg_inputs is None and inputs is None: raise AssertionError( "'arg_inputs', 'kwarg_inputs' and 'inputs' should not all be None." ) - elif arg_inputs and inputs: + elif arg_inputs is not None and inputs is not None: raise AssertionError( "'arg_inputs' and 'inputs' should not be used at the same time." ) @@ -604,12 +604,12 @@ def compile( "When enable_weight_streaming is enabled, it requires use_explicit_typing to be set to True" ) # Aliasing inputs to arg_inputs for better understanding - if not arg_inputs and not kwarg_inputs and not inputs: + if arg_inputs is None and kwarg_inputs is None and inputs is None: raise AssertionError( "'arg_inputs', 'kwarg_inputs' and 'inputs' should not all be None." ) - elif arg_inputs and inputs: + elif arg_inputs is not None and inputs is not None: raise AssertionError( "'arg_inputs' and 'inputs' should not be used at the same time." ) @@ -1223,12 +1223,12 @@ def convert_exported_program_to_serialized_trt_engine( "When enable_weight_streaming is enabled, it requires use_explicit_typing to be set to True" ) # Aliasing inputs to arg_inputs for better understanding - if not arg_inputs and not kwarg_inputs and not inputs: + if arg_inputs is None and kwarg_inputs is None and inputs is None: raise AssertionError( "'arg_inputs', 'kwarg_inputs' and 'inputs' should not all be None." ) - elif arg_inputs and inputs: + elif arg_inputs is not None and inputs is not None: raise AssertionError( "'arg_inputs' and 'inputs' should not be used at the same time." ) diff --git a/py/torch_tensorrt/dynamo/_tracer.py b/py/torch_tensorrt/dynamo/_tracer.py index 888dddbc3c..0595c6a8f9 100644 --- a/py/torch_tensorrt/dynamo/_tracer.py +++ b/py/torch_tensorrt/dynamo/_tracer.py @@ -58,10 +58,10 @@ def trace( """ # Set log level at the top of compilation (torch_tensorrt.dynamo) - if not arg_inputs and not inputs: + if arg_inputs is None and inputs is None: raise AssertionError("'arg_inputs' and 'inputs' should not both be None.") - elif arg_inputs and inputs: + elif arg_inputs is not None and inputs is not None: raise AssertionError( "'arg_inputs' and 'inputs' should not be used at the same time." )