45

GitHub - RedisAI/RedisAI: A Redis module for serving tensors and executing deep...

 5 years ago
source link: https://github.com/RedisAI/RedisAI
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md

license GitHub issues CircleCI

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.

Building

This will checkout and build Redis and download the libraries for the backends (TensorFlow and PyTorch) for your platform.

mkdir deps
DEPS_DIRECTORY=deps bash get_deps.sh

cd deps
git clone git://github.com/antirez/redis.git --branch 5.0
cd redis
make malloc=libc -j4
cd ../..

mkdir build
cd build
cmake -DDEPS_PATH=../deps/install ..
make
cd ..

Docker

To quickly tryout RedisAI, launch an instance using docker:

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

Running the server

On Linux

LD_LIBRARY_PATH=deps/install/lib deps/redis/src/redis-server --loadmodule build/redisai.so

On macos

deps/redis/src/redis-server --loadmodule build/redisai.so

On the client, load the model

./deps/redis/src/redis-cli -x AI.MODELSET foo TF CPU INPUTS a b OUTPUTS c < 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"

Documentation

Read the docs at redisai.io.

Mailing List

RedisAI Google group

License

AGPL-3.0 https://opensource.org/licenses/AGPL-3.0

Copyright 2019, Orobix Srl & Redis Labs


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK