Skip to content

Commit 54b33f5

Browse files
authored
v23.05 (#16)
Signed-off-by: Josh Minor <[email protected]>
1 parent a16af2d commit 54b33f5

File tree

10 files changed

+61
-34
lines changed

10 files changed

+61
-34
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ on:
6464
tflite_tag:
6565
description: "TFLite tag to build against"
6666
required: true
67-
default: v2.4.1
67+
default: v2.10.0
6868
type: string
69-
armnn_tag:
69+
ARMNN_VERSION:
7070
description: "ArmNN tag to build against"
7171
required: true
72-
default: v22.08
72+
default: 23.02
7373
type: string
7474
enable_armnn_delegate:
7575
description: "Enable ArmNN Delegate in build"
@@ -89,8 +89,8 @@ env:
8989
TFLITE_ENABLE_RUY: ${{ inputs.enable_ruy || 'ON' }}
9090
TFLITE_BAZEL_BUILD: ${{ inputs.enable_bazel || 'OFF' }}
9191
TFLITE_ENABLE_FLEX_OPS: ${{ inputs.enable_flex_ops || 'OFF' }}
92-
TFLITE_TAG: ${{ inputs.tflite_tag || 'v2.4.1' }}
93-
ARMNN_TAG: ${{ inputs.armnn_tag || 'v22.08' }}
92+
TFLITE_TAG: ${{ inputs.tflite_tag || 'v2.10.0' }}
93+
ARMNN_VERSION: ${{ inputs.ARMNN_VERSION || '23.02' }}
9494
ARMNN_DELEGATE_ENABLE: ${{ inputs.enable_armnn_delegate || 'ON' }}
9595

9696
jobs:
@@ -181,9 +181,9 @@ jobs:
181181
-DTFLITE_BAZEL_BUILD=${{env.TFLITE_BAZEL_BUILD}} \
182182
-DTFLITE_ENABLE_FLEX_OPS=${{env.TFLITE_ENABLE_FLEX_OPS}} \
183183
-DTFLITE_TAG=${{env.TFLITE_TAG}} \
184-
-DARMNN_TAG=${{env.ARMNN_TAG}} \
184+
-DARMNN_VERSION=${{env.ARMNN_VERSION}} \
185185
-DARMNN_DELEGATE_ENABLE=${{env.ARMNN_DELEGATE_ENABLE}} \
186-
-DACL_TAG=${{env.ARMNN_TAG}} \
186+
-DACL_VERSION=${{env.ARMNN_VERSION}} \
187187
-DJOBS=$(nproc)
188188
189189
- name: Cmake build

.github/workflows/triton_build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ jobs:
5252

5353
build:
5454
needs: get_triton_branches
55+
if: needs.get_triton_branches.outputs.triton_branches != "{}"
5556
strategy:
5657
fail-fast: false
5758
matrix:
@@ -115,3 +116,4 @@ jobs:
115116
docker tag tritonserver:latest ghcr.io/smarter-project/armnn_tflite_backend/triton:$branch_tag_name
116117
docker push $image_name
117118
docker push ghcr.io/smarter-project/armnn_tflite_backend/triton:$branch_tag_name
119+
docker rmi $image_name ghcr.io/smarter-project/armnn_tflite_backend/triton:$branch_tag_name tritonserver:latest

CMakeLists.txt

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ set(TRITON_COMMON_REPO_TAG
2525

2626
# TFLite Options
2727
set(TFLITE_TAG
28-
"v2.4.1"
28+
"v2.10.0"
2929
CACHE STRING "Version of TFLite to build")
3030
set(BAZEL_BINARY
3131
"/usr/bin/bazel"
@@ -36,17 +36,17 @@ option(TFLITE_ENABLE_FLEX_OPS
3636
"Build tflite with flex ops support (must build with bazel)" OFF)
3737

3838
# ArmNN Options
39-
set(ARMNN_TAG
40-
"v22.08"
39+
set(ARMNN_VERSION
40+
"23.02"
4141
CACHE STRING "Tag for ArmNN repo")
4242
set(ARMNN_BUILD_TYPE
4343
${CMAKE_BUILD_TYPE}
4444
CACHE STRING "Set ArmNN build type")
4545
option(ARMNN_DELEGATE_ENABLE "Build ArmNN Delegate" ON)
4646

4747
# ACL Options
48-
set(ACL_TAG
49-
${ARMNN_TAG}
48+
set(ACL_VERSION
49+
${ARMNN_VERSION}
5050
CACHE STRING "Tag for ACL repo")
5151
set(ACL_DEBUG
5252
"0"
@@ -65,7 +65,7 @@ set(ACL_ENABLE_CL
6565
CACHE STRING "Enable OpenCL Backend in build")
6666

6767
set(FLATBUFFERS_VERSION
68-
"1.12.0"
68+
"2.0.6"
6969
CACHE STRING "Version of Flatbuffers to use")
7070
set(JOBS
7171
"8"
@@ -101,7 +101,7 @@ if(NOT DEFINED ACL_ARCH)
101101
endif()
102102

103103
# ACL before 21.05 compiled with only gcc7
104-
if(NOT (ACL_TAG MATCHES "(v21.(05|08|11))|(v22.(02|05|08))"))
104+
if(NOT (ACL_VERSION VERSION_GREATER "21.05"))
105105
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7)
106106
set(ACL_CC_COMPILER "gcc-7")
107107
set(ACL_CXX_COMPILER "g++-7")
@@ -114,8 +114,7 @@ set(CMAKE_C_FLAGS "-funsafe-math-optimizations")
114114

115115
set(ACL_BUILD_FLAGS "-j${JOBS}" "arch=${ACL_ARCH}" "debug=${ACL_DEBUG}" "neon=${ACL_ENABLE_NEON}" "opencl=${ACL_ENABLE_CL}" "embed_kernels=1" "extra_cxx_flags=-fPIC" "benchmark_tests=0" "build=native" "validation_tests=0" "examples=0")
116116

117-
# ACL before 21.05 compiled with only gcc7
118-
if(NOT (ACL_TAG MATCHES "v22.(02|05|08)"))
117+
if(NOT (ACL_VERSION VERSION_GREATER "21.05"))
119118
list(APPEND ACL_BUILD_FLAGS "internal_only=0")
120119
endif()
121120

@@ -154,7 +153,8 @@ if(NOT TFLITE_BAZEL_BUILD)
154153
PATCH_COMMAND
155154
git apply ${CMAKE_CURRENT_SOURCE_DIR}/patches/xnnpack_commit.patch ||
156155
true # patch updates the commit hash for xnnpack for tensorflow v2.4.1
157-
SOURCE_SUBDIR tensorflow/lite)
156+
SOURCE_SUBDIR tensorflow/lite
157+
)
158158

159159
list(APPEND MAKE_AVAILABLE_LIST tensorflow-lite)
160160
endif()
@@ -234,9 +234,9 @@ if(ARMNN_DELEGATE_ENABLE)
234234
set(ARMNN_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/external/armnn)
235235
file(MAKE_DIRECTORY ${ARMNN_LOCATION})
236236

237-
if(ACL_TAG STREQUAL "v21.08")
237+
if(ACL_VERSION VERSION_EQUAL "21.08")
238238
set(ACL_PATCH_COMMAND "git" "apply" "${CMAKE_CURRENT_SOURCE_DIR}/patches/acl_21_08.patch" "||" "true")
239-
elseif(ACL_TAG STREQUAL "v21.11")
239+
elseif(ACL_VERSION VERSION_EQUAL "21.11")
240240
set(ACL_PATCH_COMMAND "git" "apply" "${CMAKE_CURRENT_SOURCE_DIR}/patches/acl_21_11.patch" "||" "true")
241241
else()
242242
set(ACL_PATCH_COMMAND "")
@@ -262,7 +262,7 @@ if(ARMNN_DELEGATE_ENABLE)
262262
acl
263263
PREFIX ${ACL_LOCATION}
264264
GIT_REPOSITORY https://review.mlplatform.org/ml/ComputeLibrary
265-
GIT_TAG ${ACL_TAG}
265+
GIT_TAG v${ACL_VERSION}
266266
GIT_SHALLOW ON
267267
PATCH_COMMAND ${ACL_PATCH_COMMAND}
268268
CONFIGURE_COMMAND ""
@@ -273,25 +273,30 @@ if(ARMNN_DELEGATE_ENABLE)
273273

274274
set(ARMNN_PATCH_COMMAND "")
275275

276-
if(NOT (ARMNN_TAG MATCHES "v22.(02|05|08)"))
276+
if(ARMNN_VERSION VERSION_LESS "22")
277277
# Never fail as patch is always applied after repo clone
278278
set(ARMNN_PATCH_COMMAND
279279
"git" "apply"
280280
"${CMAKE_CURRENT_SOURCE_DIR}/patches/tflite_armnn_delegate.patch" "||"
281281
"true")
282-
elseif(ARMNN_TAG MATCHES "v22.(02|05|08)")
282+
elseif(ARMNN_VERSION VERSION_GREATER_EQUAL "22" AND ARMNN_VERSION VERSION_LESS "23")
283283
set(ARMNN_PATCH_COMMAND
284284
"git" "apply"
285285
"${CMAKE_CURRENT_SOURCE_DIR}/patches/tflite_armnn_delegate22.patch" "||"
286286
"true")
287+
elseif(ARMNN_VERSION VERSION_GREATER_EQUAL "23")
288+
set(ARMNN_PATCH_COMMAND
289+
"git" "apply"
290+
"${CMAKE_CURRENT_SOURCE_DIR}/patches/tflite_armnn_delegate23.patch" "||"
291+
"true")
287292
endif()
288293

289294
# ArmNN and its tflite delegate
290295
ExternalProject_Add(
291296
armnn
292297
PREFIX ${ARMNN_LOCATION}
293298
GIT_REPOSITORY https://review.mlplatform.org/ml/armnn
294-
GIT_TAG ${ARMNN_TAG}
299+
GIT_TAG v${ARMNN_VERSION}
295300
GIT_SHALLOW ON
296301
PATCH_COMMAND ${ARMNN_PATCH_COMMAND}
297302
CMAKE_ARGS
@@ -335,7 +340,7 @@ set(BACKEND_INCLUDE_DIRS
335340
)
336341

337342
# As per https://review.mlplatform.org/c/ml/armnn/+/7327
338-
if(ARMNN_TAG MATCHES "v22.(05|08)")
343+
if(ARMNN_VERSION VERSION_GREATER_EQUAL "22.05")
339344
list(APPEND BACKEND_INCLUDE_DIRS ${ARMNN_LOCATION}/src/armnn/profiling)
340345
endif()
341346

@@ -359,6 +364,7 @@ target_compile_options(
359364
-Wextra
360365
-Wno-unused-parameter
361366
-Wno-type-limits
367+
-Wno-comment
362368
-Werror>)
363369

364370
# ARMNN_DELEGATE_ENABLE exposed in header so set PUBLIC

Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ ARG TRITON_ENABLE_MALI_GPU=ON
5050
ARG TFLITE_ENABLE_RUY=ON
5151
ARG TFLITE_BAZEL_BUILD=OFF
5252
ARG TFLITE_ENABLE_FLEX_OPS=OFF
53-
ARG TFLITE_TAG=v2.4.1
54-
ARG ARMNN_TAG=v22.08
53+
ARG TFLITE_TAG=v2.10.0
54+
ARG ARMNN_VERSION=23.02
5555
ARG ARMNN_DELEGATE_ENABLE=ON
56-
ARG ACL_TAG=${ARMNN_TAG}
56+
ARG ACL_VERSION=${ARMNN_VERSION}
5757

5858
# Install Bazel from source
5959
RUN if [ "$TFLITE_BAZEL_BUILD" = "ON" ]; then wget -O bazel-3.1.0-dist.zip https://github.com/bazelbuild/bazel/releases/download/3.1.0/bazel-3.1.0-dist.zip && \
@@ -82,8 +82,8 @@ RUN cmake -S . -B build \
8282
-DTFLITE_BAZEL_BUILD=${TFLITE_BAZEL_BUILD} \
8383
-DTFLITE_ENABLE_FLEX_OPS=${TFLITE_ENABLE_FLEX_OPS} \
8484
-DTFLITE_TAG=${TFLITE_TAG} \
85-
-DARMNN_TAG=${ARMNN_TAG} \
85+
-DARMNN_VERSION=${ARMNN_VERSION} \
8686
-DARMNN_DELEGATE_ENABLE=${ARMNN_DELEGATE_ENABLE} \
87-
-DACL_TAG=${ACL_TAG} \
87+
-DACL_VERSION=${ACL_VERSION} \
8888
-DJOBS=$(nproc) && \
8989
cmake --build build -j $(nproc) -t install

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ but the listed CMake argument can be used to override.
4949
You can update the version pins for TFLite, [ArmNN](https://github.com/ARM-software/armnn) and [Flatbuffers](https://github.com/google/flatbuffers)) using the following CMake arguments:
5050

5151
* TFLite tag: -DTFLITE_TAG=[tag]
52-
* ArmNN tag: -DARMNN_TAG=[tag]
53-
* Flatbuffers tag: -DFLATBUFFERS_VERSION=[tag]
52+
* ArmNN version: -DARMNN_VERSION=[version]
53+
* Flatbuffers version: -DFLATBUFFERS_VERSION=[version]
5454

5555
## Model Repository Structure
5656
The layout for your model repoitory remains the exact same as for other standard triton backends. Your model name should be set to `model.tflite`. An example model repository layout for ssd_mobilenetv1_coco is shown below:
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/delegate/cmake/Modules/FindTfLite.cmake b/delegate/cmake/Modules/FindTfLite.cmake
2+
index 338cde169..69ff03374 100644
3+
--- a/delegate/cmake/Modules/FindTfLite.cmake
4+
+++ b/delegate/cmake/Modules/FindTfLite.cmake
5+
@@ -22,6 +22,7 @@ find_library(TfLite_LIB NAMES "libtensorflow_lite_all.so" "libtensorflowlite.so"
6+
# If the static library was found, gather all of its dependencies
7+
if (TfLite_LIB MATCHES .a$)
8+
message("-- Static tensorflow lite library found, using for ArmNN build")
9+
+ set(TFLITE_LIB_ROOT ${TFLITE_LIB_ROOT}/../..)
10+
find_library(TfLite_abseilstrings_LIB "libabsl_strings.a"
11+
PATH ${TFLITE_LIB_ROOT}/_deps/abseil-cpp-build/absl/strings)
12+
find_library(TfLite_abseil_synchronization_LIB "libabsl_synchronization.a"

qa/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ apt-get install -y --no-install-recommends \
1616
libre2-dev \
1717
libssl-dev \
1818
libtool \
19-
libboost-dev \
2019
libcurl4-openssl-dev \
2120
libb64-dev \
2221
patchelf \
@@ -33,6 +32,13 @@ apt-get install -y --no-install-recommends \
3332
pkg-config \
3433
uuid-dev \
3534
libnuma-dev
35+
36+
# Need boost > 1.78
37+
wget -O /tmp/boost.tar.gz \
38+
https://boostorg.jfrog.io/artifactory/main/release/1.80.0/source/boost_1_80_0.tar.gz && \
39+
(cd /tmp && tar xzf boost.tar.gz) && \
40+
mv /tmp/boost_1_80_0/boost /usr/include/boost
41+
3642
./build.py -v --no-container-build --build-dir=`pwd`/build --backend=identity --endpoint=grpc --endpoint=http --enable-logging --enable-stats --enable-tracing --enable-metrics
3743
```
3844

qa/tests/thread_count_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def test_correct_thread_count(
190190
)
191191
# Cpu usage should be spread relatively evenly across the threads
192192
assert relative_std_err < 20.0
193-
assert sum(top_percents) > 75.0
193+
assert sum(top_percents) > 70.0
194194

195195
# At this point we have verified the number of threads was correct, so we can add
196196
# the thread ids used for inference directly to the threads to ignore next time

src/tflite.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ TRITONSERVER_Error*
785785
ModelInstanceState::BuildInterpreter()
786786
{
787787
// Build the tflite interpreter
788-
tflite::ops::builtin::BuiltinOpResolver resolver;
788+
tflite::ops::builtin::BuiltinOpResolverWithoutDefaultDelegates resolver;
789789
tflite::InterpreterBuilder builder(*model_, resolver);
790790
builder(&interpreter_);
791791
if (!interpreter_) {

src/tflite_utils.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <sstream>
88

99
#include "tensorflow/lite/model.h"
10+
1011
#include "triton/core/tritonserver.h"
1112

1213
namespace triton { namespace backend { namespace tensorflowlite {

0 commit comments

Comments
 (0)