Skip to content

Commit 7b66951

Browse files
author
DvirDukhan
authored
Merge branch 'master' into redis-cli-modelget-limitation
2 parents a2e25a1 + 9829856 commit 7b66951

File tree

131 files changed

+2516
-1994
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

131 files changed

+2516
-1994
lines changed

.circleci/config.yml

Lines changed: 119 additions & 112 deletions
Large diffs are not rendered by default.

CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
4444

4545
# Add -fno-omit-frame-pointer to avoid seeing incomplete stack traces
4646
set(CMAKE_COMMON_FLAGS_DEBUG "-g -ggdb -fno-omit-frame-pointer -D_DEBUG -DVALGRIND -include \
47-
${CMAKE_CURRENT_SOURCE_DIR}/src/common.h -I${CMAKE_CURRENT_SOURCE_DIR}/opt")
47+
${CMAKE_CURRENT_SOURCE_DIR}/src/config/gdb_config.h -I${CMAKE_CURRENT_SOURCE_DIR}/opt")
4848
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${CMAKE_COMMON_FLAGS_DEBUG}")
4949
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${CMAKE_COMMON_FLAGS_DEBUG}")
5050

@@ -98,6 +98,7 @@ GET_FILENAME_COMPONENT(installAbs
9898
#----------------------------------------------------------------------------------------------
9999

100100
INCLUDE_DIRECTORIES(${depsAbs}/dlpack/include)
101+
INCLUDE_DIRECTORIES(src)
101102
IF(BUILD_TF)
102103
INCLUDE_DIRECTORIES(${depsAbs}/libtensorflow/include)
103104
ENDIF()
@@ -182,7 +183,7 @@ IF(BUILD_TFLITE)
182183
# Find TensorFlow Lite stuff and build our wrapper
183184
INCLUDE_DIRECTORIES(util/libtflite_c)
184185

185-
ADD_SUBDIRECTORY(src/libtflite_c)
186+
ADD_SUBDIRECTORY(src/backends/libtflite_c)
186187
ENDIF()
187188

188189
#----------------------------------------------------------------------------------------------
@@ -194,12 +195,13 @@ IF(BUILD_TORCH)
194195

195196
INCLUDE_DIRECTORIES(util/libtorch_c)
196197

197-
ADD_SUBDIRECTORY(src/libtorch_c)
198+
ADD_SUBDIRECTORY(src/backends/libtorch_c)
198199
ENDIF()
199200

200201
#----------------------------------------------------------------------------------------------
201202

202203
ADD_SUBDIRECTORY(src)
204+
ADD_SUBDIRECTORY(tests/module)
203205
ADD_LIBRARY(redisai SHARED $<TARGET_OBJECTS:redisai_obj>)
204206

205207
TARGET_LINK_LIBRARIES(redisai ${CMAKE_DL_LIBS})

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# BUILD redisfab/redisai:${VERSION}-cpu-${ARCH}-${OSNICK}
22

3-
ARG REDIS_VER=6.0.5
3+
ARG REDIS_VER=6.0.9
44

55
# OSNICK=bionic|stretch|buster
66
ARG OSNICK=buster
@@ -31,7 +31,7 @@ COPY --from=redis /usr/local/ /usr/local/
3131
COPY ./opt/ opt/
3232
COPY ./tests/flow/test_requirements.txt tests/flow/
3333

34-
RUN PIP=1 FORCE=1 ./opt/readies/bin/getpy3
34+
RUN FORCE=1 ./opt/readies/bin/getpy3
3535
RUN ./opt/system-setup.py
3636

3737
ARG DEPS_ARGS=""

Dockerfile.arm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# BUILD redisfab/redisai:${VERSION}-cpu-${ARCH}-${OSNICK}
22

3-
ARG REDIS_VER=6.0.5
3+
ARG REDIS_VER=6.0.9
44

55
# OSNICK=bionic|stretch|buster
66
ARG OSNICK=buster

Dockerfile.gpu

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# BUILD redisfab/redisai:${VERSION}-gpu-${ARCH}-${OSNICK}
22

3-
ARG REDIS_VER=6.0.5
3+
ARG REDIS_VER=6.0.9
44

55
# OSNICK=bionic|centos7|centos6
66
ARG OSNICK=bionic
@@ -11,13 +11,14 @@ ARG OS=ubuntu18.04
1111
# ARCH=x64|arm64v8|arm32v7
1212
ARG ARCH=x64
1313

14-
ARG CUDA_VER=10.1-cudnn7
14+
ARG CUDA_VER=11.0-cudnn8
1515

1616
ARG PACK=0
1717
ARG TEST=0
1818

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

2324
ARG OSNICK
@@ -34,10 +35,15 @@ ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
3435
WORKDIR /build
3536
COPY --from=redis /usr/local/ /usr/local/
3637

38+
COPY --from=cuda_10.2 /usr/local/cuda-10.2 /usr/local/cuda-10.2
39+
COPY --from=cuda_10.2 /usr/lib/x86_64-linux-gnu/libcu* /usr/lib/x86_64-linux-gnu/
40+
41+
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
42+
3743
COPY ./opt/ opt/
3844
COPY ./tests/flow/test_requirements.txt tests/flow/
3945

40-
RUN PIP=1 FORCE=1 ./opt/readies/bin/getpy3
46+
RUN FORCE=1 ./opt/readies/bin/getpy3
4147
RUN ./opt/system-setup.py
4248

4349
ARG DEPS_ARGS=""
@@ -59,10 +65,10 @@ RUN set -e ;\
5965

6066
RUN set -e ;\
6167
if [ "$TEST" = "1" ]; then \
62-
TEST= make -C opt test GPU=1 $BUILD_ARGS NO_LFS=1 ;\
63-
if [[ -d test/logs ]]; then \
64-
tar -C test/logs -czf bin/artifacts/test-logs-gpu.tgz . ;\
65-
fi ;\
68+
TEST= make -C opt test GPU=1 $BUILD_ARGS NO_LFS=1 ;\
69+
if [[ -d test/logs ]]; then \
70+
tar -C test/logs -czf bin/artifacts/test-logs-gpu.tgz . ;\
71+
fi ;\
6672
fi
6773

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

7985
COPY --from=redis /usr/local/ /usr/local/
86+
COPY --from=builder /usr/local/cuda-10.2 /usr/local/cuda-10.2
87+
COPY --from=builder /usr/lib/x86_64-linux-gnu/libcu* /usr/lib/x86_64-linux-gnu/
8088
COPY --from=builder /build/install-gpu/ $REDIS_MODULES/
8189

8290
COPY --from=builder /build/bin/artifacts/ /var/opt/redislabs/artifacts

Dockerfile.gpu-test

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# BUILD redisfab/redisai:${VERSION}-gpu-${ARCH}-${OSNICK}-test
22

3-
ARG REDIS_VER=6.0.5
3+
ARG REDIS_VER=6.0.9
44

55
# OSNICK=bionic|centos7|centos6
66
ARG OSNICK=bionic
@@ -11,12 +11,13 @@ ARG ARCH=x64
1111
# OS=ubuntu18.04|ubuntu16.04|centos7
1212
ARG OS=ubuntu18.04
1313

14-
ARG CUDA_VER=10.1-cudnn7
14+
ARG CUDA_VER=11.0-cudnn8
1515

1616
ARG PACK=1
1717

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

2223
SHELL ["/bin/bash", "-c"]
@@ -27,40 +28,44 @@ ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
2728
WORKDIR /build
2829
COPY --from=redis /usr/local/ /usr/local/
2930

31+
COPY --from=cuda_10.2 /usr/local/cuda-10.2 /usr/local/cuda-10.2
32+
COPY --from=cuda_10.2 /usr/lib/x86_64-linux-gnu/libcu* /usr/lib/x86_64-linux-gnu/
33+
34+
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
35+
3036
COPY ./opt/ opt/
3137
COPY ./tests/flow/test_requirements.txt tests/flow/
38+
COPY ./tests/flow/Install_RedisGears.sh tests/flow/
3239

33-
RUN PIP=1 VENV=1 FORCE=1 ./opt/readies/bin/getpy3
40+
RUN VENV=venv FORCE=1 ./opt/readies/bin/getpy3
3441

3542
RUN set -e ;\
36-
python3 -m virtualenv venv --system-site-packages ;\
3743
. venv/bin/activate ;\
38-
python -m pip install pip==19.3.1 ;\
3944
./opt/system-setup.py
4045

4146
ARG DEPS_ARGS=""
4247
COPY ./get_deps.sh .
4348
RUN set -e ;\
4449
. venv/bin/activate ;\
4550
if [[ -z $DEPS_ARGS ]]; then \
46-
VERBOSE=1 ./get_deps.sh gpu ;\
51+
VERBOSE=1 ./get_deps.sh gpu ;\
4752
else \
48-
env $DEPS_ARGS ./get_deps.sh gpu ;\
53+
env $DEPS_ARGS ./get_deps.sh gpu ;\
4954
fi
5055

5156
ARG BUILD_ARGS=""
5257
ADD ./ /build
5358
RUN set -e ;\
54-
. venv/bin/activate ;\
55-
. ./opt/readies/bin/sourced ./profile.d ;\
56-
make -C opt build GPU=1 $BUILD_ARGS SHOW=1
59+
. venv/bin/activate ;\
60+
. ./opt/readies/bin/sourced ./profile.d ;\
61+
make -C opt build GPU=1 $BUILD_ARGS SHOW=1
5762

5863
ARG PACK
5964

6065
RUN set -e ;\
6166
if [[ $PACK == 1 ]]; then \
62-
. venv/bin/activate ;\
63-
make -C opt pack GPU=1 VERBOSE=1 ;\
67+
. venv/bin/activate ;\
68+
make -C opt pack GPU=1 VERBOSE=1 ;\
6469
fi
6570

6671
RUN git remote set-url origin https://github.com/RedisAI/RedisAI

Dockerfile.jetson

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ COPY --from=redis /usr/local/ /usr/local/
4040
COPY ./opt/ opt/
4141
COPY ./tests/flow/test_requirements.txt tests/flow/
4242

43-
RUN PIP=1 FORCE=1 ./opt/readies/bin/getpy3
43+
RUN FORCE=1 ./opt/readies/bin/getpy3
4444
RUN ./opt/system-setup.py
4545

4646
ARG DEPS_ARGS="GPU=1 JETSON=1 WITH_PT=1 WITH_TF=1 WITH_TFLITE=0 WITH_ORT=0"
@@ -81,7 +81,7 @@ ARG OS
8181
ARG L4T_VER
8282

8383
RUN if [ ! -z $(command -v apt-get) ]; then apt-get -qq update; apt-get -q install -y libgomp1; fi
84-
RUN if [ ! -z $(command -v yum) ]; then yum install -y libgomp; fi
84+
RUN if [ ! -z $(command -v yum) ]; then yum install -y libgomp; fi
8585

8686
ENV REDIS_MODULES /usr/lib/redis/modules
8787
RUN mkdir -p $REDIS_MODULES/
@@ -96,4 +96,5 @@ COPY --from=builder /build/bin/artifacts/ /var/opt/redislabs/artifacts
9696
WORKDIR /data
9797
EXPOSE 6379
9898
# CMD ["/usr/local/bin/redis-server", "/usr/local/etc/redis/redis.conf", "--loadmodule", "/usr/lib/redis/modules/redisai.so"]
99+
RUN rm -rf /root/.cache /usr/local/cuda/lib64/*.a /usr/local/cuda/doc /usr/local/cuda/samples
99100
CMD ["/usr/local/bin/redis-server", "--loadmodule", "/usr/lib/redis/modules/redisai.so"]

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[![GitHub issues](https://img.shields.io/github/release/RedisAI/RedisAI.svg?sort=semver)](https://github.com/RedisAI/RedisAI/releases/latest)
22
[![CircleCI](https://circleci.com/gh/RedisAI/RedisAI/tree/master.svg?style=svg)](https://circleci.com/gh/RedisAI/RedisAI/tree/master)
3-
[![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/redisai/redisai.svg)](https://hub.docker.com/r/redisai/redisai/builds/)
3+
[![Dockerhub](https://img.shields.io/badge/dockerhub-redislabs%2Fredisai-blue)](https://hub.docker.com/r/redislabs/redisai/tags/)
44
[![codecov](https://codecov.io/gh/RedisAI/RedisAI/branch/master/graph/badge.svg)](https://codecov.io/gh/RedisAI/RedisAI)
55
[![Total alerts](https://img.shields.io/lgtm/alerts/g/RedisAI/RedisAI.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/RedisAI/RedisAI/alerts/)
66

@@ -23,13 +23,13 @@ If you want to run examples, make sure you have [git-lfs](https://git-lfs.github
2323
To quickly tryout RedisAI, launch an instance using docker:
2424

2525
```sh
26-
docker run -p 6379:6379 -it --rm redisai/redisai
26+
docker run -p 6379:6379 -it --rm redislabs/redisai
2727
```
2828

2929
For docker instance with GPU support, you can launch it from `tensorwerk/redisai-gpu`
3030

3131
```sh
32-
docker run -p 6379:6379 --gpus all -it --rm redisai/redisai:latest-gpu
32+
docker run -p 6379:6379 --gpus all -it --rm redislabs/redisai:latest-gpu
3333
```
3434

3535
But if you'd like to build the docker image, you need a machine that has Nvidia driver (CUDA 10.0), nvidia-container-toolkit and Docker 19.03+ installed. For detailed information, checkout [nvidia-docker documentation](https://github.com/NVIDIA/nvidia-docker)

docs/commands.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -661,14 +661,14 @@ Because `AI.DAGRUN` provides the `PERSIST` option it is flagged as a 'write' com
661661
Refer to the Redis [`READONLY` command](https://redis.io/commands/readonly) for further information about read-only cluster replicas.
662662

663663
## AI.INFO
664-
The **`AI.INFO`** command returns information about the execution a model or a script.
664+
The **`AI.INFO`** command returns general module information or information about the execution a model or a script.
665665

666666
Runtime information is collected each time that [`AI.MODELRUN`](#aimodelrun) or [`AI.SCRIPTRUN`](#aiscriptrun) is called. The information is stored locally by the executing RedisAI engine, so when deployed in a cluster each shard stores its own runtime information.
667667

668668
**Redis API**
669669

670670
```
671-
AI.INFO <key> [RESETSTAT]
671+
AI.INFO [<key>] [RESETSTAT]
672672
```
673673

674674
_Arguments_
@@ -678,7 +678,15 @@ _Arguments_
678678

679679
_Return_
680680

681-
An array with alternating entries that represent the following key-value pairs:
681+
For a module genernal information: An array with alternating entries that represent the following key-value pairs:
682+
683+
* **Version**: a string showing the current module version.
684+
* **Low level API Version**: a string showing the current module's low level api version.
685+
* **RDB Encoding version**: a string showing the current module's RDB encoding version.
686+
* **TensorFlow version**: a string showing the current loaded TesnorFlow backend version.
687+
* **ONNX version**: a string showing the current loaded ONNX Runtime backend version.
688+
689+
For model or script runtime information: An array with alternating entries that represent the following key-value pairs:
682690

683691
* **KEY**: a String of the name of the key storing the model or script value
684692
* **TYPE**: a String of the type of value (i.e. 'MODEL' or 'SCRIPT')

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ RedisAI is a joint effort between [Redis Labs](https://www.redislabs.com) and [T
1717
## Quick Links
1818
* [Source code repository](https://github.com/RedisAI/RedisAI)
1919
* [Releases](https://github.com/RedisAI/RedisAI/releases)
20-
* [Docker image](https://hub.docker.com/r/redisai/redisai/)
20+
* [Docker image](https://hub.docker.com/r/redislabs/redisai/)
2121

2222
## Contact Us
2323
If you have questions, want to provide feedback or perhaps report an issue or [contribute some code](contrib.md), here's where we're listening to you:

0 commit comments

Comments
 (0)