-
Notifications
You must be signed in to change notification settings - Fork 5
/
guide.txt
executable file
·72 lines (55 loc) · 2.73 KB
/
guide.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
All build guide is based on tensorflow v2.16.2 source code.
1. Tensorflow Lite for aarch64 linux with XNNPack delegate
1) Build with bazel using following command
bazel build -c opt --copt=-DCL_DELEGATE_NO_GL --config=elinux_aarch64 //tensorflow/lite:libtensorflowlite.so
2. GPU delegate for aarch64 linux
1) Build with bazel using following command
bazel build -c opt --copt=-DCL_DELEGATE_NO_GL --config=elinux_aarch64 //tensorflow/lite/delegates/gpu:libtensorflowlite_gpu_delegate.so
3. Hexagon delegate for aarch64 linux
1) Add following lines into bazel build for hexagon delegate to build shared library (tensorflow/lite/delegates/hexagon/BUILD)
cc_binary(
name = "libtensorflowlite_hexagon_delegate.so",
linkopts = [
"-Wl,-soname=libtensorflowlite_hexagon_delegate.so",
],
linkshared = 1,
linkstatic = 1,
tags = [
"nobuilder",
"notap",
],
deps = [":hexagon_delegate"],
)
2) Build with bazel using following command
bazel build -c opt --config=elinux_aarch64 //tensorflow/lite/delegates/hexagon:libtensorflowlite_hexagon_delegate.so
3) Ask for hexagon-TFLite interface library(libhexagon_interface.so) for non-Android aarch64 linux on tensorflow github
Source code is not disclosed because of license issue.
Why Qualcomm is refusing to disclose their hexagon compute API?
4) Qualcomm hexagon library can be downloaded on following site:
https://www.tensorflow.org/lite/performance/hexagon_delegate
4. NNAPI delegate for aarch64 linux (NOT TESTED)
1) Add following lines into bazel build for nnapi delegate to build shared library (tensorflow/lite/delegates/nnapi/BUILD)
cc_binary(
name = "libtensorflowlite_nnapi_delegate.so",
linkopts = [
"-Wl,-soname=libtensorflowlite_nnapi_delegate.so",
],
linkshared = 1,
linkstatic = 1,
tags = [
"nobuilder",
"notap",
],
deps = [":nnapi_delegate"],
)
2) Build with bazel using following command
bazel build -c opt --config=elinux_aarch64 //tensorflow/lite/delegates/nnapi:libtensorflowlite_nnapi_delegate.so
5. Tensorflow Lite benchmark for aarch64 linux with all delegates
1) Set the hexagon library path in the benchmark code (tensorflow/lite/tools/delegates/hexagon_delegate_provider.cc)
default_params_.AddParam("hexagon_lib_path",
ToolParam::Create<std::string>(YOUR_PATH));
2) Build with bazel using following command
bazel build -c opt --copt=-DCL_DELEGATE_NO_GL --config=elinux_aarch64 //tensorflow/lite/tools/benchmark:benchmark_model
6. Image label example for aarch64 linux with all delegates
1) Build with bazel using following command
bazel build -c opt --copt=-DCL_DELEGATE_NO_GL --config=elinux_aarch64 //tensorflow/lite/examples/label_image:label_image