Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Paddle] Update Paddle version to 2.2.2 #1601

Merged
merged 2 commits into from
Apr 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions engines/paddlepaddle/paddlepaddle-engine/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ You can pull the PaddlePaddle engine from the central Maven repository by includ
<dependency>
<groupId>ai.djl.paddlepaddle</groupId>
<artifactId>paddlepaddle-engine</artifactId>
<version>0.16.0</version>
<version>0.17.0</version>
<scope>runtime</scope>
</dependency>
```
Expand All @@ -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
<dependency>
<groupId>ai.djl.paddlepaddle</groupId>
<artifactId>paddlepaddle-native-cpu</artifactId>
<classifier>osx-x86_64</classifier>
<version>2.0.2</version>
<version>2.2.2</version>
<scope>runtime</scope>
</dependency>
```

### 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
<dependency>
<groupId>ai.djl.paddlepaddle</groupId>
<artifactId>paddlepaddle-native-cpu</artifactId>
<classifier>linux-x86_64</classifier>
<version>2.0.2</version>
<version>2.2.2</version>
<scope>runtime</scope>
</dependency>
```
Expand All @@ -74,43 +74,43 @@ 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-<cuda-flavor>-linux-x86_64
LD_LIBRARY_PATH=$HOME/.djl.ai/paddle/2.2.2-<cuda-flavor>-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
<dependency>
<groupId>ai.djl.paddlepaddle</groupId>
<artifactId>paddlepaddle-native-cu101</artifactId>
<artifactId>paddlepaddle-native-cu102</artifactId>
<classifier>linux-x86_64</classifier>
<version>2.0.2</version>
<version>2.2.2</version>
<scope>runtime</scope>
</dependency>
```

```xml
<dependency>
<groupId>ai.djl.paddlepaddle</groupId>
<artifactId>paddlepaddle-native-cu102</artifactId>
<artifactId>paddlepaddle-native-cu112</artifactId>
<classifier>linux-x86_64</classifier>
<version>2.0.2</version>
<version>2.2.2</version>
<scope>runtime</scope>
</dependency>
```


### 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
<dependency>
<groupId>ai.djl.paddlepaddle</groupId>
<artifactId>paddlepaddle-native-cpu</artifactId>
<classifier>win-x86_64</classifier>
<version>2.0.2</version>
<version>2.2.2</version>
<scope>runtime</scope>
</dependency>
```
4 changes: 2 additions & 2 deletions engines/paddlepaddle/paddlepaddle-native/build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -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% (
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions engines/paddlepaddle/paddlepaddle-native/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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/"
]
Expand Down
16 changes: 9 additions & 7 deletions engines/paddlepaddle/paddlepaddle-native/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,29 @@ 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
echo "$1 is not supported."
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
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down