Skip to content

Commit

Permalink
[TFLite][CI] Update TensorFlow dependency to 2.9.1
Browse files Browse the repository at this point in the history
This updates the TF version to be used in TVM CI to 2.9.1,
which brings improvements so that more platforms are supported by
official packages.

ethos-u-vela dependency is also updated, from version 3.2.0 to 3.4.0
so that it is closer to the TensorFlow version being proposed here.

This PR updates the Docker images scripting to install TF and TFLite.
  • Loading branch information
leandron committed Jul 19, 2022
1 parent 94d01d3 commit 2dd5353
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 19 deletions.
2 changes: 2 additions & 0 deletions cmake/modules/contrib/TFLite.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions docker/Dockerfile.ci_cpu
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -152,3 +155,4 @@ ENV PATH /opt/sccache:$PATH
# Libxsmm deps
COPY install/ubuntu_install_libxsmm.sh /install
RUN bash /install/ubuntu_install_libxsmm.sh

3 changes: 3 additions & 0 deletions docker/Dockerfile.ci_gpu
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile.ci_qemu
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,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

Expand Down
4 changes: 2 additions & 2 deletions docker/install/ubuntu_install_cmake_source.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion docker/install/ubuntu_install_python_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pip3 install --upgrade \
cython \
decorator \
mypy \
numpy~=1.19.5 \
numpy==1.21.* \
orderedset \
packaging \
Pillow==9.1.0 \
Expand Down
5 changes: 2 additions & 3 deletions docker/install/ubuntu_install_tensorflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 2 additions & 9 deletions docker/install/ubuntu_install_tensorflow_aarch64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ 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()
Expand All @@ -36,12 +31,10 @@ cleanup()
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.0 \
tensorflow-aarch64==2.9.1
13 changes: 11 additions & 2 deletions docker/install/ubuntu_install_tflite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

set -e
set -u
set -x
set -o pipefail

# The tflite version should have matched versions to the tensorflow
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docker/install/ubuntu_install_vela.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion tests/scripts/task_config_build_cpu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2dd5353

Please sign in to comment.