Skip to content

Commit d806861

Browse files
authored
1.2.7 cherry picks (#926)
1 parent 5c16c29 commit d806861

File tree

125 files changed

+1065
-11112
lines changed

Some content is hidden

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

125 files changed

+1065
-11112
lines changed

.circleci/config.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,18 @@ commands:
140140
- run:
141141
name: Build
142142
command: make -C opt all SHOW=1
143+
- restore_cache:
144+
keys:
145+
- v1.2-tests_data
143146
- run:
144147
name: Test
145148
command: |
146149
make -C opt test SHOW=1
147150
no_output_timeout: 20m
151+
- save_cache:
152+
paths:
153+
- tests/flow/test_data
154+
key: v1.2-tests_data
148155
- run:
149156
name: Package
150157
command: |
@@ -182,6 +189,9 @@ commands:
182189
name: Build for valgrind
183190
command: |
184191
make -C opt all VALGRIND=1 SHOW=1
192+
- restore_cache:
193+
keys:
194+
- v1.2-tests_data
185195
- run:
186196
name: Test with valgrind
187197
command: |
@@ -198,6 +208,9 @@ commands:
198208
- restore_cache:
199209
keys:
200210
- v1.2.5-deps-{{ checksum "get_deps.sh" }}-gpu
211+
- restore_cache:
212+
keys:
213+
- v1.2-tests_data-gpu
201214
- relocate-docker-storage
202215
- run:
203216
name: Build
@@ -215,6 +228,10 @@ commands:
215228
mkdir -p $HOME/tests
216229
docker run --gpus all -v $HOME/tests:/build/tests/flow/logs -it --rm redisai-gpu:latest-test
217230
no_output_timeout: 40m
231+
- save_cache:
232+
paths:
233+
- tests/flow/test_data
234+
key: v1.2-tests_data-gpu
218235
- store_artifacts:
219236
path: /home/circleci/tests
220237

@@ -331,6 +348,9 @@ jobs:
331348
name: Build for coverage
332349
command: |
333350
make -C opt all COV=1 SHOW=1
351+
- restore_cache:
352+
keys:
353+
- v1.2-tests_data
334354
- run:
335355
name: Test with coverage
336356
command: |

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,7 @@ dkms.conf
137137
.idea_modules/
138138

139139
# docs site
140-
site/
140+
site/
141+
142+
# test data
143+
tests/flow/test_data

CMakeLists.txt

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ ENDIF()
2222

2323
#----------------------------------------------------------------------------------------------
2424

25-
SET(CMAKE_CC_COMMON_FLAGS "-fPIC -fcommon")
25+
SET(CMAKE_CC_COMMON_FLAGS "-fPIC -fcommon -g -ggdb")
2626
IF (USE_PROFILE)
27-
SET(CMAKE_CC_COMMON_FLAGS "${CMAKE_CC_COMMON_FLAGS} -g -ggdb -fno-omit-frame-pointer")
27+
SET(CMAKE_CC_COMMON_FLAGS "${CMAKE_CC_COMMON_FLAGS} -fno-omit-frame-pointer")
2828
ENDIF()
2929

3030
IF (USE_COVERAGE)
@@ -42,7 +42,7 @@ set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3")
4242
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
4343

4444
# Add -fno-omit-frame-pointer to avoid seeing incomplete stack traces
45-
set(CMAKE_COMMON_FLAGS_DEBUG "-g -ggdb -fno-omit-frame-pointer -D_DEBUG -DVALGRIND -include \
45+
set(CMAKE_COMMON_FLAGS_DEBUG "-fno-omit-frame-pointer -D_DEBUG -DVALGRIND -include \
4646
${CMAKE_CURRENT_SOURCE_DIR}/src/config/gdb_config.h -I${CMAKE_CURRENT_SOURCE_DIR}/opt")
4747
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${CMAKE_COMMON_FLAGS_DEBUG}")
4848
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${CMAKE_COMMON_FLAGS_DEBUG}")
@@ -168,18 +168,6 @@ IF(BUILD_ORT)
168168
ENDIF()
169169
ENDIF()
170170

171-
#----------------------------------------------------------------------------------------------
172-
173-
IF (APPLE)
174-
FIND_LIBRARY(MKL_LIBRARIES NAMES mklml
175-
PATHS ${depsAbs}/mkl/lib)
176-
IF (NOT MKL_LIBRARIES)
177-
MESSAGE(FATAL_ERROR "Could not find MKL for Mac")
178-
ENDIF()
179-
SET(platDeps "${MKL_LIBRARIES}")
180-
ENDIF()
181-
182-
#----------------------------------------------------------------------------------------------
183171

184172
IF(BUILD_TFLITE)
185173
# Find TensorFlow Lite stuff and build our wrapper
@@ -307,14 +295,6 @@ IF(BUILD_ORT)
307295
FILES_MATCHING PATTERN ${LIB_PATTERN})
308296
ENDIF()
309297

310-
#----------------------------------------------------------------------------------------------
311-
312-
IF (APPLE)
313-
INSTALL(DIRECTORY ${depsAbs}/mkl/lib DESTINATION ${installAbs}/backends/redisai_torch
314-
FILES_MATCHING PATTERN ${LIB_PATTERN})
315-
ENDIF()
316-
317-
#----------------------------------------------------------------------------------------------
318298

319299
IF (NOT ${installAbs} STREQUAL ${CMAKE_SOURCE_DIR}/install-${DEVICE})
320300
INSTALL_SYMLINK(${installAbs} ${CMAKE_SOURCE_DIR}/install-${DEVICE})

commands.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"since": "1.2.5",
6868
"group": "tensor"
6969
},
70-
"AI.MODELSETORE":
70+
"AI.MODELSTORE":
7171
{
7272
"summary": "stores a model as the value of a key",
7373
"complexity": "O(1)",

docs/commands.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ def addtwo(tensors: List[Tensor], keys: List[str], args: List[str]):
522522
It can be stored as a RedisAI script using the CPU device with [`redis-cli`](https://redis.io/topics/rediscli) as follows:
523523

524524
```
525-
$ cat addtwo.py | redis-cli -x AI.SCRIPTSET myscript CPU TAG myscript:v0.1 ENTRY_POINTS 1 addtwo SOURCE
525+
$ cat addtwo.py | redis-cli -x AI.SCRIPTSTORE myscript CPU TAG myscript:v0.1 ENTRY_POINTS 1 addtwo SOURCE
526526
OK
527527
```
528528

@@ -1144,7 +1144,7 @@ The **AI.CONFIG** command sets the value of configuration directives at run-time
11441144

11451145
**Redis API**
11461146
```
1147-
AI.CONFIG <BACKENDSPATH <path>> | <LOADBACKEND <backend> <path>> | <MODEL_CHUNK_SIZE <chunk_size>>
1147+
AI.CONFIG <BACKENDSPATH <path>> | <LOADBACKEND <backend> <path>> | <MODEL_CHUNK_SIZE <chunk_size>> | <GET <BACKENDSPATH | MODEL_CHUNK_SIZE>>
11481148
```
11491149

11501150
_Arguments_
@@ -1156,6 +1156,7 @@ _Arguments_
11561156
* **TORCH**: The PyTorch backend
11571157
* **ONNX**: ONNXRuntime backend
11581158
* **MODEL_CHUNK_SIZE**: Sets the size of chunks (in bytes) in which model payloads are split for serialization, replication and `MODELGET`. Default is `511 * 1024 * 1024`.
1159+
* **GET**: Retrieve the current value of the `BACKENDSPATH / MODEL_CHUNK_SIZE` configurations. Note that additional information about the module's runtime configuration can be retrieved as part of Redis' info report via `INFO MODULES` command.
11591160

11601161
_Return_
11611162

@@ -1190,3 +1191,10 @@ This sets model chunk size to one megabyte (not recommended):
11901191
redis> AI.CONFIG MODEL_CHUNK_SIZE 1048576
11911192
OK
11921193
```
1194+
1195+
This returns the current model chunk size configuration:
1196+
1197+
```
1198+
redis> AI.CONFIG GET MODEL_CHUNK_SIZE
1199+
1048576
1200+
```

docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
mkdocs==1.2.3
1+
mkdocs==1.2.4
22
mkdocs-material==6.2.2
33
-e git+https://github.com/RedisLabs/mkdocs-versions-menu.git#egg=mkdocs-versions-menu
44
-e git+https://github.com/RedisLabs/mkdocs-include.git#egg=mkdocs-include

get_deps.sh

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
###### SET VERSIONS ######
44

5-
ORT_VERSION="1.9.0"
5+
ORT_VERSION="1.11.1"
66
DLPACK_VERSION="v0.5_RAI"
7-
TF_VERSION="2.6.0"
7+
TF_VERSION="2.8.0"
88
TFLITE_VERSION="2.0.0"
9-
PT_VERSION="1.10.1"
9+
PT_VERSION="1.11.0"
1010

1111
###### END VERSIONS ######
1212

@@ -144,8 +144,16 @@ if [[ $OS == linux ]]; then
144144
else
145145
echo "Only x64 is supported currently"
146146
fi
147-
else
148-
echo "Only Linux OS is supported currently"
147+
elif [[ $OS == macos ]]; then
148+
TF_OS=darwin
149+
TF_BUILD=cpu
150+
TF_ARCH=x86_64
151+
if [[ $WITH_TF == S3 ]]; then
152+
LIBTF_URL_BASE=https://s3.amazonaws.com/redismodules/tensorflow
153+
else
154+
LIBTF_URL_BASE=https://storage.googleapis.com/tensorflow/libtensorflow
155+
fi
156+
149157
fi
150158

151159
LIBTF_ARCHIVE=libtensorflow-${TF_BUILD}-${TF_OS}-${TF_ARCH}-${TF_VERSION}.tar.gz
@@ -163,11 +171,11 @@ if [[ $OS == linux ]]; then
163171
TFLITE_OS="linux"
164172
if [[ $ARCH == x64 ]]; then
165173
TFLITE_ARCH=x86_64
166-
else
167-
echo "Only x64 is supported currently"
168174
fi
169-
else
170-
echo "Only Linux OS is supported currently"
175+
elif [[ $OS == macos ]]; then
176+
TFLITE_OS=darwin
177+
# TFLITE_BUILD=cpu
178+
TFLITE_ARCH=x86_64
171179
fi
172180

173181
LIBTFLITE_ARCHIVE=libtensorflowlite-${TFLITE_OS}-${TFLITE_ARCH}-${TFLITE_VERSION}.tar.gz
@@ -191,15 +199,17 @@ if [[ $OS == linux ]]; then
191199
else
192200
echo "Only x64 is supported currently"
193201
fi
194-
else
195-
echo "Only Linux OS is supported currently"
202+
LIBTORCH_ARCHIVE=libtorch-cxx11-abi-shared-with-deps-${PT_VERSION}%2B${PT_BUILD}.zip
203+
204+
elif [[ $OS == macos ]]; then
205+
PT_OS=macos
206+
PT_ARCH=x86_64
207+
PT_BUILD=cpu
208+
PT_REPACK=1
209+
LIBTORCH_ARCHIVE=libtorch-macos-${PT_VERSION}.zip
196210
fi
197211

198-
if [[ $GPU != 1 ]]; then
199-
LIBTORCH_ARCHIVE=libtorch-cxx11-abi-shared-with-deps-${PT_VERSION}%2B${PT_BUILD}.zip
200-
else
201-
LIBTORCH_ARCHIVE=libtorch-cxx11-abi-shared-with-deps-${PT_VERSION}%2B${PT_BUILD}.zip
202-
fi
212+
203213
LIBTORCH_URL=https://download.pytorch.org/libtorch/$PT_BUILD/$LIBTORCH_ARCHIVE
204214

205215
if [[ $WITH_PT != 0 ]]; then
@@ -222,8 +232,11 @@ if [[ $OS == linux ]]; then
222232
else
223233
echo "Only x64 is supported currently"
224234
fi
225-
else
226-
echo "Only Linux OS is supported currently"
235+
elif [[ $OS == macos ]]; then
236+
ORT_OS=osx
237+
ORT_ARCH=x64
238+
ORT_BUILD=""
239+
ORT_URL_BASE=https://github.com/microsoft/onnxruntime/releases/download/v${ORT_VERSION}
227240
fi
228241

229242
ORT_ARCHIVE=onnxruntime-${ORT_OS}-${ORT_ARCH}${ORT_BUILD}-${ORT_VERSION}.tgz

opt/build/docker/dockerfile.tmpl

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,19 @@ RUN echo "Building for {{REDIS_OSNICK}} ({{REDIS_OS}}) for {{REDIS_ARCH}} [with
2424
{% include "templates/gpu.yml" %}
2525
{% endif %}
2626

27+
# centos8 specific integration until a move to rocky or similar
28+
{% if REDIS_OSNICK == "centos8" %}
29+
RUN cd /etc/yum.repos.d/
30+
RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
31+
RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
32+
{% endif %}
33+
2734
WORKDIR /build
2835
COPY --from=redis /usr/local/ /usr/local/
2936

3037
COPY ./opt/ opt/
3138
ADD ./tests/flow/ tests/flow/
3239

33-
RUN ./opt/readies/bin/getupdates
3440
RUN if [ ! -z $(command -v apt-get) ]; then apt-get -qq update; apt-get -q install -y git; fi
3541
RUN if [ ! -z $(command -v yum) ]; then yum install -y git; fi
3642
RUN FORCE=1 ./opt/readies/bin/getpy3
@@ -69,6 +75,12 @@ FROM redisfab/redis:{{REDIS_VERSION}}-{{REDIS_ARCH}}-{{REDIS_OSNICK}}
6975
{% endif %}
7076

7177
ARG PACK
78+
# centos8 specific integration until a move to rocky or similar
79+
{% if REDIS_OSNICK == "centos8" %}
80+
RUN cd /etc/yum.repos.d/
81+
RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
82+
RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
83+
{% endif %}
7284

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

opt/build/onnxruntime/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
REDIS_ONNX_VERSION?=1.9.0
1+
REDIS_ONNX_VERSION?=1.11.1
22
REDIS_ONNX_REPO?=https://github.com/microsoft/onnxruntime
33

44
PRODUCT=onnxruntime
55
VERSION=${REDIS_ONNX_VERSION}
6-
REDIS_CUDA_VERSION=11.0-cudnn8
6+
REDIS_CUDA_VERSION=11.3.1-cudnn8
77

88
# anything prefixed with REDIS, and exported is available in the docker build
99
export REDIS_ONNX_VERSION
1010
export REDIS_ONNX_REPO
1111
export REDIS_CUDA_VERSION
1212

13-
OSNICK=xenial
13+
OSNICK=bionic
1414

1515
ROOT=.
1616
READIES=${ROOT}/../../readies

opt/build/onnxruntime/dockerfile.tmpl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
{% if REDIS_OSNICK == "xenial" %}
2-
{% set cuda_suffix_os = "ubuntu16.04" %}
3-
{% elif REDIS_OSNICK == "bionic" %}
1+
{% if REDIS_OSNICK == "bionic" %}
42
{% set cuda_suffix_os = "ubuntu18.04" %}
53
{% endif %}
64

@@ -12,9 +10,7 @@ FROM nvcr.io/nvidia/deepstream-l4t:5.1-21.02-base
1210
{% if REDIS_GPU is defined %}
1311
FROM nvidia/cuda:{{REDIS_CUDA_VERSION}}-devel-{{cuda_suffix_os}}
1412
{% else %}
15-
{% if REDIS_OSNICK == "xenial" %}
16-
FROM ubuntu:xenial
17-
{% elif REDIS_OSNICK == "bionic" %}
13+
{% if REDIS_OSNICK == "bionic" %}
1814
FROM ubuntu:bionic
1915
{% endif %}
2016
{% endif %}

opt/redis_valgrind.sup

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,4 +184,11 @@
184184
...
185185
fun:_dl_catch_exception
186186
...
187-
}
187+
}
188+
189+
{
190+
<ignore_torch_cond_jump>
191+
Memcheck:Cond
192+
...
193+
obj:*/libtorch_cpu.so*
194+
}

opt/system-setup.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ def debian_compat(self):
3434

3535
def redhat_compat(self):
3636
self.run("%s/bin/enable-utf8" % READIES)
37-
self.run("%s/bin/getepel" % READIES)
37+
self.install("epel-release")
38+
if self.osnick == "centos8":
39+
self.run("dnf install -qy dnf-plugins-core")
40+
self.run("dnf config-manager -qy --set-enabled powertools")
3841
self.install("redhat-lsb-core")
3942

4043
self.run("%s/bin/getgcc --modern" % READIES)
@@ -71,9 +74,7 @@ def common_last(self):
7174
else:
7275
self.run("%s/bin/getcmake" % READIES)
7376

74-
self.run("{PYTHON} {READIES}/bin/getrmpytools".format(PYTHON=self.python, READIES=READIES))
75-
76-
self.pip_install("-r %s/tests/flow/tests_setup/test_requirements.txt" % ROOT)
77+
self.pip_install("--ignore-installed PyYAML -r %s/tests/flow/tests_setup/test_requirements.txt" % ROOT)
7778

7879
self.pip_install("awscli")
7980
self.pip_install("mkdocs mkdocs-material mkdocs-extensions")

ramp.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ capabilities:
1818
- clustering
1919
- backup_restore
2020
- intershard_tls
21+
- intershard_tls_pass
2122
exclude_commands:
2223
- ai.modelstore
2324
- ai.modelset

0 commit comments

Comments
 (0)