RedisAI

A Redis module for serving tensors and executing deep learning graphs

Github星跟踪图

GitHub issues
CircleCI
Docker Cloud Build Status
Mailing List
Gitter

RedisAI

A Redis module for serving tensors and executing deep learning models.
Expect changes in the API and internals.

Cloning

If you want to run examples, make sure you have git-lfs installed when you clone.

Quickstart

  1. Docker
  2. Build

Docker

To quickly tryout RedisAI, launch an instance using docker:

docker run -p 6379:6379 -it --rm redisai/redisai

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

docker run -p 6379:6379 --gpus all -it --rm redisai/redisai:latest-gpu

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

docker build -f Dockerfile-gpu -t redisai-gpu .
docker run -p 6379:6379 --gpus all -it --rm redisai-gpu

Note that Redis config is located at /usr/local/etc/redis/redis.conf which can be overridden with a volume mount

Give it a try

On the client, set the model

redis-cli -x AI.MODELSET foo TF CPU INPUTS a b OUTPUTS c < test/test_data/graph.pb

Then create the input tensors, run the computation graph and get the output tensor (see load_model.sh). Note the signatures:

  • AI.TENSORSET tensor_key data_type dim1..dimN [BLOB data, VALUES val1..valN]
  • AI.MODELRUN graph_key INPUTS input_key1 ... OUTPUTS output_key1 ...
redis-cli
> AI.TENSORSET bar FLOAT 2 VALUES 2 3
> AI.TENSORSET baz FLOAT 2 VALUES 2 3
> AI.MODELRUN foo INPUTS bar baz OUTPUTS jez
> AI.TENSORGET jez VALUES
1) FLOAT
2) 1) (integer) 2
3) 1) "4"
   2) "9"

Building

This will checkout and build and download the libraries for the backends (TensorFlow, PyTorch, ONNXRuntime) for your platform. Note that this requires CUDA 10.0 to be installed.

bash get_deps.sh

Alternatively, run the following to only fetch the CPU-only backends even on GPU machines.

bash get_deps.sh cpu

Once the dependencies are downloaded, build the module itself. Note that
CMake 3.0 or higher is required.

mkdir build
cd build
cmake ..
make && make install
cd ..

Note: in order to use the PyTorch backend on Linux, at least gcc 4.9.2 is required.

Running the server

You will need a redis-server version 4.0.9 or greater. This should be
available in most recent distributions:

redis-server --version
Redis server v=4.0.9 sha=00000000:0 malloc=libc bits=64 build=c49f4faf7c3c647a

To start Redis with the RedisAI module loaded:

redis-server --loadmodule install-cpu/redisai.so

Client libraries

Some languages have client libraries that provide support for RedisAI's commands:, Project, Language, License, Author, URL, -------, --------, -------, ------, ---, JRedisAI, Java, BSD-3, RedisLabs, Github, redisai-py, Python, BSD-3, RedisLabs, Github, redisai-go, Go, BSD-3, RedisLabs, Github, ## Backend Dependancy

RedisAI currently supports PyTorch (libtorch), Tensorflow (libtensorflow), TensorFlow Lite, and ONNXRuntime as backends. This section shows the version map between RedisAI and supported backends. This extremely important since the serialization mechanism of one version might not match with another. For making sure your model will work with a given RedisAI version, check with the backend documentation about incompatible features between the version of your backend and the version RedisAI is built with., RedisAI, PyTorch, TensorFlow, TFLite, ONNXRuntime, :--------, :-------:, :----------:, :------:, :-------------:, 0.1.0, 1.0.1, 1.12.0, None, None, 0.2.1, 1.0.1, 1.12.0, None, None, 0.3.1, 1.1.0, 1.12.0, None, 0.4.0, 0.4.0, 1.2.0, 1.14.0, None, 0.5.0, master, 1.3.1, 1.14.0, 2.0.0, 1.0.0, ## Documentation

Read the docs at redisai.io. Checkout our showcase repo for a lot of examples written using different client libraries.

Mailing List

RedisAI Google group

License

Redis Source Available License Agreement - see LICENSE

Copyright 2019, Tensorwerk Inc & Redis Labs Ltd

主要指标

概览
名称与所有者RedisAI/redis-inference-optimization
主编程语言C
编程语言Shell (语言数: 6)
平台
许可证Other
所有者活动
创建于2016-09-18 14:59:36
推送于2025-02-18 09:06:37
最后一次提交2025-02-18 10:06:37
发布数23
最新版本名称v1.2.7 (发布于 )
第一版名称0.1.0-alpha1 (发布于 )
用户参与
星数830
关注者数28
派生数105
提交数1.5k
已启用问题?
问题数320
打开的问题数87
拉请求数544
打开的拉请求数15
关闭的拉请求数77
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?