From a738758407e4104865779e8ead669d7337dbeb54 Mon Sep 17 00:00:00 2001 From: Wenqi Li Date: Wed, 1 Nov 2023 12:17:06 +0000 Subject: [PATCH 1/7] temp test py311 Signed-off-by: Wenqi Li --- .github/workflows/pythonapp-min.yml | 1 + tests/utils.py | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/pythonapp-min.yml b/.github/workflows/pythonapp-min.yml index 558c270e33..0a83919389 100644 --- a/.github/workflows/pythonapp-min.yml +++ b/.github/workflows/pythonapp-min.yml @@ -8,6 +8,7 @@ on: - dev - main - releasing/* + - temp-test pull_request: concurrency: diff --git a/tests/utils.py b/tests/utils.py index 4bda8955ed..8502fa48cc 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -736,9 +736,6 @@ def test_script_save(net, *inputs, device=None, rtol=1e-4, atol=0.0): atol=atol, ) except (RuntimeError, AttributeError): - if sys.version_info.major == 3 and sys.version_info.minor == 11: - warnings.warn("skipping py 3.11") - return raise From 4b71086f19fff77cb7ee1b8b5461f9da695def72 Mon Sep 17 00:00:00 2001 From: Wenqi Li Date: Wed, 1 Nov 2023 12:28:20 +0000 Subject: [PATCH 2/7] remove temp test Signed-off-by: Wenqi Li --- .github/workflows/pythonapp-min.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pythonapp-min.yml b/.github/workflows/pythonapp-min.yml index 0a83919389..558c270e33 100644 --- a/.github/workflows/pythonapp-min.yml +++ b/.github/workflows/pythonapp-min.yml @@ -8,7 +8,6 @@ on: - dev - main - releasing/* - - temp-test pull_request: concurrency: From 587d496c5fe1d7829059d0c805874ad9cd974225 Mon Sep 17 00:00:00 2001 From: Wenqi Li Date: Wed, 1 Nov 2023 12:32:23 +0000 Subject: [PATCH 3/7] update Signed-off-by: Wenqi Li --- tests/utils.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/utils.py b/tests/utils.py index 8502fa48cc..608a9d3358 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -763,9 +763,6 @@ def test_onnx_save(net, *inputs, device=None, rtol=1e-4, atol=0.0): atol=atol, ) except (RuntimeError, AttributeError): - if sys.version_info.major == 3 and sys.version_info.minor == 11: - warnings.warn("skipping py 3.11") - return raise From edec4aca4a9f3a1bf5faf9f2da89ac7b792d323a Mon Sep 17 00:00:00 2001 From: Wenqi Li Date: Tue, 31 Oct 2023 12:18:17 +0000 Subject: [PATCH 4/7] add temp test Signed-off-by: Wenqi Li --- .github/workflows/pythonapp-min.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pythonapp-min.yml b/.github/workflows/pythonapp-min.yml index 558c270e33..2a0e32b41d 100644 --- a/.github/workflows/pythonapp-min.yml +++ b/.github/workflows/pythonapp-min.yml @@ -8,6 +8,7 @@ on: - dev - main - releasing/* + - temp-test pull_request: concurrency: @@ -71,7 +72,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.8', '3.9', '3.10', '3.11'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] timeout-minutes: 40 steps: - uses: actions/checkout@v4 From b042e2f9d9587a800cc99c8806c356c0e6afa57a Mon Sep 17 00:00:00 2001 From: Wenqi Li Date: Wed, 1 Nov 2023 14:29:44 +0000 Subject: [PATCH 5/7] remove temp test Signed-off-by: Wenqi Li --- .github/workflows/pythonapp-min.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pythonapp-min.yml b/.github/workflows/pythonapp-min.yml index 2a0e32b41d..90aa50f782 100644 --- a/.github/workflows/pythonapp-min.yml +++ b/.github/workflows/pythonapp-min.yml @@ -8,7 +8,6 @@ on: - dev - main - releasing/* - - temp-test pull_request: concurrency: From 70726882c73076a9eb35171ecda53ce0f046a41b Mon Sep 17 00:00:00 2001 From: Wenqi Li Date: Wed, 1 Nov 2023 14:32:27 +0000 Subject: [PATCH 6/7] update based on comments Signed-off-by: Wenqi Li --- tests/utils.py | 48 +++++++++++++++++++++--------------------------- 1 file changed, 21 insertions(+), 27 deletions(-) diff --git a/tests/utils.py b/tests/utils.py index 608a9d3358..cf1711292f 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -724,19 +724,16 @@ def test_script_save(net, *inputs, device=None, rtol=1e-4, atol=0.0): """ # TODO: would be nice to use GPU if available, but it currently causes CI failures. device = "cpu" - try: - with tempfile.TemporaryDirectory() as tempdir: - convert_to_torchscript( - model=net, - filename_or_obj=os.path.join(tempdir, "model.ts"), - verify=True, - inputs=inputs, - device=device, - rtol=rtol, - atol=atol, - ) - except (RuntimeError, AttributeError): - raise + with tempfile.TemporaryDirectory() as tempdir: + convert_to_torchscript( + model=net, + filename_or_obj=os.path.join(tempdir, "model.ts"), + verify=True, + inputs=inputs, + device=device, + rtol=rtol, + atol=atol, + ) def test_onnx_save(net, *inputs, device=None, rtol=1e-4, atol=0.0): @@ -750,20 +747,17 @@ def test_onnx_save(net, *inputs, device=None, rtol=1e-4, atol=0.0): # TODO: would be nice to use GPU if available, but it currently causes CI failures. device = "cpu" _, has_onnxruntime = optional_import("onnxruntime") - try: - with tempfile.TemporaryDirectory() as tempdir: - convert_to_onnx( - model=net, - filename=os.path.join(tempdir, "model.onnx"), - verify=True, - inputs=inputs, - device=device, - use_ort=has_onnxruntime, - rtol=rtol, - atol=atol, - ) - except (RuntimeError, AttributeError): - raise + with tempfile.TemporaryDirectory() as tempdir: + convert_to_onnx( + model=net, + filename=os.path.join(tempdir, "model.onnx"), + verify=True, + inputs=inputs, + device=device, + use_ort=has_onnxruntime, + rtol=rtol, + atol=atol, + ) def download_url_or_skip_test(*args, **kwargs): From 2039e28be8875c744b25590125a31be15d6b3c03 Mon Sep 17 00:00:00 2001 From: Wenqi Li Date: Wed, 1 Nov 2023 14:33:07 +0000 Subject: [PATCH 7/7] update Signed-off-by: Wenqi Li --- .github/workflows/pythonapp-min.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pythonapp-min.yml b/.github/workflows/pythonapp-min.yml index 90aa50f782..558c270e33 100644 --- a/.github/workflows/pythonapp-min.yml +++ b/.github/workflows/pythonapp-min.yml @@ -71,7 +71,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ['3.8', '3.9', '3.10', '3.11'] timeout-minutes: 40 steps: - uses: actions/checkout@v4