Skip to content

Commit 17be934

Browse files
fix test error in main (#3856)
1 parent d1efddd commit 17be934

File tree

7 files changed

+21
-20
lines changed

7 files changed

+21
-20
lines changed

.github/workflows/build-test-linux-x86_64.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ jobs:
398398
set -euo pipefail
399399
pushd .
400400
cd tests/py/dynamo
401-
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/*
401+
python -m pytest -ra --junitxml=${RUNNER_TEST_RESULTS_DIR}/l2_dynamo_core_tests_results.xml -k "not test_000_ and not test_001_" runtime/*
402402
popd
403403
404404
L2-dynamo-plugin-tests:

.github/workflows/build-test-linux-x86_64_rtx.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ jobs:
342342
set -euo pipefail
343343
pushd .
344344
cd tests/py/dynamo
345-
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/*
345+
python -m pytest -ra --junitxml=${RUNNER_TEST_RESULTS_DIR}/l2_dynamo_core_tests_results.xml -k "not test_000_ and not test_001_" runtime/*
346346
popd
347347
348348
L2-dynamo-plugin-tests:

.github/workflows/build-test-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ jobs:
371371
set -euo pipefail
372372
pushd .
373373
cd tests/py/dynamo
374-
../../../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/*
374+
../../../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/*
375375
popd
376376
377377
L2-dynamo-plugin-tests:

.github/workflows/build-test-windows_rtx.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ jobs:
326326
set -euo pipefail
327327
pushd .
328328
cd tests/py/dynamo
329-
../../../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/*
329+
../../../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/*
330330
popd
331331
332332
L2-dynamo-plugin-tests:
@@ -352,7 +352,7 @@ jobs:
352352
set -euo pipefail
353353
pushd .
354354
cd tests/py/dynamo
355-
../../../packaging/vc_env_helper.bat python -m pytest -ra --junitxml=${RUNNER_TEST_RESULTS_DIR}/l2_dynamo_plugins_tests_results.xml --ignore automatic_plugin/
355+
../../../packaging/vc_env_helper.bat python -m pytest -ra --junitxml=${RUNNER_TEST_RESULTS_DIR}/l2_dynamo_plugins_tests_results.xml automatic_plugin/
356356
popd
357357
358358

py/torch_tensorrt/_compile.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -283,14 +283,15 @@ def _fx_input_interface(
283283
return compiled_fx_module
284284
elif target_ir == _IRType.dynamo:
285285
# Prepare torch and torchtrt inputs
286-
if not arg_inputs and not inputs:
286+
if arg_inputs is None and inputs is None:
287287
raise AssertionError("'arg_inputs' and 'inputs' should not both be None.")
288288

289-
elif arg_inputs and inputs:
289+
elif arg_inputs is not None and inputs is not None:
290290
raise AssertionError(
291291
"'arg_inputs' and 'inputs' should not be used at the same time."
292292
)
293-
arg_inputs = inputs or arg_inputs
293+
if inputs is not None:
294+
arg_inputs = inputs
294295

295296
if kwarg_inputs is None:
296297
kwarg_inputs = {}
@@ -383,10 +384,10 @@ def cross_compile_for_windows(
383384
)
384385

385386
# Prepare torch and torchtrt inputs
386-
if not arg_inputs and not inputs:
387+
if arg_inputs is None and inputs is None:
387388
raise AssertionError("'arg_inputs' and 'inputs' should not both be None.")
388389

389-
elif arg_inputs and inputs:
390+
elif arg_inputs is not None and inputs is not None:
390391
raise AssertionError(
391392
"'arg_inputs' and 'inputs' should not be used at the same time."
392393
)
@@ -484,10 +485,10 @@ def convert_method_to_trt_engine(
484485
enabled_precisions if enabled_precisions is not None else {torch.float}
485486
)
486487

487-
if not arg_inputs and not inputs:
488+
if arg_inputs is None and inputs is None:
488489
raise AssertionError("'arg_inputs' and 'inputs' should not both be None.")
489490

490-
elif arg_inputs and inputs:
491+
elif arg_inputs is not None and inputs is not None:
491492
raise AssertionError(
492493
"'arg_inputs' and 'inputs' should not be used at the same time."
493494
)

py/torch_tensorrt/dynamo/_compiler.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -268,12 +268,12 @@ def cross_compile_for_windows(
268268
"When enable_weight_streaming is enabled, it requires use_explicit_typing to be set to True"
269269
)
270270
# Aliasing inputs to arg_inputs for better understanding
271-
if not arg_inputs and not kwarg_inputs and not inputs:
271+
if arg_inputs is None and kwarg_inputs is None and inputs is None:
272272
raise AssertionError(
273273
"'arg_inputs', 'kwarg_inputs' and 'inputs' should not all be None."
274274
)
275275

276-
elif arg_inputs and inputs:
276+
elif arg_inputs is not None and inputs is not None:
277277
raise AssertionError(
278278
"'arg_inputs' and 'inputs' should not be used at the same time."
279279
)
@@ -604,12 +604,12 @@ def compile(
604604
"When enable_weight_streaming is enabled, it requires use_explicit_typing to be set to True"
605605
)
606606
# Aliasing inputs to arg_inputs for better understanding
607-
if not arg_inputs and not kwarg_inputs and not inputs:
607+
if arg_inputs is None and kwarg_inputs is None and inputs is None:
608608
raise AssertionError(
609609
"'arg_inputs', 'kwarg_inputs' and 'inputs' should not all be None."
610610
)
611611

612-
elif arg_inputs and inputs:
612+
elif arg_inputs is not None and inputs is not None:
613613
raise AssertionError(
614614
"'arg_inputs' and 'inputs' should not be used at the same time."
615615
)
@@ -1223,12 +1223,12 @@ def convert_exported_program_to_serialized_trt_engine(
12231223
"When enable_weight_streaming is enabled, it requires use_explicit_typing to be set to True"
12241224
)
12251225
# Aliasing inputs to arg_inputs for better understanding
1226-
if not arg_inputs and not kwarg_inputs and not inputs:
1226+
if arg_inputs is None and kwarg_inputs is None and inputs is None:
12271227
raise AssertionError(
12281228
"'arg_inputs', 'kwarg_inputs' and 'inputs' should not all be None."
12291229
)
12301230

1231-
elif arg_inputs and inputs:
1231+
elif arg_inputs is not None and inputs is not None:
12321232
raise AssertionError(
12331233
"'arg_inputs' and 'inputs' should not be used at the same time."
12341234
)

py/torch_tensorrt/dynamo/_tracer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ def trace(
5858
"""
5959

6060
# Set log level at the top of compilation (torch_tensorrt.dynamo)
61-
if not arg_inputs and not inputs:
61+
if arg_inputs is None and inputs is None:
6262
raise AssertionError("'arg_inputs' and 'inputs' should not both be None.")
6363

64-
elif arg_inputs and inputs:
64+
elif arg_inputs is not None and inputs is not None:
6565
raise AssertionError(
6666
"'arg_inputs' and 'inputs' should not be used at the same time."
6767
)

0 commit comments

Comments
 (0)