You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by le...@apache.org on 2022/08/22 17:48:48 UTC

[tvm] branch ci-docker-staging updated (2006d44798 -> 5f179ce001)

This is an automated email from the ASF dual-hosted git repository.

leandron pushed a change to branch ci-docker-staging
in repository https://gitbox.apache.org/repos/asf/tvm.git


 discard 2006d44798 [ACL] Adjust mobilenet test for Keras 2.9
 discard f66b0e6984 Apply transformers fix.
 discard 4b66fb99f6 Apply ONNX fix
 discard 341d8dbac7 [CI] Update Docker image tags to 20220822-105603-52f5c155f
 discard c8ea79be02 Add #12130 PR for testing.
 discard 8cb946ed6f Update TensorFlow to release 2.9
     add 7c318d7196 [ETHOSN] Remove support for older versions of the driver stack (#12347)
     add 8146a9bf2c [TIR] Support AllocateConst nodes in TensorIR scheduling flow (#12489)
     add 48a8cbd57d [ONNX] Fix test to disable default ONNX frontend constant folding (#12532)
     add 389675668a [CI] Set test dependency on "transformers" package with pytest.importorskip (#12528)
     add 40fd43e24b [MicroTVM] expose project options in autotuning (#12479)
     add 3f56851264 [TIR][Schedule] Support for specific consumer block targeting in cache_read (#12505)
     add c1bd0227be [FIX] Fix bug in resize2d unittest func name (#12498)
     add 4d7e7a8b57 [ci] xfail failing ethosu codegen tests (#12508)
     new 5ea15c2339 Update TensorFlow to release 2.9
     new 16de572c13 Add #12130 PR for testing.
     new 02cb556f74 [CI] Update Docker image tags to 20220822-105603-52f5c155f
     new 5f179ce001 [ACL] Adjust mobilenet test for Keras 2.9

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (2006d44798)
            \
             N -- N -- N   refs/heads/ci-docker-staging (5f179ce001)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 include/tvm/meta_schedule/apply_history_best.h     |  4 +-
 include/tvm/meta_schedule/extracted_task.h         | 10 ++-
 include/tvm/tir/schedule/schedule.h                |  4 +-
 python/tvm/meta_schedule/apply_history_best.py     |  2 +-
 python/tvm/meta_schedule/relay_integration.py      |  2 +-
 python/tvm/meta_schedule/testing/utils.py          | 13 ++--
 python/tvm/micro/testing/evaluation.py             | 19 ++++--
 python/tvm/relay/op/contrib/ethosn.py              | 23 ++++++-
 python/tvm/testing/utils.py                        | 24 +++++++
 python/tvm/tir/schedule/schedule.py                | 17 ++++-
 src/meta_schedule/extracted_task.cc                | 27 +++++---
 src/printer/tvmscript_printer.cc                   | 19 ++++++
 src/relay/backend/contrib/ethosn/codegen.cc        |  5 +-
 src/relay/backend/contrib/ethosn/codegen_ethosn.h  |  1 -
 src/relay/backend/contrib/ethosn/ethosn_api.cc     |  1 -
 .../backend/contrib/ethosn/ethosn_api_version.h    | 58 ----------------
 src/relay/backend/task_extraction.cc               | 10 +--
 src/relay/backend/te_compiler_cache.cc             | 26 +++++--
 src/relay/backend/te_compiler_cache.h              |  7 +-
 src/runtime/contrib/ethosn/ethosn_device.cc        | 32 ---------
 src/runtime/contrib/ethosn/ethosn_device.h         |  7 --
 src/runtime/contrib/ethosn/ethosn_runtime.cc       | 12 ----
 src/runtime/contrib/ethosn/ethosn_runtime.h        |  3 -
 src/te/operation/create_primfunc.cc                | 12 ++++
 src/te/operation/create_primfunc.h                 |  8 +++
 src/tir/analysis/estimate_flops.cc                 |  1 +
 src/tir/schedule/concrete_schedule.cc              | 11 ++-
 src/tir/schedule/concrete_schedule.h               |  4 +-
 src/tir/schedule/primitive.h                       |  3 +-
 src/tir/schedule/primitive/cache_read_write.cc     | 61 ++++++++++++-----
 src/tir/schedule/trace.cc                          |  3 +
 src/tir/schedule/traced_schedule.cc                |  8 ++-
 src/tir/schedule/traced_schedule.h                 |  4 +-
 src/tir/schedule/transform.cc                      | 19 +++++-
 src/tir/transforms/bind_params.cc                  | 79 +++++++++++++---------
 src/tir/transforms/inject_software_pipeline.cc     |  5 +-
 src/tir/transforms/ir_utils.h                      | 10 +++
 .../plan_update_buffer_allocation_location.cc      | 36 +++++++---
 tests/python/contrib/test_ethosn/infrastructure.py | 32 ---------
 tests/python/contrib/test_ethosn/test_conv2d.py    |  2 +-
 .../contrib/test_ethosn/test_fullyconnected.py     |  2 +-
 tests/python/contrib/test_ethosn/test_networks.py  | 50 ++------------
 tests/python/contrib/test_ethosn/test_split.py     | 14 ++--
 .../python/contrib/test_ethosn/test_topologies.py  | 19 +++---
 tests/python/contrib/test_ethosu/test_codegen.py   | 20 +++++-
 tests/python/relay/dyn/test_dynamic_op_level5.py   |  4 +-
 tests/python/unittest/test_link_params.py          | 64 +++++++++++++++++-
 .../unittest/test_tir_schedule_cache_read_write.py | 42 ++++++++++++
 48 files changed, 495 insertions(+), 344 deletions(-)
 delete mode 100644 src/relay/backend/contrib/ethosn/ethosn_api_version.h


[tvm] 04/04: [ACL] Adjust mobilenet test for Keras 2.9

Posted by le...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

leandron pushed a commit to branch ci-docker-staging
in repository https://gitbox.apache.org/repos/asf/tvm.git

commit 5f179ce0010a9b6bf686340b6e3de3951d89f914
Author: Leandro Nunes <le...@arm.com>
AuthorDate: Mon Aug 22 16:37:43 2022 +0100

    [ACL] Adjust mobilenet test for Keras 2.9
    
    In Keras 2.7, one "reshape" operator was removed from
    the Mobilenet model, making our test which verifies the
    number of operators to be incorrect.
    
    This patch adjusts the operator count so that it is in line
    with the changes in Keras. For reference, the change in
    keras repo was done in hash b6abfaed132 "Remove unnecessary
    reshape layer in MobileNet architecture".
    
    Change-Id: I08b2078b54b60e710ab281b7ecb7e3e2cf1865d9
---
 .../contrib/test_arm_compute_lib/test_network.py   | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/tests/python/contrib/test_arm_compute_lib/test_network.py b/tests/python/contrib/test_arm_compute_lib/test_network.py
index 8fcafe489c..b5b9ed6b6e 100644
--- a/tests/python/contrib/test_arm_compute_lib/test_network.py
+++ b/tests/python/contrib/test_arm_compute_lib/test_network.py
@@ -16,6 +16,8 @@
 # under the License.
 """Arm Compute Library network tests."""
 
+from distutils.version import LooseVersion
+
 import numpy as np
 import pytest
 from tvm import testing
@@ -111,6 +113,7 @@ def test_vgg16():
 
 
 def test_mobilenet():
+    keras = pytest.importorskip("keras")
     Device.load("test_config.json")
 
     if skip_runtime_test():
@@ -131,8 +134,25 @@ def test_mobilenet():
         mod, params = _get_keras_model(mobilenet, inputs)
         return mod, params, inputs
 
+    if keras.__version__ < LooseVersion("2.9"):
+        # This can be removed after we migrate to TF/Keras >= 2.9
+        expected_tvm_ops = 56
+        expected_acl_partitions = 31
+    else:
+        # In Keras >= 2.7, one reshape operator was removed
+        # from the MobileNet model, so it impacted this test
+        # which now needs to be reduce in by 1
+        # The change in Keras is `b6abfaed1326e3c`
+        expected_tvm_ops = 55
+        expected_acl_partitions = 30
+
     _build_and_run_network(
-        *get_model(), device=device, tvm_ops=56, acl_partitions=31, atol=0.002, rtol=0.01
+        *get_model(),
+        device=device,
+        tvm_ops=expected_tvm_ops,
+        acl_partitions=expected_acl_partitions,
+        atol=0.002,
+        rtol=0.01,
     )
 
 


[tvm] 01/04: Update TensorFlow to release 2.9

Posted by le...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

leandron pushed a commit to branch ci-docker-staging
in repository https://gitbox.apache.org/repos/asf/tvm.git

commit 5ea15c2339ce4934cba410b6b140442f8777a646
Author: Leandro Nunes <le...@arm.com>
AuthorDate: Mon May 23 11:55:08 2022 +0100

    Update TensorFlow to release 2.9
    
    Change-Id: I082bda0b84785abe75df2d6966793df022f14755
---
 cmake/modules/contrib/TFLite.cmake                 |  2 ++
 docker/Dockerfile.ci_cortexm                       |  3 +++
 docker/Dockerfile.ci_cpu                           |  7 +++++++
 docker/Dockerfile.ci_gpu                           |  3 +++
 docker/Dockerfile.ci_riscv                         |  3 +++
 docker/install/ubuntu_install_cmake_source.sh      |  4 ++--
 docker/install/ubuntu_install_python_package.sh    |  2 +-
 docker/install/ubuntu_install_tensorflow.sh        |  5 ++---
 .../install/ubuntu_install_tensorflow_aarch64.sh   | 23 ++--------------------
 docker/install/ubuntu_install_tflite.sh            | 13 ++++++++++--
 docker/install/ubuntu_install_vela.sh              |  2 +-
 tests/scripts/task_config_build_cpu.sh             |  2 +-
 12 files changed, 38 insertions(+), 31 deletions(-)

diff --git a/cmake/modules/contrib/TFLite.cmake b/cmake/modules/contrib/TFLite.cmake
index 3159710909..b8d6a0daff 100644
--- a/cmake/modules/contrib/TFLite.cmake
+++ b/cmake/modules/contrib/TFLite.cmake
@@ -38,8 +38,10 @@ if(NOT USE_TFLITE STREQUAL "OFF")
     set(USE_TFLITE ${USE_TENSORFLOW_PATH}/tensorflow/lite/tools/make/gen/*/lib)
   endif()
   find_library(TFLITE_CONTRIB_LIB libtensorflow-lite.a ${USE_TFLITE})
+  file(GLOB_RECURSE TFLITE_DEPS "${USE_TFLITE}/*.a")
 
   list(APPEND TVM_RUNTIME_LINKER_LIBS ${TFLITE_CONTRIB_LIB})
+  list(APPEND TVM_RUNTIME_LINKER_LIBS ${TFLITE_DEPS})
 
   if (NOT USE_FLATBUFFERS_PATH STREQUAL "none")
     include_directories(${USE_FLATBUFFERS_PATH}/include)
diff --git a/docker/Dockerfile.ci_cortexm b/docker/Dockerfile.ci_cortexm
index 63089f3d65..fb3c10d393 100644
--- a/docker/Dockerfile.ci_cortexm
+++ b/docker/Dockerfile.ci_cortexm
@@ -32,6 +32,9 @@ RUN bash /install/ubuntu_install_googletest.sh
 COPY install/ubuntu1804_install_python.sh /install/ubuntu1804_install_python.sh
 RUN bash /install/ubuntu1804_install_python.sh
 
+COPY install/ubuntu_install_cmake_source.sh /install/ubuntu_install_cmake_source.sh
+RUN bash /install/ubuntu_install_cmake_source.sh
+
 COPY install/ubuntu1804_install_python_venv.sh /install/ubuntu1804_install_python_venv.sh
 RUN bash /install/ubuntu1804_install_python_venv.sh
 ENV PATH=/opt/tvm-venv/bin:/opt/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/bin:$PATH
diff --git a/docker/Dockerfile.ci_cpu b/docker/Dockerfile.ci_cpu
index 013ebfb59e..02508948ac 100644
--- a/docker/Dockerfile.ci_cpu
+++ b/docker/Dockerfile.ci_cpu
@@ -40,6 +40,9 @@ RUN bash /install/ubuntu_install_python_package.sh
 COPY install/ubuntu1804_install_llvm.sh /install/ubuntu1804_install_llvm.sh
 RUN bash /install/ubuntu1804_install_llvm.sh
 
+COPY install/ubuntu_install_cmake_source.sh /install/ubuntu_install_cmake_source.sh
+RUN bash /install/ubuntu_install_cmake_source.sh
+
 COPY install/ubuntu_install_dnnl.sh /install/ubuntu_install_dnnl.sh
 RUN bash /install/ubuntu_install_dnnl.sh
 
@@ -143,3 +146,7 @@ ENV PATH /opt/sccache:$PATH
 # Libxsmm deps
 COPY install/ubuntu_install_libxsmm.sh /install
 RUN bash /install/ubuntu_install_libxsmm.sh
+
+# Hacky workaround (do not push to GitHub) to install the right Numpy version
+# just a new comment
+RUN pip install numpy --upgrade
diff --git a/docker/Dockerfile.ci_gpu b/docker/Dockerfile.ci_gpu
index f04d8515b8..6f02ab97c0 100644
--- a/docker/Dockerfile.ci_gpu
+++ b/docker/Dockerfile.ci_gpu
@@ -32,6 +32,9 @@ RUN apt-get update --fix-missing
 COPY install/ubuntu_install_core.sh /install/ubuntu_install_core.sh
 RUN bash /install/ubuntu_install_core.sh
 
+COPY install/ubuntu_install_cmake_source.sh /install/ubuntu_install_cmake_source.sh
+RUN bash /install/ubuntu_install_cmake_source.sh
+
 COPY install/ubuntu_install_googletest.sh /install/ubuntu_install_googletest.sh
 RUN bash /install/ubuntu_install_googletest.sh
 
diff --git a/docker/Dockerfile.ci_riscv b/docker/Dockerfile.ci_riscv
index b65b87a863..1ca792e20c 100644
--- a/docker/Dockerfile.ci_riscv
+++ b/docker/Dockerfile.ci_riscv
@@ -32,6 +32,9 @@ RUN bash /install/ubuntu_install_googletest.sh
 COPY install/ubuntu1804_install_python.sh /install/ubuntu1804_install_python.sh
 RUN bash /install/ubuntu1804_install_python.sh
 
+COPY install/ubuntu_install_cmake_source.sh /install/ubuntu_install_cmake_source.sh
+RUN bash /install/ubuntu_install_cmake_source.sh
+
 COPY install/ubuntu1804_install_python_venv.sh /install/ubuntu1804_install_python_venv.sh
 RUN bash /install/ubuntu1804_install_python_venv.sh
 ENV PATH=/opt/tvm-venv/bin:/opt/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/bin:$PATH
diff --git a/docker/install/ubuntu_install_cmake_source.sh b/docker/install/ubuntu_install_cmake_source.sh
index 18335c98c4..e90ca3d8f1 100755
--- a/docker/install/ubuntu_install_cmake_source.sh
+++ b/docker/install/ubuntu_install_cmake_source.sh
@@ -20,8 +20,8 @@ set -e
 set -u
 set -o pipefail
 
-v=3.14
-version=3.14.7
+v=3.22
+version=3.22.4
 wget https://cmake.org/files/v${v}/cmake-${version}.tar.gz
 tar xvf cmake-${version}.tar.gz
 cd cmake-${version}
diff --git a/docker/install/ubuntu_install_python_package.sh b/docker/install/ubuntu_install_python_package.sh
index 3fc310c47e..9fee9d0142 100755
--- a/docker/install/ubuntu_install_python_package.sh
+++ b/docker/install/ubuntu_install_python_package.sh
@@ -28,7 +28,7 @@ pip3 install --upgrade \
     cython \
     decorator \
     mypy \
-    numpy~=1.19.5 \
+    numpy==1.21.* \
     orderedset \
     packaging \
     Pillow==9.1.0 \
diff --git a/docker/install/ubuntu_install_tensorflow.sh b/docker/install/ubuntu_install_tensorflow.sh
index 17d2b31d9b..2225b7aef3 100755
--- a/docker/install/ubuntu_install_tensorflow.sh
+++ b/docker/install/ubuntu_install_tensorflow.sh
@@ -21,6 +21,5 @@ set -u
 set -o pipefail
 
 pip3 install \
-    "h5py==3.1.0" \
-    keras==2.6 \
-    tensorflow==2.6.5
+    keras==2.9 \
+    tensorflow==2.9.1
diff --git a/docker/install/ubuntu_install_tensorflow_aarch64.sh b/docker/install/ubuntu_install_tensorflow_aarch64.sh
index 59cc5b4814..09efe5db57 100755
--- a/docker/install/ubuntu_install_tensorflow_aarch64.sh
+++ b/docker/install/ubuntu_install_tensorflow_aarch64.sh
@@ -21,27 +21,8 @@ set -euxo pipefail
 # Build dependencies
 apt-install-and-clear -y --no-install-recommends libhdf5-dev
 
-# Downloading Tensorflow and installing it manually is needed
-# just as a temporary workaround while we move to a newer
-# version (>2.7) that is hosted in the official PyPI repository.
-linaro_repo="https://snapshots.linaro.org/ldcg/python/tensorflow-manylinux/43/tensorflow-aarch64"
-tensorflow_package="tensorflow_aarch64-2.6.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl"
-tmpdir=$(mktemp -d)
-
-cleanup()
-{
-  rm -rf "$tmpdir"
-}
-
-trap cleanup 0
-
-cd "${tmpdir}"
-wget -q "${linaro_repo}/${tensorflow_package}"
-
 # We're only using the TensorFlow wheel snapshot here as the
 # h5py wheel tries to use the wrong .so file
 pip3 install \
-    ${tensorflow_package} \
-    "h5py==3.1.0" \
-    keras==2.6 \
-    "protobuf<4"
+    keras==2.9 \
+    tensorflow-aarch64==2.9.1
diff --git a/docker/install/ubuntu_install_tflite.sh b/docker/install/ubuntu_install_tflite.sh
index 8a394302fd..4b73c202bc 100755
--- a/docker/install/ubuntu_install_tflite.sh
+++ b/docker/install/ubuntu_install_tflite.sh
@@ -18,6 +18,7 @@
 
 set -e
 set -u
+set -x
 set -o pipefail
 
 # The tflite version should have matched versions to the tensorflow
@@ -38,8 +39,16 @@ pip3 install flatbuffers
 # The library is built at:
 # tensorflow/tensorflow/lite/tools/make/gen/*/lib/libtensorflow-lite.a.
 git clone https://github.com/tensorflow/tensorflow --branch=v${TENSORFLOW_VERSION} --depth 1
-./tensorflow/tensorflow/lite/tools/make/download_dependencies.sh
-./tensorflow/tensorflow/lite/tools/make/build_lib.sh
+
+mkdir -p /opt/tflite
+cd /opt/tflite
+cmake \
+  -DTFLITE_ENABLE_XNNPACK=OFF \
+  /tensorflow/tensorflow/lite
+
+cmake --build .
+cd -
+
 
 # Setup tflite from schema
 mkdir tflite
diff --git a/docker/install/ubuntu_install_vela.sh b/docker/install/ubuntu_install_vela.sh
index c72d118233..9e32889cd4 100755
--- a/docker/install/ubuntu_install_vela.sh
+++ b/docker/install/ubuntu_install_vela.sh
@@ -20,4 +20,4 @@ set -e
 set -u
 set -o pipefail
 
-pip3 install ethos-u-vela==3.2.0
+pip3 install ethos-u-vela==3.4.0
diff --git a/tests/scripts/task_config_build_cpu.sh b/tests/scripts/task_config_build_cpu.sh
index 9dc5c62efa..bc95e866e3 100755
--- a/tests/scripts/task_config_build_cpu.sh
+++ b/tests/scripts/task_config_build_cpu.sh
@@ -37,7 +37,7 @@ echo set\(CMAKE_CXX_FLAGS -Werror\) >> config.cmake
 echo set\(HIDE_PRIVATE_SYMBOLS ON\) >> config.cmake
 echo set\(USE_VTA_TSIM ON\) >> config.cmake
 echo set\(USE_VTA_FSIM ON\) >> config.cmake
-echo set\(USE_TFLITE ON\) >> config.cmake
+echo set\(USE_TFLITE \"/opt/tflite\"\) >> config.cmake
 echo set\(USE_TENSORFLOW_PATH \"/tensorflow\"\) >> config.cmake
 echo set\(USE_FLATBUFFERS_PATH \"/flatbuffers\"\) >> config.cmake
 echo set\(USE_ETHOSN /opt/arm/ethosn-driver\) >> config.cmake


[tvm] 03/04: [CI] Update Docker image tags to 20220822-105603-52f5c155f

Posted by le...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

leandron pushed a commit to branch ci-docker-staging
in repository https://gitbox.apache.org/repos/asf/tvm.git

commit 02cb556f74a00afebfbd8860ec77180a96ebc739
Author: Leandro Nunes <le...@arm.com>
AuthorDate: Wed Aug 17 13:54:39 2022 +0100

    [CI] Update Docker image tags to 20220822-105603-52f5c155f
    
    This change updates TensorFlow/TFLite to 2.9 and adds
    Python dependencies such as ONNX and PyTorch to the
    ci_arm environment.
    
    As a requirement to build TFLite, it also updates CMake
    to 3.22.
    
    Change-Id: I84bdf2cc30012151047cb61a701033b580474782
---
 Jenkinsfile               | 22 +++++++++++-----------
 ci/jenkins/Jenkinsfile.j2 | 20 ++++++++++----------
 2 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 15cd4927d0..41d8ab741f 100755
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -45,20 +45,20 @@
 // 'python3 jenkins/generate.py'
 // Note: This timestamp is here to ensure that updates to the Jenkinsfile are
 // always rebased on main before merging:
-// Generated at 2022-08-15T16:55:31.189354
+// Generated at 2022-08-22T13:13:50.117243
 
 import org.jenkinsci.plugins.pipeline.modeldefinition.Utils
 // NOTE: these lines are scanned by docker/dev_common.sh. Please update the regex as needed. -->
-ci_lint = 'tlcpack/ci-lint:20220810-060142-fae79bbc3'
-ci_gpu = 'tlcpack/ci-gpu:20220810-060142-fae79bbc3'
-ci_cpu = 'tlcpack/ci-cpu:20220810-060142-fae79bbc3'
-ci_minimal = 'tlcpack/ci-minimal:20220725-133226-d3cefdaf1'
-ci_wasm = 'tlcpack/ci-wasm:20220810-060142-fae79bbc3'
-ci_i386 = 'tlcpack/ci-i386:20220810-060142-fae79bbc3'
-ci_cortexm = 'tlcpack/ci-cortexm:20220810-060142-fae79bbc3'
-ci_arm = 'tlcpack/ci-arm:20220810-060142-fae79bbc3'
-ci_hexagon = 'tlcpack/ci-hexagon:20220810-060142-fae79bbc3'
-ci_riscv = 'tlcpack/ci-riscv:20220810-060142-fae79bbc3'
+ci_lint = 'tlcpackstaging/ci_lint:20220822-105603-52f5c155f'
+ci_gpu = 'tlcpackstaging/ci_gpu:20220822-105603-52f5c155f'
+ci_cpu = 'tlcpackstaging/ci_cpu:20220822-105603-52f5c155f'
+ci_minimal = 'tlcpackstaging/ci_minimal:20220822-105603-52f5c155f'
+ci_wasm = 'tlcpackstaging/ci_wasm:20220822-105603-52f5c155f'
+ci_i386 = 'tlcpackstaging/ci_i386:20220822-105603-52f5c155f'
+ci_cortexm = 'tlcpackstaging/ci_cortexm:20220822-105603-52f5c155f'
+ci_arm = 'tlcpackstaging/ci_arm:20220822-105603-52f5c155f'
+ci_hexagon = 'tlcpackstaging/ci_hexagon:20220822-105603-52f5c155f'
+ci_riscv = 'tlcpackstaging/ci_riscv:20220822-105603-52f5c155f'
 // <--- End of regex-scanned config.
 
 // Parameters to allow overriding (in Jenkins UI), the images
diff --git a/ci/jenkins/Jenkinsfile.j2 b/ci/jenkins/Jenkinsfile.j2
index 4960d4f0fa..8b59614562 100644
--- a/ci/jenkins/Jenkinsfile.j2
+++ b/ci/jenkins/Jenkinsfile.j2
@@ -51,16 +51,16 @@ import org.jenkinsci.plugins.pipeline.modeldefinition.Utils
 {% import 'ci/jenkins/macros.j2' as m with context -%}
 
 // NOTE: these lines are scanned by docker/dev_common.sh. Please update the regex as needed. -->
-ci_lint = 'tlcpack/ci-lint:20220810-060142-fae79bbc3'
-ci_gpu = 'tlcpack/ci-gpu:20220810-060142-fae79bbc3'
-ci_cpu = 'tlcpack/ci-cpu:20220810-060142-fae79bbc3'
-ci_minimal = 'tlcpack/ci-minimal:20220725-133226-d3cefdaf1'
-ci_wasm = 'tlcpack/ci-wasm:20220810-060142-fae79bbc3'
-ci_i386 = 'tlcpack/ci-i386:20220810-060142-fae79bbc3'
-ci_cortexm = 'tlcpack/ci-cortexm:20220810-060142-fae79bbc3'
-ci_arm = 'tlcpack/ci-arm:20220810-060142-fae79bbc3'
-ci_hexagon = 'tlcpack/ci-hexagon:20220810-060142-fae79bbc3'
-ci_riscv = 'tlcpack/ci-riscv:20220810-060142-fae79bbc3'
+ci_lint = 'tlcpackstaging/ci_lint:20220822-105603-52f5c155f'
+ci_gpu = 'tlcpackstaging/ci_gpu:20220822-105603-52f5c155f'
+ci_cpu = 'tlcpackstaging/ci_cpu:20220822-105603-52f5c155f'
+ci_minimal = 'tlcpackstaging/ci_minimal:20220822-105603-52f5c155f'
+ci_wasm = 'tlcpackstaging/ci_wasm:20220822-105603-52f5c155f'
+ci_i386 = 'tlcpackstaging/ci_i386:20220822-105603-52f5c155f'
+ci_cortexm = 'tlcpackstaging/ci_cortexm:20220822-105603-52f5c155f'
+ci_arm = 'tlcpackstaging/ci_arm:20220822-105603-52f5c155f'
+ci_hexagon = 'tlcpackstaging/ci_hexagon:20220822-105603-52f5c155f'
+ci_riscv = 'tlcpackstaging/ci_riscv:20220822-105603-52f5c155f'
 // <--- End of regex-scanned config.
 
 // Parameters to allow overriding (in Jenkins UI), the images


[tvm] 02/04: Add #12130 PR for testing.

Posted by le...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

leandron pushed a commit to branch ci-docker-staging
in repository https://gitbox.apache.org/repos/asf/tvm.git

commit 16de572c1372348018b01a323567c4e64c6eaf17
Author: Leandro Nunes <le...@arm.com>
AuthorDate: Wed Aug 3 11:43:10 2022 +0100

    Add #12130 PR for testing.
    
    Change-Id: I4995377d4bb7df61cb8b92f50af01e9df623f0c4
---
 python/tvm/relay/frontend/keras.py           |  8 ++++---
 tests/python/frontend/tflite/test_forward.py | 33 +++++++++++++++++++++-------
 2 files changed, 30 insertions(+), 11 deletions(-)

diff --git a/python/tvm/relay/frontend/keras.py b/python/tvm/relay/frontend/keras.py
index 3f7a96544a..8c8a4a1ddc 100644
--- a/python/tvm/relay/frontend/keras.py
+++ b/python/tvm/relay/frontend/keras.py
@@ -635,9 +635,11 @@ def _convert_pooling(
             _op.nn.global_max_pool2d(inexpr, **global_pool_params), keras_layer, etab, data_layout
         )
     if pool_type == "GlobalAveragePooling2D":
-        return _convert_flatten(
-            _op.nn.global_avg_pool2d(inexpr, **global_pool_params), keras_layer, etab, data_layout
-        )
+        global_avg_pool2d = _op.nn.global_avg_pool2d(inexpr, **global_pool_params)
+        keep_dims = len(keras_layer.input.shape) == len(keras_layer.output.shape)
+        if keep_dims:
+            return global_avg_pool2d
+        return _convert_flatten(global_avg_pool2d, keras_layer, etab, data_layout)
     pool_h, pool_w = keras_layer.pool_size
     stride_h, stride_w = keras_layer.strides
     params = {
diff --git a/tests/python/frontend/tflite/test_forward.py b/tests/python/frontend/tflite/test_forward.py
index 9121721d8e..7267b72548 100644
--- a/tests/python/frontend/tflite/test_forward.py
+++ b/tests/python/frontend/tflite/test_forward.py
@@ -963,6 +963,10 @@ def _test_tflite2_quantized_convolution(
     input_node = subgraph.Tensors(model_input).Name().decode("utf-8")
 
     tflite_output = run_tflite_graph(tflite_model_quant, data)
+    if tf.__version__ < LooseVersion("2.9"):
+        input_node = data_in.name.replace(":0", "")
+    else:
+        input_node = "serving_default_" + data_in.name + ":0"
     tvm_output = run_tvm_graph(tflite_model_quant, data, input_node)
     tvm.testing.assert_allclose(
         np.squeeze(tvm_output[0]), np.squeeze(tflite_output[0]), rtol=1e-2, atol=1e-2
@@ -1997,10 +2001,12 @@ def _test_abs(data, quantized, int_quant_dtype=tf.int8):
         # TFLite 2.6.x upgrade support
         if tf.__version__ < LooseVersion("2.6.1"):
             in_node = ["serving_default_input_int8"]
-        else:
+        elif tf.__version__ < LooseVersion("2.9"):
             in_node = (
                 ["serving_default_input_int16"] if int_quant_dtype == tf.int16 else ["tfl.quantize"]
             )
+        else:
+            in_node = "serving_default_input"
 
         tvm_output = run_tvm_graph(tflite_model_quant, data, in_node)
         tvm.testing.assert_allclose(
@@ -2028,8 +2034,10 @@ def _test_rsqrt(data, quantized, int_quant_dtype=tf.int8):
             tf.math.rsqrt, data, int_quant_dtype=int_quant_dtype
         )
         tflite_output = run_tflite_graph(tflite_model_quant, data)
-        in_node = ["tfl.quantize"]
-
+        if tf.__version__ < LooseVersion("2.9"):
+            in_node = ["tfl.quantize"]
+        else:
+            in_node = "serving_default_input"
         tvm_output = run_tvm_graph(tflite_model_quant, data, in_node)
         tvm.testing.assert_allclose(
             np.squeeze(tvm_output[0]), np.squeeze(tflite_output[0]), rtol=1e-5, atol=1e-2
@@ -2110,7 +2118,10 @@ def _test_cos(data, quantized, int_quant_dtype=tf.int8):
             tf.math.cos, data, int_quant_dtype=int_quant_dtype
         )
         tflite_output = run_tflite_graph(tflite_model_quant, data)
-        in_node = ["tfl.quantize"]
+        if tf.__version__ < LooseVersion("2.9"):
+            in_node = ["tfl.quantize"]
+        else:
+            in_node = "serving_default_input"
         tvm_output = run_tvm_graph(tflite_model_quant, data, in_node)
         tvm.testing.assert_allclose(
             np.squeeze(tvm_output[0]), np.squeeze(tflite_output[0]), rtol=1e-5, atol=1e-2
@@ -3024,7 +3035,6 @@ def _test_quantize_dequantize(data):
     add = tf.keras.layers.Add()([data_in, relu])
     concat = tf.keras.layers.Concatenate(axis=0)([relu, add])
     keras_model = tf.keras.models.Model(inputs=data_in, outputs=concat)
-    input_name = data_in.name.split(":")[0]
 
     # To create quantized values with dynamic range of activations, needs representative dataset
     def representative_data_gen():
@@ -3034,7 +3044,11 @@ def _test_quantize_dequantize(data):
     tflite_model_quant = _quantize_keras_model(keras_model, representative_data_gen, True, True)
 
     tflite_output = run_tflite_graph(tflite_model_quant, data)
-    tvm_output = run_tvm_graph(tflite_model_quant, data, input_name)
+    if tf.__version__ < LooseVersion("2.9"):
+        in_node = data_in.name.split(":")[0]
+    else:
+        in_node = "serving_default_" + data_in.name + ":0"
+    tvm_output = run_tvm_graph(tflite_model_quant, data, in_node)
     tvm.testing.assert_allclose(
         np.squeeze(tvm_output[0]), np.squeeze(tflite_output[0]), rtol=1e-5, atol=1e-2
     )
@@ -3051,7 +3065,6 @@ def _test_quantize_dequantize_const(data):
     add = tf.keras.layers.Add()([data, relu])
     concat = tf.keras.layers.Concatenate(axis=0)([relu, add])
     keras_model = tf.keras.models.Model(inputs=data_in, outputs=concat)
-    input_name = data_in.name.split(":")[0]
 
     # To create quantized values with dynamic range of activations, needs representative dataset
     def representative_data_gen():
@@ -3061,7 +3074,11 @@ def _test_quantize_dequantize_const(data):
     tflite_model_quant = _quantize_keras_model(keras_model, representative_data_gen, True, True)
 
     tflite_output = run_tflite_graph(tflite_model_quant, data)
-    tvm_output = run_tvm_graph(tflite_model_quant, data, input_name)
+    if tf.__version__ < LooseVersion("2.9"):
+        in_node = data_in.name.split(":")[0]
+    else:
+        in_node = "serving_default_" + data_in.name + ":0"
+    tvm_output = run_tvm_graph(tflite_model_quant, data, in_node)
     tvm.testing.assert_allclose(
         np.squeeze(tvm_output[0]), np.squeeze(tflite_output[0]), rtol=1e-5, atol=1e-2
     )