-
Notifications
You must be signed in to change notification settings - Fork 106
tflite build changes #688
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
chayim
wants to merge
22
commits into
master
Choose a base branch
from
ck-631
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
tflite build changes #688
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
4fbbb76
added new build script
DvirDukhan 5321ae7
added arch variable
DvirDukhan e80fe10
tflite x64
chayim 2afba49
package path update
chayim 77e9032
jetson dockerfile and make change to call it
chayim 4151275
tflite, in docker, x64
chayim dab47f6
shell script fix to inherit directory
chayim cec9827
Makefile to add bulid and publish targets
chayim c014e75
adding deps, and docs for backend explanations
chayim a4e80d2
wip
DvirDukhan 0f2b9cd
[ci skip]
chayim 45c3afb
validated final changes, pushed 2.4.1
chayim e47a33d
[skip ci]
chayim 8e84578
[skip ci] deps update for tflite
chayim b90024b
Merge branch 'ck-631' of https://github.com/RedisAI/RedisAI into ck-631
DvirDukhan b7e8139
rebase
chayim 08610f3
removing the merge dupe
chayim f408697
restoring bad merge
chayim ce824f3
Merge branch 'master' into ck-631
chayim 6678b33
Merge branch 'master' into ck-631
chayim 9b6cc1b
Merge branch 'master' into ck-631
chayim de5285e
changed TFLITE device to be env DEVICE. GPU delegate fails to load
DvirDukhan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# RedisAI dependency builds | ||
|
||
Platform dependency build systems are located in this folder. Dependencies are to be pre-built, and published to S3. To do so, they rely *(ultimately)* on running **make build publish** in a given directory. The goal is for this to be true on all target platforms (x86_64, arm64), though at this time it's only true for: tensorflowlite. | ||
|
||
## Background | ||
|
||
Items are built in docker images, for the target platform whenever possible. If needed (i.e a future planned MacOS build) items are built on the dedicated hardware. There are design wrinkles to each build. Though the ideal is to build a base docker (see the [automata repository](https://github.com/redislabsmodules/automata). That base docker is then used as the base build system injector for the dependency itself. A docker image is built from the base docker, accepting externalized variables such as the dependency version. Compilation of external requirements takes place in a build file, mounted inside the docker image. | ||
|
||
Ideally a per-platform Docker file (i.e Dockerfile.x64, Dockerfile.arm) will exist in the underlying folder, assuming building within a docker is tenable. | ||
|
||
-------------- | ||
|
||
## tensorflowlite (tflite) | ||
|
||
### arm64 | ||
|
||
The arm build of tflite currently occurs on **jetson arm devices** only, as portions of the root filesystem of the Jetson device are mounted during the build. Given the symlinks that exist on the device between things in /usr/lib to /etc/alternatives, and in turn to /usr/local/cuda, which is itself a symlink to /usr/local/cuda-10.2, this is the current philosophy. | ||
|
||
WThe *build_arm* target in the [Makefile](Makefile) describes the process in detail. The code to build the base docker build image can be found in the [automata repository](https://github.com/RedisLabsModules/automata/tree/master/dockers/buildsystem/bazelbuilder). The *bazelbuilder* image is published to the [redisfab dockerhub repositories](https://hub.docker.com/r/redisfab/). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,34 @@ | ||
ARG BAZEL_VERSION=3.1.0 | ||
ARG TFLITE_ARCH=x86_64 | ||
|
||
ARG OS=debian:buster | ||
ARG OS=redisfab/ubuntu1804-${TFLITE_ARCH}-bazel${BAZEL_VERSION} | ||
chayim marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
ARG FTLITE_VER=2.0.0 | ||
# cuda | cpu | ||
ARG REDISAI_PLATFORM=cuda | ||
|
||
ARG TFLITE_VERSION=2.4.0 | ||
|
||
#---------------------------------------------------------------------------------------------- | ||
FROM ${OS} | ||
|
||
ARG FTLITE_VER | ||
|
||
WORKDIR /build | ||
|
||
RUN set -e ;\ | ||
apt-get -qq update ;\ | ||
apt-get -q install -y git ca-certificates curl wget unzip python3 ;\ | ||
apt-get -q install -y git build-essential zlib1g-dev | ||
|
||
RUN git clone --single-branch --branch v${FTLITE_VER} --depth 1 https://github.com/tensorflow/tensorflow.git | ||
|
||
ADD ./opt/build/tflite/build /build/ | ||
ADD ./opt/readies/ /build/readies/ | ||
ADD ./opt/build/tflite/collect.py /build/ | ||
|
||
RUN set -e ;\ | ||
cd tensorflow/tensorflow/lite/tools/make ;\ | ||
./download_dependencies.sh ;\ | ||
./build_lib.sh | ||
|
||
RUN ./collect.py --version ${FTLITE_VER} --dest /build/dest | ||
ARG TFLITE_VERSION | ||
ARG TFLITE_ARCH | ||
ARG REDISAI_PLATFORM | ||
|
||
ADD ./opt/build/tflite /tflite | ||
|
||
RUN apt-get -qq update && apt-get install -yqq python3 | ||
RUN apt-get install -qqy git \ | ||
unzip \ | ||
wget \ | ||
curl \ | ||
build-essential \ | ||
zlib1g-dev \ | ||
libegl1-mesa-dev \ | ||
libgles2-mesa-dev \ | ||
python3-distutils \ | ||
python3-numpy | ||
RUN ln -s /usr/bin/python3 /usr/bin/python | ||
WORKDIR /tflite | ||
RUN bash build.sh ${TFLITE_ARCH} ${TFLITE_VERSION} ${REDISAI_PLATFORM} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.