-
Notifications
You must be signed in to change notification settings - Fork 106
Upgrade to onnx 1.9 #847
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
Upgrade to onnx 1.9 #847
Changes from 25 commits
33e6ef5
b101e59
be2a69d
ddb2111
68fdfc7
1136450
fffa1ea
bbfde5b
af40e81
8743a75
1444119
c8e49a9
c56aa85
bab06d3
d1c5e80
08e8ef9
63a318d
724319b
c9b82a3
1aa4836
f312541
2977098
728b6b9
2b1f0bd
8b4e718
24f7ea9
063b86a
1b3ac61
74bf607
3e54ea2
7d31242
c45934a
af1bcf8
de4c368
8958a0d
55022ef
b18ecec
696747c
f63f95f
ab20006
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # RedisAI Development Backends | ||
|
|
||
| This document describes how a backend for RedisAI can be built, from this repository. It highlights the supported compilation devices on a per-backend basis, and highlights the tools and commands required. Unless indicated otherwise, a backend is compiled in a docker, which is responsible for the configuration and installation of all tools required for a given backend on a per-platform basis. | ||
|
|
||
| To follow these instructions, this repository must be cloned with all of its submodules (i.e *git clone --recursive https://github.com/RedisLabsModules/redisai*) | ||
|
|
||
| GNU Make is used as a runner for the dockerfile generator. Python is the language used for the generator script, and jinja is the templating library used to create the docker file from the template. | ||
|
|
||
| ## Tools | ||
|
|
||
| Buiding the backends requires installation of the following tools: | ||
|
|
||
| 1. gnu make | ||
| 1. python (3.0 or higher) | ||
| 1. docker | ||
| 1. jinja2 jinja is used to generate the platform dockerfile from a *dockerfile.tmpl* that can be found in the directory of a given backend listed below. | ||
|
alonre24 marked this conversation as resolved.
Outdated
|
||
|
|
||
| On ubuntu bionic these can be installed by running: | ||
|
|
||
| * sudo apt install python3 python3-dev make docker | ||
| * pip install --user jinja | ||
|
chayim marked this conversation as resolved.
Outdated
|
||
|
|
||
| ------- | ||
|
|
||
| ## Backends | ||
|
|
||
| ### onnxruntime | ||
|
|
||
| **Compilation target devices:** | ||
|
|
||
| 1. x86\_64 bit linux systems | ||
|
|
||
| 1. x86\_64 bit linux systems with a GPU | ||
|
|
||
| 1. jetson devices | ||
|
alonre24 marked this conversation as resolved.
Outdated
|
||
|
|
||
| **Directory:** opt/build/onnxruntime | ||
|
|
||
| **Build options:** | ||
|
|
||
| 1. To build run *make* | ||
|
|
||
| 1. To build with GPU support on x86\_64 run *make GPU=1* | ||
|
|
||
| 1. Should you want to build multiple targets from a shared directory, run *make DOCKER_SUFFIX=<yoursuffix>* on your target system. For example, if building on an arm and x64 workload, from a shared directory run: | ||
| * On x86: make DOCKER\_SUFFIX=x86\_64 | ||
|
|
||
| * On arm: make DOCKER\_SUFFIX=arm | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # default is x64 | ||
|
alonre24 marked this conversation as resolved.
|
||
| ARCH=$(shell ${READIES}/bin/platform --arch) | ||
| OS=$(shell ${READIES}/bin/platform --os) | ||
| REDIS_CMAKE_ARCH=x86_64 | ||
|
|
||
| # jetson | ||
| ifeq ($(shell test -e /usr/share/doc/nvidia-l4t-jetson-io && echo -n yes),yes) | ||
| ARCH=jetson | ||
| REDIS_CMAKE_ARCH=aarch64 | ||
| GPU=1 | ||
| endif | ||
| export REDIS_CMAKE_ARCH | ||
|
|
||
| # override if necessary in top-level make files | ||
| DEFAULT_DOCKER_TAG=${DOCKER_ORG}/${PRODUCT}:build | ||
| CIDFILE=${PRODUCT}.${ARCH}.cid | ||
|
|
||
| ifeq ($(GPU),1) | ||
| REDIS_GPU=1 | ||
| VARIANT=gpu | ||
| CIDFILE=${PRODUCT}.${ARCH}.gpu.cid # this way we can build from the same tree across platforms | ||
| export REDIS_GPU | ||
| endif | ||
|
|
||
| ifeq ($(VARIANT),) | ||
| BACKEND_NAME=${PRODUCT}-${OS}-${ARCH}-${VERSION}.tgz | ||
| else | ||
| BACKEND_NAME=${PRODUCT}-${OS}-${ARCH}-${VARIANT}-${VERSION}.tgz | ||
| endif | ||
|
|
||
| S3_URL=redismodules/${PRODUCT} | ||
|
|
||
| build: | ||
| @rm -f ${BACKEND_NAME} *.cid | ||
| REDIS_ARCH=${ARCH} \ | ||
| REDIS_OSNICK=${OSNICK} \ | ||
| ${READIES}/bin/dockerwrapper \ | ||
| -d ${CURDIR}/Dockerfile${DOCKER_SUFFIX} \ | ||
| -t ${DEFAULT_DOCKER_TAG} \ | ||
| -S ../dockerparts \ | ||
| -e REDIS \ | ||
| -D "${DOCKER_OPTS}" \ | ||
| ${DOCKER_ARGS} | ||
| docker create --cidfile ${CIDFILE} ${DEFAULT_DOCKER_TAG} | ||
| docker cp `cat ${CIDFILE}`:/build/${BACKEND_NAME} . | ||
|
|
||
| publish: | ||
| @aws s3 cp ${BACKEND_NAME} s3://$(S3_URL)/ --acl public-read | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| RUN apt-get update -qq | ||
| RUN DEBIAN_NONINTERACTIVE=y1 apt-get install -y software-properties-common | ||
|
|
||
| {% if REDIS_OSNICK == 'xenial' %} | ||
| RUN add-apt-repository ppa:deadsnakes/ppa | ||
| RUN add-apt-repository ppa:ubuntu-toolchain-r/test | ||
| {% endif %} | ||
|
|
||
| RUN apt-get update -qq | ||
| RUN DEBIAN_NONINTERACTIVE=1 apt-get install -y curl wget tar git patch \ | ||
| build-essential libcurl4-openssl-dev libssl-dev libatlas-base-dev zlib1g-dev \ | ||
| python3.6 python3-pip python3-dev python3-numpy \ | ||
| gcc-7 g++-7 | ||
|
|
||
| RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 60 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are python deps solved? can we have this without 3.6 (EOL this December)
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, thanks to @chayim that managed to build with python 3.7 |
||
| RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60 --slave /usr/bin/g++ g++ /usr/bin/g++-7 | ||
|
|
||
| RUN python3 -m pip install --upgrade pip setuptools wheel | ||
|
|
||
| ENV LANG=en_US.UTF-8 | ||
| RUN apt-get install -y locales && \ | ||
| sed -i -e "s/# $LANG.*/$LANG UTF-8/" /etc/locale.gen && \ | ||
| dpkg-reconfigure --frontend=noninteractive locales && \ | ||
| update-locale LANG=$LANG | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| {% set cmake_version = "3.19.7" %} | ||
| RUN wget -q https://github.com/Kitware/CMake/releases/download/v{{cmake_version}}/cmake-{{cmake_version}}-Linux-{{REDIS_CMAKE_ARCH}}.tar.gz -O /tmp/cmake.tgz | ||
|
|
||
| WORKDIR /tmp | ||
| RUN tar -zxpf /tmp/cmake.tgz | ||
| RUN mv /tmp/cmake*/bin/* /usr/bin | ||
| RUN mv /tmp/cmake-*/share/cmake* /usr/share/ | ||
|
|
||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Dockerfile | ||
| onnxruntime.x64.cid |
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why "a backend"?
we build only ONNXRuntime
maybe explain the need for building a backend. First, start with explaining that we use
DISABLE_EXTERNAL_INITIALIZERS=ONand that made go and building the backend from the source. Also, explain that we do not build the other backend libraries but downloading their binaries from the library websites.When we need to add more "backend builds" we can add additional "how-to"s
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I understand. I that OK if I will make the rephrasing in the next PR (#806 - the one that updates Torch and TF)?