Skip to content

Commit 5c16c29

Browse files
DvirDukhanchayimalonre24
authored
V1.2.6 (#895)
* Merge pull request #892 from RedisAI/tflite_avoid_magic_numbers avoid magic numbers in tflite * Merge pull request #891 from RedisAI/validate_runqueue_upon_restart create runqueue upon model and script loading * Merge pull request #888 from RedisAI/pytorch_1_10 updated pytorch and cuda version * Removed Xenial (#893) * Merge pull request #894 from RedisAI/set_cluster_timeout_on_env_reset added 120 seconds timeout for env restart and reload * Fix device name validation in "modelstore" command (#884) * 1.2.6 version bump Co-authored-by: Chayim <[email protected]> Co-authored-by: alonre24 <[email protected]>
1 parent 43d16c9 commit 5c16c29

File tree

18 files changed

+243
-180
lines changed

18 files changed

+243
-180
lines changed

.circleci/config.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,6 @@ workflows:
591591
matrix:
592592
parameters:
593593
osnick:
594-
- xenial
595594
- bionic
596595
- centos8
597596
lite:
@@ -605,7 +604,6 @@ workflows:
605604
matrix:
606605
parameters:
607606
osnick:
608-
- xenial
609607
- bionic
610608
- centos8
611609
lite:

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ docker run -p 6379:6379 redislabs/redisai:latest-cpu-x64-bionic
2424
```
2525

2626
### On a GPU machine
27-
For GPU support you will need a machine you'll need a machine that has Nvidia driver (CUDA 11.2 and cuDNN 8.1), nvidia-container-toolkit and Docker 19.03+ installed. For detailed information, checkout [nvidia-docker documentation](https://github.com/NVIDIA/nvidia-docker)
27+
For GPU support you will need a machine you'll need a machine that has Nvidia driver (CUDA 11.3 and cuDNN 8.1), nvidia-container-toolkit and Docker 19.03+ installed. For detailed information, checkout [nvidia-docker documentation](https://github.com/NVIDIA/nvidia-docker)
2828

2929
```
3030
docker run -p 6379:6379 --gpus all -it --rm redislabs/redisai:latest-gpu-x64-bionic
@@ -37,7 +37,7 @@ You can compile and build the module from its source code. The [Developer](https
3737
### Prerequisites
3838
* Packages: git, python3, make, wget, g++/clang, & unzip
3939
* CMake 3.0 or higher needs to be installed.
40-
* CUDA 11.2 and cuDNN 8.1 or higher needs to be installed if GPU support is required.
40+
* CUDA 11.3 and cuDNN 8.1 or higher needs to be installed if GPU support is required.
4141
* Redis v6.0.0 or greater.
4242

4343
### Get the Source Code
@@ -90,7 +90,7 @@ RedisAI currently supports PyTorch (libtorch), Tensorflow (libtensorflow), Tenso
9090
|:--------|:-------:|:----------:|:------:|:-------------:|
9191
| 1.0.3 | 1.5.0 | 1.15.0 | 2.0.0 | 1.2.0 |
9292
| 1.2.5 | 1.9.0 | 2.6.0 | 2.0.0 | 1.9.0 |
93-
| master | 1.9.0 | 2.6.0 | 2.0.0 | 1.9.0 |
93+
| master | 1.10.1 | 2.6.0 | 2.0.0 | 1.9.0 |
9494

9595
Note: Keras and TensorFlow 2.x are supported through graph freezing. See [this script](https://github.com/RedisAI/RedisAI/blob/master/tests/flow/test_data/tf2-minimal.py) to see how to export a frozen graph from Keras and TensorFlow 2.x.
9696

get_deps.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ORT_VERSION="1.9.0"
66
DLPACK_VERSION="v0.5_RAI"
77
TF_VERSION="2.6.0"
88
TFLITE_VERSION="2.0.0"
9-
PT_VERSION="1.9.0"
9+
PT_VERSION="1.10.1"
1010

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

@@ -184,7 +184,7 @@ PT_BUILD=cpu
184184
if [[ $OS == linux ]]; then
185185
PT_OS=linux
186186
if [[ $GPU == 1 ]]; then
187-
PT_BUILD=cu111
187+
PT_BUILD=cu113
188188
fi
189189
if [[ $ARCH == x64 ]]; then
190190
PT_ARCH=x86_64

opt/build/docker/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
PRODUCT=redisai
33
DOCKER_ORG=redislabs
44
REDIS_VERSION=6.2.5
5-
REDIS_CUDA_VERSION=11.2.2-cudnn8
5+
REDIS_CUDA_VERSION=11.3.1-cudnn8
66
REDISAI_LITE=0
77

88
PACK=1 # to fetch the artifacts

opt/build/dockerparts/apt.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ RUN add-apt-repository ppa:ubuntu-toolchain-r/test
99
RUN apt-get update -qq
1010
RUN DEBIAN_NONINTERACTIVE=1 apt-get install -y curl wget tar git patch \
1111
build-essential libcurl4-openssl-dev libssl-dev libatlas-base-dev zlib1g-dev \
12-
python3.7 python3-pip python3-dev python3-numpy \
12+
python3.7 python3-pip python3-dev \
1313
gcc-7 g++-7
1414

1515
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 60

opt/system-setup.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,9 @@ def common_first(self):
2727
def debian_compat(self):
2828
self.run("%s/bin/enable-utf8" % READIES)
2929
self.run("%s/bin/getgcc" % READIES)
30-
self.install("gawk")
31-
self.install("libssl-dev")
32-
self.install("python3-regex")
33-
self.install("python3-networkx python3-numpy")
30+
self.install("gawk libssl-dev python3-regex python3-networkx libmpich-dev libopenblas-dev")
3431
if self.platform.is_arm():
3532
self.install("python3-dev") # python3-skimage
36-
self.install("libmpich-dev libopenblas-dev") # for libtorch
3733
self.install_git_lfs_on_linux()
3834

3935
def redhat_compat(self):

src/backends/util.c

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
1+
#include <stdlib.h>
2+
#include <errno.h>
13
#include "backends/util.h"
24

3-
int parseDeviceStr(const char *devicestr, RAI_Device *device, int64_t *deviceid) {
4-
// if (strcasecmp(devicestr, "CPU") == 0) {
5-
if (strncasecmp(devicestr, "CPU", 3) == 0) {
5+
int parseDeviceStr(const char *device_str, RAI_Device *device, int64_t *device_id) {
6+
if (strncasecmp(device_str, "CPU", 3) == 0) {
67
*device = RAI_DEVICE_CPU;
7-
*deviceid = -1;
8-
} else if (strcasecmp(devicestr, "GPU") == 0) {
8+
*device_id = -1;
9+
} else if (strcasecmp(device_str, "GPU") == 0) {
910
*device = RAI_DEVICE_GPU;
10-
*deviceid = -1;
11-
} else if (strncasecmp(devicestr, "GPU:", 4) == 0) {
11+
*device_id = -1;
12+
} else if (strncasecmp(device_str, "GPU:", 4) == 0) {
1213
*device = RAI_DEVICE_GPU;
13-
long long id;
14-
sscanf(devicestr, "GPU:%lld", &id);
15-
*deviceid = id;
14+
// Convert the id string into a number, returns zero if no valid conversion could be
15+
// preformed, and sets errno in case of overflow.
16+
long long id = strtoll(device_str + 4, NULL, 0);
17+
if (errno == ERANGE)
18+
return 0;
19+
*device_id = id;
1620
} else {
1721
return 0;
1822
}
19-
2023
return 1;
2124
}

src/backends/util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66

77
#include "config/config.h"
88

9-
int parseDeviceStr(const char *devicestr, RAI_Device *device, int64_t *deviceid);
9+
int parseDeviceStr(const char *device_str, RAI_Device *device, int64_t *device_id);

src/redisai.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,14 @@ int RedisAI_ModelStore_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **arg
173173
const char *devicestr;
174174
AC_GetString(&ac, &devicestr, NULL, 0);
175175
bool valid_device = false;
176+
size_t device_prefix_len = strlen("GPU:"); // can also be "CPU:"
176177
if (strcasecmp(devicestr, "CPU") == 0 || strcasecmp(devicestr, "GPU") == 0) {
177178
valid_device = true;
178-
} else if ((strncasecmp(devicestr, "GPU:", 4) == 0 || strncasecmp(devicestr, "CPU:", 4) == 0) &&
179-
strlen(devicestr) <= 10) {
179+
} else if ((strncasecmp(devicestr, "GPU:", device_prefix_len) == 0 ||
180+
strncasecmp(devicestr, "CPU:", device_prefix_len) == 0) &&
181+
strlen(devicestr) < 10) {
180182
bool digits_only = true;
181-
for (size_t i = 5; i < strlen(devicestr); i++) {
183+
for (size_t i = device_prefix_len; i < strlen(devicestr); i++) {
182184
if (devicestr[i] < '0' || devicestr[i] > '9') {
183185
digits_only = false;
184186
break;

src/serialization/RDB/decoder/previous/v0/decode_v0.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "decode_v0.h"
22
#include "assert.h"
3+
#include "execution/run_queue_info.h"
34

45
void *RAI_RDBLoadTensor_v0(RedisModuleIO *io) {
56
DLDevice device;
@@ -138,6 +139,10 @@ void *RAI_RDBLoadModel_v0(RedisModuleIO *io) {
138139
RedisModule_FreeString(NULL, stats_keystr);
139140
RedisModule_FreeString(NULL, tag);
140141

142+
if (!RunQueue_IsExists(model->devicestr)) {
143+
RunQueue_Create(model->devicestr);
144+
}
145+
141146
return model;
142147

143148
cleanup:
@@ -215,6 +220,10 @@ void *RAI_RDBLoadScript_v0(RedisModuleIO *io) {
215220
RedisModule_Free(devicestr);
216221
RedisModule_Free(scriptdef);
217222

223+
if (!RunQueue_IsExists(script->devicestr)) {
224+
RunQueue_Create(script->devicestr);
225+
}
226+
218227
return script;
219228
cleanup:
220229
if (devicestr)

src/serialization/RDB/decoder/previous/v1/decode_v1.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "decode_v1.h"
22
#include "../v0/decode_v0.h"
3+
#include "execution/run_queue_info.h"
34

45
/**
56
* In case of IO errors, the default return values are:
@@ -114,6 +115,10 @@ void *RAI_RDBLoadModel_v1(RedisModuleIO *io) {
114115
RedisModule_FreeString(NULL, stats_keystr);
115116
RedisModule_FreeString(NULL, tag);
116117

118+
if (!RunQueue_IsExists(model->devicestr)) {
119+
RunQueue_Create(model->devicestr);
120+
}
121+
117122
return model;
118123

119124
cleanup:
@@ -187,6 +192,11 @@ void *RAI_RDBLoadScript_v1(RedisModuleIO *io) {
187192
RedisModule_FreeString(NULL, tag);
188193
RedisModule_Free(devicestr);
189194
RedisModule_Free(scriptdef);
195+
196+
if (!RunQueue_IsExists(script->devicestr)) {
197+
RunQueue_Create(script->devicestr);
198+
}
199+
190200
return script;
191201
cleanup:
192202
if (devicestr)

src/serialization/RDB/decoder/previous/v2/decode_v2.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "decode_v2.h"
22
#include "../v0/decode_v0.h"
3+
#include "execution/run_queue_info.h"
34

45
/**
56
* In case of IO errors, the default return values are:
@@ -116,6 +117,10 @@ void *RAI_RDBLoadModel_v2(RedisModuleIO *io) {
116117
RedisModule_FreeString(NULL, stats_keystr);
117118
RedisModule_FreeString(NULL, tag);
118119

120+
if (!RunQueue_IsExists(model->devicestr)) {
121+
RunQueue_Create(model->devicestr);
122+
}
123+
119124
return model;
120125

121126
cleanup:
@@ -189,6 +194,10 @@ void *RAI_RDBLoadScript_v2(RedisModuleIO *io) {
189194
RedisModule_FreeString(NULL, tag);
190195
RedisModule_Free(devicestr);
191196
RedisModule_Free(scriptdef);
197+
198+
if (!RunQueue_IsExists(script->devicestr)) {
199+
RunQueue_Create(script->devicestr);
200+
}
192201
return script;
193202
cleanup:
194203
if (devicestr)

src/serialization/RDB/decoder/previous/v3/decode_v3.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "decode_v3.h"
22
#include "../v0/decode_v0.h"
3+
#include "execution/run_queue_info.h"
34

45
/**
56
* In case of IO errors, the default return values are:
@@ -116,6 +117,10 @@ void *RAI_RDBLoadModel_v3(RedisModuleIO *io) {
116117
RedisModule_FreeString(NULL, stats_keystr);
117118
RedisModule_FreeString(NULL, tag);
118119

120+
if (!RunQueue_IsExists(model->devicestr)) {
121+
RunQueue_Create(model->devicestr);
122+
}
123+
119124
return model;
120125

121126
cleanup:
@@ -208,6 +213,11 @@ void *RAI_RDBLoadScript_v3(RedisModuleIO *io) {
208213
RedisModule_Free(entryPoints[i]);
209214
}
210215
array_free(entryPoints);
216+
217+
if (!RunQueue_IsExists(script->devicestr)) {
218+
RunQueue_Create(script->devicestr);
219+
}
220+
211221
return script;
212222
cleanup:
213223
if (devicestr)

src/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#define REDISAI_VERSION_MAJOR 1
44
#define REDISAI_VERSION_MINOR 2
5-
#define REDISAI_VERSION_PATCH 5
5+
#define REDISAI_VERSION_PATCH 6
66

77
#define REDISAI_MODULE_VERSION \
88
(REDISAI_VERSION_MAJOR * 10000 + REDISAI_VERSION_MINOR * 100 + REDISAI_VERSION_PATCH)

0 commit comments

Comments
 (0)