From ba34a0a42bcd144fa5f525226c88c66f617f8b46 Mon Sep 17 00:00:00 2001 From: Qing Lan Date: Sun, 24 Apr 2022 11:56:13 -0700 Subject: [PATCH 1/2] add 2.2.2 --- .../paddlepaddle/paddlepaddle-native/build.cmd | 4 ++-- .../paddlepaddle-native/build.gradle | 12 ++++++------ .../paddlepaddle/paddlepaddle-native/build.sh | 16 +++++++++------- gradle.properties | 2 +- 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/engines/paddlepaddle/paddlepaddle-native/build.cmd b/engines/paddlepaddle/paddlepaddle-native/build.cmd index e0dc21154d1..5f3a1a8ae90 100644 --- a/engines/paddlepaddle/paddlepaddle-native/build.cmd +++ b/engines/paddlepaddle/paddlepaddle-native/build.cmd @@ -7,7 +7,7 @@ set FILEPATH="paddle" if "%1" == "cpu" ( - set DOWNLOAD_URL="https://alpha-djl-demos.s3.amazonaws.com/temp/paddle_inference_install_dir-windows-openblas-2.0.2.zip" + set DOWNLOAD_URL="https://paddle-inference-lib.bj.bcebos.com/2.2.2/cxx_c/Windows/CPU/x86-64_vs2017_avx_openblas/paddle_inference.zip" ) if exist %FILEPATH% ( @@ -16,7 +16,7 @@ if exist %FILEPATH% ( echo Couldn't find %FILEPATH%, downloading it ... echo Downloading from: %DOWNLOAD_URL% powershell -Command "(New-Object Net.WebClient).DownloadFile('%DOWNLOAD_URL%', '%cd%\paddle.zip')" - powershell -Command "Expand-Archive -LiteralPath paddle.zip -DestinationPath %cd%" + powershell -Command "Expand-Archive -LiteralPath paddle.zip -DestinationPath %cd%\paddle" rename paddle_inference_install_dir paddle del /f paddle.zip echo Finished downloading paddle diff --git a/engines/paddlepaddle/paddlepaddle-native/build.gradle b/engines/paddlepaddle/paddlepaddle-native/build.gradle index 3b4538c7d19..705204f12fb 100644 --- a/engines/paddlepaddle/paddlepaddle-native/build.gradle +++ b/engines/paddlepaddle/paddlepaddle-native/build.gradle @@ -53,11 +53,11 @@ task prepareNativeLibs() { delete "${buildDir}/native" def files = [ - "cpu/linux" : "https://alpha-djl-demos.s3.amazonaws.com/temp/paddle202/paddle_inference_install_dir-2.0.2-openblas-gcc54-ubuntu.tgz", - "cu101/linux": "https://paddle-inference-lib.bj.bcebos.com/2.0.2-gpu-cuda10.1-cudnn7-avx-mkl/paddle_inference.tgz", - "cu102/linux": "https://paddle-inference-lib.bj.bcebos.com/2.0.2-gpu-cuda10.2-cudnn8-avx-mkl/paddle_inference.tgz", - "cpu/osx" : "https://paddle-inference-lib.bj.bcebos.com/mac/2.0.2/cpu_avx_openblas/paddle_inference.tgz", - "cpu/win" : "https://alpha-djl-demos.s3.amazonaws.com/temp/paddle_inference_install_dir-windows-openblas-2.0.2.zip" + "cpu/linux" : "https://paddle-inference-lib.bj.bcebos.com/2.2.2/cxx_c/Linux/CPU/gcc5.4_avx_openblas/paddle_inference.tgz", + "cu102/linux": "https://paddle-inference-lib.bj.bcebos.com/2.2.2/cxx_c/Linux/GPU/x86-64_gcc5.4_avx_mkl_cuda10.2_cudnn8.1.1_trt7.2.3.4/paddle_inference.tgz", + "cu112/linux": "https://paddle-inference-lib.bj.bcebos.com/2.2.2/cxx_c/Linux/GPU/x86-64_gcc5.4_avx_mkl_cuda11.2_cudnn8.2.1_trt8.0.3.4/paddle_inference.tgz", + "cpu/osx" : "https://paddle-inference-lib.bj.bcebos.com/2.2.2/cxx_c/MacOS/CPU/x86-64_clang_avx_openb/paddle_inference_install_dir.tgz", + "cpu/win" : "https://paddle-inference-lib.bj.bcebos.com/2.2.2/cxx_c/Windows/CPU/x86-64_vs2017_avx_openblas/paddle_inference.zip" ] def downloadDir = file("${buildDir}/download") @@ -119,8 +119,8 @@ task uploadS3 { def f = new File("${buildDir}/native/files.txt") def uploadDirs = [ "${buildDir}/native/cpu/linux/native/lib/", - "${buildDir}/native/cu101/linux/native/lib/", "${buildDir}/native/cu102/linux/native/lib/", + "${buildDir}/native/cu112/linux/native/lib/", "${buildDir}/native/cpu/osx/native/lib/", "${buildDir}/native/cpu/win/native/lib/" ] diff --git a/engines/paddlepaddle/paddlepaddle-native/build.sh b/engines/paddlepaddle/paddlepaddle-native/build.sh index b35510ddf51..b5184500596 100755 --- a/engines/paddlepaddle/paddlepaddle-native/build.sh +++ b/engines/paddlepaddle/paddlepaddle-native/build.sh @@ -14,19 +14,21 @@ pushd $WORK_DIR echo "Trying to find paddle folder..." +# https://www.paddlepaddle.org.cn/inference/v2.2/user_guides/download_lib.html 2.2.2 + if [[ ! -d "paddle" ]]; then echo "Folder not found. Downloading C++ package..." if [[ $PLATFORM == 'linux' ]]; then if [[ $1 == "cpu" ]]; then - curl -s https://alpha-djl-demos.s3.amazonaws.com/temp/paddle202/paddle_inference_install_dir-2.0.2-openblas-gcc54-ubuntu.tgz -o paddle.tgz + curl -s https://paddle-inference-lib.bj.bcebos.com/2.2.2/cxx_c/Linux/CPU/gcc5.4_avx_openblas/paddle_inference.tgz -o paddle.tgz tar -xvzf paddle.tgz - mv paddle_inference_install_dir paddle - elif [[ $1 == "cu101" ]]; then - curl -s https://paddle-inference-lib.bj.bcebos.com/2.0.2-gpu-cuda10.1-cudnn7-avx-mkl/paddle_inference.tgz -o paddle.tgz + mv paddle_inference paddle + elif [[ $1 == "cu102" ]]; then + curl -s https://paddle-inference-lib.bj.bcebos.com/2.2.2/cxx_c/Linux/GPU/x86-64_gcc5.4_avx_mkl_cuda10.2_cudnn7.6.5_trt6.0.1.5/paddle_inference.tgz -o paddle.tgz tar -xvzf paddle.tgz mv paddle_inference paddle - elif [[ $1 == "cu102" ]]; then - curl -s https://paddle-inference-lib.bj.bcebos.com/2.0.2-gpu-cuda10.2-cudnn8-avx-mkl/paddle_inference.tgz -o paddle.tgz + elif [[ $1 == "cu112" ]]; then + curl -s https://paddle-inference-lib.bj.bcebos.com/2.2.2/cxx_c/Linux/GPU/x86-64_gcc5.4_avx_mkl_cuda11.2_cudnn8.2.1_trt8.0.3.4/paddle_inference.tgz -o paddle.tgz tar -xvzf paddle.tgz mv paddle_inference paddle else @@ -34,7 +36,7 @@ if [[ ! -d "paddle" ]]; then exit 1 fi elif [[ $PLATFORM == 'darwin' ]]; then - curl -s https://paddle-inference-lib.bj.bcebos.com/mac/2.0.2/cpu_avx_openblas/paddle_inference.tgz -o paddle.tgz + curl -s https://paddle-inference-lib.bj.bcebos.com/2.2.2/cxx_c/MacOS/CPU/x86-64_clang_avx_openb/paddle_inference_install_dir.tgz -o paddle.tgz tar -xvzf paddle.tgz mv paddle_inference_install_dir paddle else diff --git a/gradle.properties b/gradle.properties index 23f45258eed..2730d34ad4b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,7 +15,7 @@ tflite_version=2.6.2 dlr_version=1.6.0 trt_version=8.0.1 onnxruntime_version=1.10.0 -paddlepaddle_version=2.0.2 +paddlepaddle_version=2.2.2 sentencepiece_version=0.1.95 tokenizers_version=0.11.0 fasttext_version=0.9.2 From 52412464fb64db479a44ad2a030580fc5566a36e Mon Sep 17 00:00:00 2001 From: Qing Lan Date: Mon, 25 Apr 2022 09:30:51 -0700 Subject: [PATCH 2/2] fix document --- .../paddlepaddle-engine/README.md | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/engines/paddlepaddle/paddlepaddle-engine/README.md b/engines/paddlepaddle/paddlepaddle-engine/README.md index e64ce22475b..6e3bae146a8 100644 --- a/engines/paddlepaddle/paddlepaddle-engine/README.md +++ b/engines/paddlepaddle/paddlepaddle-engine/README.md @@ -30,7 +30,7 @@ You can pull the PaddlePaddle engine from the central Maven repository by includ ai.djl.paddlepaddle paddlepaddle-engine - 0.16.0 + 0.17.0 runtime ``` @@ -43,28 +43,28 @@ You can choose a native library based on your platform if you don't have network ### macOS For macOS, you can use the following library: -- ai.djl.paddlepaddle:paddlepaddle-native-cpu:2.0.2:osx-x86_64 +- ai.djl.paddlepaddle:paddlepaddle-native-cpu:2.2.2:osx-x86_64 ```xml ai.djl.paddlepaddle paddlepaddle-native-cpu osx-x86_64 - 2.0.2 + 2.2.2 runtime ``` ### Linux -- ai.djl.paddlepaddle:paddlepaddle-native-cpu:2.0.2:linux-x86_64 +- ai.djl.paddlepaddle:paddlepaddle-native-cpu:2.2.2:linux-x86_64 ```xml ai.djl.paddlepaddle paddlepaddle-native-cpu linux-x86_64 - 2.0.2 + 2.2.2 runtime ``` @@ -74,18 +74,18 @@ For macOS, you can use the following library: To use Linux packages, users are also required to set `LD_LIBRARY_PATH` to the folder: ``` -LD_LIBRARY_PATH=$HOME/.djl.ai/paddle/2.0.2--linux-x86_64 +LD_LIBRARY_PATH=$HOME/.djl.ai/paddle/2.2.2--linux-x86_64 ``` -- ai.djl.paddlepaddle:paddlepaddle-native-cu101:2.0.2:linux-x86_64 - CUDA 10.1 -- ai.djl.paddlepaddle:paddlepaddle-native-cu102:2.0.2:linux-x86_64 - CUDA 10.2 +- ai.djl.paddlepaddle:paddlepaddle-native-cu102:2.2.2:linux-x86_64 - CUDA 10.2 +- ai.djl.paddlepaddle:paddlepaddle-native-cu112:2.2.2:linux-x86_64 - CUDA 11.2 ```xml ai.djl.paddlepaddle - paddlepaddle-native-cu101 + paddlepaddle-native-cu102 linux-x86_64 - 2.0.2 + 2.2.2 runtime ``` @@ -93,9 +93,9 @@ LD_LIBRARY_PATH=$HOME/.djl.ai/paddle/2.0.2--linux-x86_64 ```xml ai.djl.paddlepaddle - paddlepaddle-native-cu102 + paddlepaddle-native-cu112 linux-x86_64 - 2.0.2 + 2.2.2 runtime ``` @@ -103,14 +103,14 @@ LD_LIBRARY_PATH=$HOME/.djl.ai/paddle/2.0.2--linux-x86_64 ### Windows -- ai.djl.paddlepaddle:paddlepaddle-native-cpu:2.0.2:win-x86_64 +- ai.djl.paddlepaddle:paddlepaddle-native-cpu:2.2.2:win-x86_64 ```xml ai.djl.paddlepaddle paddlepaddle-native-cpu win-x86_64 - 2.0.2 + 2.2.2 runtime ```