Skip to content

Commit

Permalink
Merge pull request #566 from RedisAI/backends_upgrade
Browse files Browse the repository at this point in the history
backend updates
  • Loading branch information
DvirDukhan committed Feb 4, 2021
2 parents 69027b1 + be1da3f commit 8c258e7
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ jobs:
enabled: true
docker_layer_caching: true
resource_class: gpu.nvidia.small
image: ubuntu-1604-cuda-10.1:201909-23
image: ubuntu-1604-cuda-11.1:202012-01
steps:
- checkout
- run:
Expand Down
18 changes: 13 additions & 5 deletions Dockerfile.gpu
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ ARG OS=ubuntu18.04
# ARCH=x64|arm64v8|arm32v7
ARG ARCH=x64

ARG CUDA_VER=10.1-cudnn7
ARG CUDA_VER=11.0-cudnn8

ARG PACK=0
ARG TEST=0

#----------------------------------------------------------------------------------------------
FROM redisfab/redis:${REDIS_VER}-${ARCH}-${OSNICK} AS redis
FROM nvidia/cuda:10.2-cudnn8-devel-${OS} AS cuda_10.2
FROM nvidia/cuda:${CUDA_VER}-devel-${OS} AS builder

ARG OSNICK
Expand All @@ -34,6 +35,11 @@ ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
WORKDIR /build
COPY --from=redis /usr/local/ /usr/local/

COPY --from=cuda_10.2 /usr/local/cuda-10.2 /usr/local/cuda-10.2
COPY --from=cuda_10.2 /usr/lib/x86_64-linux-gnu/libcu* /usr/lib/x86_64-linux-gnu/

RUN echo export LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/cuda-11.0/lib64:/usr/local/cuda-10.2/lib64:$LD_LIBRARY_PATH > /etc/profile.d/cuda.sh

COPY ./opt/ opt/
COPY ./tests/flow/test_requirements.txt tests/flow/

Expand All @@ -59,10 +65,10 @@ RUN set -e ;\

RUN set -e ;\
if [ "$TEST" = "1" ]; then \
TEST= make -C opt test GPU=1 $BUILD_ARGS NO_LFS=1 ;\
if [[ -d test/logs ]]; then \
tar -C test/logs -czf bin/artifacts/test-logs-gpu.tgz . ;\
fi ;\
TEST= make -C opt test GPU=1 $BUILD_ARGS NO_LFS=1 ;\
if [[ -d test/logs ]]; then \
tar -C test/logs -czf bin/artifacts/test-logs-gpu.tgz . ;\
fi ;\
fi

#----------------------------------------------------------------------------------------------
Expand All @@ -77,6 +83,8 @@ ENV REDIS_MODULES /usr/lib/redis/modules
RUN mkdir -p $REDIS_MODULES/

COPY --from=redis /usr/local/ /usr/local/
COPY --from=builder /usr/local/cuda-10.2 /usr/local/cuda-10.2
COPY --from=builder /usr/lib/x86_64-linux-gnu/libcu* /usr/lib/x86_64-linux-gnu/
COPY --from=builder /build/install-gpu/ $REDIS_MODULES/

COPY --from=builder /build/bin/artifacts/ /var/opt/redislabs/artifacts
Expand Down
22 changes: 14 additions & 8 deletions Dockerfile.gpu-test
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ ARG ARCH=x64
# OS=ubuntu18.04|ubuntu16.04|centos7
ARG OS=ubuntu18.04

ARG CUDA_VER=10.1-cudnn7
ARG CUDA_VER=11.0-cudnn8

ARG PACK=1

#----------------------------------------------------------------------------------------------
FROM redisfab/redis:${REDIS_VER}-${ARCH}-${OSNICK} AS redis
FROM nvidia/cuda:10.2-cudnn8-devel-${OS} AS cuda_10.2
FROM nvidia/cuda:${CUDA_VER}-devel-${OS} AS builder

SHELL ["/bin/bash", "-c"]
Expand All @@ -27,6 +28,11 @@ ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
WORKDIR /build
COPY --from=redis /usr/local/ /usr/local/

COPY --from=cuda_10.2 /usr/local/cuda-10.2 /usr/local/cuda-10.2
COPY --from=cuda_10.2 /usr/lib/x86_64-linux-gnu/libcu* /usr/lib/x86_64-linux-gnu/

RUN echo export LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/cuda-11.0/lib64:/usr/local/cuda-10.2/lib64:$LD_LIBRARY_PATH > /etc/profile.d/cuda.sh

COPY ./opt/ opt/
COPY ./tests/flow/test_requirements.txt tests/flow/

Expand All @@ -41,24 +47,24 @@ COPY ./get_deps.sh .
RUN set -e ;\
. venv/bin/activate ;\
if [[ -z $DEPS_ARGS ]]; then \
VERBOSE=1 ./get_deps.sh gpu ;\
VERBOSE=1 ./get_deps.sh gpu ;\
else \
env $DEPS_ARGS ./get_deps.sh gpu ;\
env $DEPS_ARGS ./get_deps.sh gpu ;\
fi

ARG BUILD_ARGS=""
ADD ./ /build
RUN set -e ;\
. venv/bin/activate ;\
. ./opt/readies/bin/sourced ./profile.d ;\
make -C opt build GPU=1 $BUILD_ARGS SHOW=1
. venv/bin/activate ;\
. ./opt/readies/bin/sourced ./profile.d ;\
make -C opt build GPU=1 $BUILD_ARGS SHOW=1

ARG PACK

RUN set -e ;\
if [[ $PACK == 1 ]]; then \
. venv/bin/activate ;\
make -C opt pack GPU=1 VERBOSE=1 ;\
. venv/bin/activate ;\
make -C opt pack GPU=1 VERBOSE=1 ;\
fi

RUN git remote set-url origin https://github.com/RedisAI/RedisAI
Expand Down
8 changes: 4 additions & 4 deletions get_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ fi

################################################################################# LIBTENSORFLOW

TF_VERSION="2.3.1"
TF_VERSION="2.4.0"

if [[ $WITH_TF != 0 ]]; then
[[ $FORCE == 1 ]] && rm -rf $LIBTENSORFLOW
Expand Down Expand Up @@ -194,7 +194,7 @@ fi # WITH_TFLITE

###################################################################################### LIBTORCH

PT_VERSION="1.7.0"
PT_VERSION="1.7.1"

if [[ $WITH_PT != 0 ]]; then
[[ $FORCE == 1 ]] && rm -rf $LIBTORCH
Expand All @@ -212,7 +212,7 @@ if [[ $WITH_PT != 0 ]]; then
if [[ $JETSON == 1 ]]; then
PT_BUILD=cu102-jetson
else
PT_BUILD=cu101
PT_BUILD=cu110
fi
fi
if [[ $ARCH == x64 ]]; then
Expand Down Expand Up @@ -282,7 +282,7 @@ fi

################################################################################### ONNXRUNTIME

ORT_VERSION="1.2.0"
ORT_VERSION="1.6.0"

if [[ $WITH_ORT != 0 ]]; then
[[ $FORCE == 1 ]] && rm -rf $ONNXRUNTIME
Expand Down
2 changes: 1 addition & 1 deletion opt/build/libtorch/repack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if [[ $OS == linux ]]; then
if [[ $GPU != 1 ]]; then
PT_BUILD=cpu
else
PT_BUILD=cu101
PT_BUILD=cu110
fi
if [[ $ARCH == x64 ]]; then
PT_ARCH=x86_64
Expand Down

0 comments on commit 8c258e7

Please sign in to comment.