From ab8f69f245f521f7353e49e5edfbe33e9ae037a7 Mon Sep 17 00:00:00 2001 From: Masahiro Hiramori Date: Sat, 21 Sep 2024 00:29:27 +0900 Subject: [PATCH 1/5] update image tag to 20240917-153130-9f281758 --- ci/jenkins/docker-images.ini | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/ci/jenkins/docker-images.ini b/ci/jenkins/docker-images.ini index 6e55160521b3..175917f887b7 100644 --- a/ci/jenkins/docker-images.ini +++ b/ci/jenkins/docker-images.ini @@ -17,13 +17,13 @@ # This data file is read during when Jenkins runs job to determine docker images. [jenkins] -ci_arm: tlcpack/ci-arm:20240428-060115-0b09ed018 -ci_cortexm: tlcpack/ci-cortexm:20240428-060115-0b09ed018 -ci_cpu: tlcpack/ci_cpu:20240428-060115-0b09ed018 -ci_gpu: tlcpack/ci-gpu:20240428-060115-0b09ed018 -ci_hexagon: tlcpack/ci-hexagon:20240428-060115-0b09ed018 -ci_i386: tlcpack/ci-i386:20240428-060115-0b09ed018 -ci_lint: tlcpack/ci-lint:20240428-060115-0b09ed018 -ci_minimal: tlcpack/ci-minimal:20240428-060115-0b09ed018 -ci_riscv: tlcpack/ci-riscv:20240428-060115-0b09ed018 -ci_wasm: tlcpack/ci-wasm:20240428-060115-0b09ed018 +ci_arm: tlcpack/ci-arm:20240917-153130-9f281758 +ci_cortexm: tlcpack/ci-cortexm:20240917-153130-9f281758 +ci_cpu: tlcpack/ci_cpu:20240917-153130-9f281758 +ci_gpu: tlcpack/ci-gpu:20240917-153130-9f281758 +ci_hexagon: tlcpack/ci-hexagon:20240917-153130-9f281758 +ci_i386: tlcpack/ci-i386:20240917-153130-9f281758 +ci_lint: tlcpack/ci-lint:20240917-153130-9f281758 +ci_minimal: tlcpack/ci-minimal:20240917-153130-9f281758 +ci_riscv: tlcpack/ci-riscv:20240917-153130-9f281758 +ci_wasm: tlcpack/ci-wasm:20240917-153130-9f281758 From e1e0ca721d2a7196da95b96e3c2ed19a6ff84284 Mon Sep 17 00:00:00 2001 From: Masahiro Hiramori Date: Sat, 21 Sep 2024 12:46:22 +0900 Subject: [PATCH 2/5] increase atol --- tests/python/relax/test_frontend_onnx.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/python/relax/test_frontend_onnx.py b/tests/python/relax/test_frontend_onnx.py index 8f4e9881f497..0e7cfbd7c093 100644 --- a/tests/python/relax/test_frontend_onnx.py +++ b/tests/python/relax/test_frontend_onnx.py @@ -76,6 +76,7 @@ def check_correctness( inputs: Optional[Dict[str, np.ndarray]] = None, ir_version: int = 8, opset: int = 14, + rtol: float = 1e-7, atol: float = 1e-5, ) -> None: """Run an onnx model in both onnxruntime and TVM through our importer @@ -154,7 +155,7 @@ def check_correctness( # TODO Allow configurable tolerance. # Sometimes None is used to indicate an unused output. if ort_out is not None: - tvm.testing.assert_allclose(tvm_out.numpy(), ort_out, atol=atol) + tvm.testing.assert_allclose(tvm_out.numpy(), ort_out, rtol=rtol, atol=atol) @pytest.mark.parametrize( @@ -1010,7 +1011,7 @@ def verify_reduce_func(func, data, axis, keepdims): inputs_dict = {"x": data} # Reduction ops accumulate arithmetic errors, so we use a higher tolerance. - check_correctness(model, inputs_dict, opset=11, atol=1e-4) + check_correctness(model, inputs_dict, opset=11, rtol=1e-4, atol=1e-4) for keepdims in [True, False]: verify_reduce_func( From 40f8b54f4180822c206aff6db9cd2c730cc41162 Mon Sep 17 00:00:00 2001 From: Masahiro Hiramori Date: Sun, 22 Sep 2024 16:09:34 +0900 Subject: [PATCH 3/5] define custom equal operator to avoid comparison error --- .../test_tir_transform_simplify.py | 38 +++++++++++++++---- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/tests/python/tir-transform/test_tir_transform_simplify.py b/tests/python/tir-transform/test_tir_transform_simplify.py index f7887bc61137..0b2d5f16d833 100644 --- a/tests/python/tir-transform/test_tir_transform_simplify.py +++ b/tests/python/tir-transform/test_tir_transform_simplify.py @@ -1021,18 +1021,40 @@ class TestMostRestrictiveConditional(BaseBeforeAfter): then `a >= b` cannot be proven, but can be reduced to `a == b`. """ + class TupleWrapper(tuple): + """ + A custom wrapper for `tuple` to handle element-wise equality comparison + to avoid comparison errors when dealing with objects like `ExprOp`. + See also: https://github.com/apache/tvm/pull/17397 + """ + + def __new__(self, *args): + return super().__new__(self, args) + + def __eq__(self, other): + from tvm.tir.expr import ExprOp + + for a, b in zip(self, other): + if isinstance(a, ExprOp) and isinstance(a, ExprOp): + if not tvm.ir.structural_equal(a, b): + return False + else: + if not a.__eq__(b): + return False + return True + i, j, k = [tvm.tir.Var(name, "int32") for name in "ijk"] tir_int = tvm.tir.IntImm("int32", 0) test_case = tvm.testing.parameter( - (i <= tir_int, tir_int <= i, i == tir_int), - (i <= tir_int, i != tir_int, i < tir_int), - (i != tir_int, i <= tir_int, i < tir_int), - (i != tir_int, tir_int <= i, tir_int < i), - (i <= j, j <= i, j == i), - (i <= j, i != j, i < j), - (i != j, i <= j, i < j), - (i != j, j <= i, j < i), + TupleWrapper(i <= tir_int, tir_int <= i, i == tir_int), + TupleWrapper(i <= tir_int, i != tir_int, i < tir_int), + TupleWrapper(i != tir_int, i <= tir_int, i < tir_int), + TupleWrapper(i != tir_int, tir_int <= i, tir_int < i), + TupleWrapper(i <= j, j <= i, j == i), + TupleWrapper(i <= j, i != j, i < j), + TupleWrapper(i != j, i <= j, i < j), + TupleWrapper(i != j, j <= i, j < i), ) @tvm.testing.fixture From 06062618abf423899ecb1d302a42cb83c5cfb887 Mon Sep 17 00:00:00 2001 From: Masahiro Hiramori Date: Sun, 22 Sep 2024 22:43:53 +0900 Subject: [PATCH 4/5] try to remove android stuff --- tests/scripts/task_build_hexagon_api.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/scripts/task_build_hexagon_api.sh b/tests/scripts/task_build_hexagon_api.sh index 5f811e4e2749..cff6d7a6ba59 100755 --- a/tests/scripts/task_build_hexagon_api.sh +++ b/tests/scripts/task_build_hexagon_api.sh @@ -41,10 +41,7 @@ fi mkdir -p build cd build -cmake -DANDROID_ABI=arm64-v8a \ - -DANDROID_PLATFORM=android-28 \ - -DUSE_ANDROID_TOOLCHAIN="${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake" \ - -DUSE_HEXAGON_ARCH=v68 \ +cmake -DUSE_HEXAGON_ARCH=v68 \ -DUSE_HEXAGON_SDK="${HEXAGON_SDK_ROOT}" \ -DUSE_HEXAGON_TOOLCHAIN="${HEXAGON_TOOLCHAIN}" \ -DUSE_OUTPUT_BINARY_DIR="${output_directory}" \ From dfab291ac4afcd4b2d8eba1a1136bbdb2a8f6136 Mon Sep 17 00:00:00 2001 From: Masahiro Hiramori Date: Mon, 23 Sep 2024 14:07:57 +0900 Subject: [PATCH 5/5] skip test_imagenet --- tests/python/frontend/pytorch/test_fx_quant.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/python/frontend/pytorch/test_fx_quant.py b/tests/python/frontend/pytorch/test_fx_quant.py index 7f3083a7dcd0..8ed6e1a74797 100644 --- a/tests/python/frontend/pytorch/test_fx_quant.py +++ b/tests/python/frontend/pytorch/test_fx_quant.py @@ -87,6 +87,9 @@ def forward(self, inp): quantize_and_build(model, 300) +@pytest.mark.skip( + reason="Model binary isn't uploaded to S3. See https://github.com/apache/tvm/pull/17397" +) def test_imagenet(): for model_func in [resnet50, efficientnet_b4]: quantize_and_build(model_func(pretrained=True).eval(), 224)