Skip to content

Instantly share code, notes, and snippets.

@lantiga
Last active May 5, 2020 08:23
Show Gist options
  • Select an option

  • Save lantiga/315ab6e10f010e908d8e4eb4c63505d1 to your computer and use it in GitHub Desktop.

Select an option

Save lantiga/315ab6e10f010e908d8e4eb4c63505d1 to your computer and use it in GitHub Desktop.

Revisions

  1. lantiga revised this gist May 5, 2020. No changes.
  2. lantiga revised this gist May 5, 2020. 1 changed file with 11 additions and 2 deletions.
    13 changes: 11 additions & 2 deletions build_redisai.sh
    Original file line number Diff line number Diff line change
    @@ -16,12 +16,21 @@ mkdir deps/linux-x64-cpu/libtorch
    cd deps/linux-x64-cpu/libtorch

    # https://forums.developer.nvidia.com/t/pytorch-for-jetson-nano-version-1-5-0-now-available/72048
    wget https://nvidia.box.com/shared/static/phqe92v26cbhqjohwtvxorrwnmrnfx1o.whl -O torch-1.3.0-cp36-cp36m-linux_aarch64.whl
    # wget https://nvidia.box.com/shared/static/phqe92v26cbhqjohwtvxorrwnmrnfx1o.whl -O torch-1.3.0-cp36-cp36m-linux_aarch64.whl

    # unzip torch-1.3.0-cp36-cp36m-linux_aarch64.whl
    # mv torch/* .

    #wget https://nvidia.box.com/shared/static/ncgzus5o23uck9i5oth2n8n06k340l6k.whl -O torch-1.4.0-cp36-cp36m-linux_aarch64.whl
    # sudo apt install -y libopenblas-base

    unzip torch-1.3.0-cp36-cp36m-linux_aarch64.whl
    # unzip torch-1.4.0-cp36-cp36m-linux_aarch64.whl
    # mv torch/* .

    wget https://nvidia.box.com/shared/static/3ibazbiwtkl181n95n9em3wtrca7tdzp.whl -O torch-1.5.0-cp36-cp36m-linux_aarch64.whl
    sudo apt install -y libopenblas-base

    unzip torch-1.5.0-cp36-cp36m-linux_aarch64.whl
    mv torch/* .

    cd -
  3. lantiga revised this gist May 5, 2020. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions build_redisai.sh
    Original file line number Diff line number Diff line change
    @@ -15,6 +15,7 @@ mkdir deps/linux-x64-cpu/libtorch

    cd deps/linux-x64-cpu/libtorch

    # https://forums.developer.nvidia.com/t/pytorch-for-jetson-nano-version-1-5-0-now-available/72048
    wget https://nvidia.box.com/shared/static/phqe92v26cbhqjohwtvxorrwnmrnfx1o.whl -O torch-1.3.0-cp36-cp36m-linux_aarch64.whl

    #wget https://nvidia.box.com/shared/static/ncgzus5o23uck9i5oth2n8n06k340l6k.whl -O torch-1.4.0-cp36-cp36m-linux_aarch64.whl
  4. lantiga revised this gist Feb 26, 2020. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions build_redisai.sh
    Original file line number Diff line number Diff line change
    @@ -17,6 +17,9 @@ cd deps/linux-x64-cpu/libtorch

    wget https://nvidia.box.com/shared/static/phqe92v26cbhqjohwtvxorrwnmrnfx1o.whl -O torch-1.3.0-cp36-cp36m-linux_aarch64.whl

    #wget https://nvidia.box.com/shared/static/ncgzus5o23uck9i5oth2n8n06k340l6k.whl -O torch-1.4.0-cp36-cp36m-linux_aarch64.whl
    # sudo apt install -y libopenblas-base

    unzip torch-1.3.0-cp36-cp36m-linux_aarch64.whl
    mv torch/* .

  5. lantiga revised this gist Feb 14, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion test_redisai.sh
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@

    set -x

    redis-cli -x AI.MODELSET m TORCH GPU < /test/test_data/pt-minimal.pt
    redis-cli -x AI.MODELSET m TORCH GPU < ./test/test_data/pt-minimal.pt

    redis-cli AI.TENSORSET a FLOAT 2 2 VALUES 2 3 2 3
    redis-cli AI.TENSORSET b FLOAT 2 2 VALUES 2 3 2 3
  6. lantiga revised this gist Feb 14, 2020. 2 changed files with 9 additions and 1 deletion.
    5 changes: 5 additions & 0 deletions run_redisai_torch.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    # Put this script inside RedisAi main folder.
    # Run with 'bash run_redisai_torch.sh'.
    # Before running check that the script is executable 'chmod 755 run_redisai_torch.sh'

    redis-server --loadmodule install-cpu/redisai.so
    5 changes: 4 additions & 1 deletion test_redisai.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,9 @@
    # Put this script inside RedisAi main folder.
    # Run only after you started a redisai server (view run_redisai_torch.sh).

    set -x

    redis-cli -x AI.MODELSET m TORCH GPU < RedisAI/test/test_data/pt-minimal.pt
    redis-cli -x AI.MODELSET m TORCH GPU < /test/test_data/pt-minimal.pt

    redis-cli AI.TENSORSET a FLOAT 2 2 VALUES 2 3 2 3
    redis-cli AI.TENSORSET b FLOAT 2 2 VALUES 2 3 2 3
  7. lantiga revised this gist Feb 13, 2020. No changes.
  8. lantiga created this gist Feb 13, 2020.
    29 changes: 29 additions & 0 deletions build_redisai.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    sudo apt update
    sudo apt install -y git build-essential ninja-build cmake python3-pip python3-cffi redis unzip wget

    git clone https://github.com/RedisAI/RedisAI.git

    cd RedisAI

    mkdir build

    WITH_PT=0 WITH_TF=0 WITH_TFLITE=0 WITH_ORT=0 bash get_deps.sh

    mv deps/linux-arm64v8-cpu deps/linux-x64-cpu

    mkdir deps/linux-x64-cpu/libtorch

    cd deps/linux-x64-cpu/libtorch

    wget https://nvidia.box.com/shared/static/phqe92v26cbhqjohwtvxorrwnmrnfx1o.whl -O torch-1.3.0-cp36-cp36m-linux_aarch64.whl

    unzip torch-1.3.0-cp36-cp36m-linux_aarch64.whl
    mv torch/* .

    cd -

    cd build

    cmake -DBUILD_TF=OFF -DBUILD_TFLITE=OFF -DBUILD_TORCH=ON -DBUILD_ORT=OFF -DCMAKE_BUILD_TYPE=Release ../

    make -j4 && make install
    10 changes: 10 additions & 0 deletions test_redisai.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    set -x

    redis-cli -x AI.MODELSET m TORCH GPU < RedisAI/test/test_data/pt-minimal.pt

    redis-cli AI.TENSORSET a FLOAT 2 2 VALUES 2 3 2 3
    redis-cli AI.TENSORSET b FLOAT 2 2 VALUES 2 3 2 3

    redis-cli AI.MODELRUN m INPUTS a b OUTPUTS c

    redis-cli AI.TENSORGET c VALUES