forked from PaddlePaddle/FastDeploy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Backend] support ipu in paddle inference backend. (PaddlePaddle#437)
* feat(ipu): add ipu support for paddle_infer backend. * fix(): remove unused env. * fix(ipu): simplify user API for IPU. * fix(cmake): fix merge conflict error in CMakeList. Co-authored-by: Jason <[email protected]>
- Loading branch information
1 parent
ee2c613
commit ede59af
Showing
23 changed files
with
457 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
|
||
# IPU部署库编译 | ||
|
||
FastDeploy当前在IPU环境仅支持Linux下的Paddle Inference后端推理。 | ||
|
||
## C++ SDK编译安装 | ||
|
||
Linux编译需满足 | ||
- gcc/g++ >= 5.4(推荐8.2) | ||
- cmake >= 3.16.0, < 3.23.0 | ||
- popart >= 3.0.0 | ||
|
||
```bash | ||
git clone https://github.com/PaddlePaddle/FastDeploy.git | ||
cd FastDeploy | ||
mkdir build && cd build | ||
cmake .. -DENABLE_PADDLE_BACKEND=ON \ | ||
-DWITH_IPU=ON \ | ||
-DCMAKE_INSTALL_PREFIX=${PWD}/compiled_fastdeploy_sdk \ | ||
-DENABLE_VISION=ON | ||
make -j8 | ||
make install | ||
``` | ||
|
||
编译完成后,即在`CMAKE_INSTALL_PREFIX`指定的目录下生成C++推理库 | ||
|
||
|
||
## Python编译安装 | ||
|
||
Linux编译过程同样需要满足 | ||
- gcc/g++ >= 5.4(推荐8.2) | ||
- cmake >= 3.16.0, < 3.23.0 | ||
- popart >= 3.0.0 | ||
- python >= 3.6 | ||
|
||
所有编译选项通过环境变量导入 | ||
|
||
```bash | ||
git clone https://github.com/PaddlePaddle/FastDeploy.git | ||
cd FastDeploy/python | ||
export ENABLE_VISION=ON | ||
export ENABLE_PADDLE_BACKEND=ON | ||
export WITH_IPU=ON | ||
|
||
python setup.py build | ||
python setup.py bdist_wheel | ||
``` | ||
|
||
编译完成即会在`FastDeploy/python/dist`目录下生成编译后的`wheel`包,直接pip install即可 | ||
|
||
编译过程中,如若修改编译参数,为避免带来缓存影响,可删除`FastDeploy/python`目录下的`build`和`.setuptools-cmake-build`两个子目录后再重新编译 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
|
||
# How to Build IPU Deployment Environment | ||
|
||
FastDeploy only supports Paddle Inference in the IPU environment. | ||
|
||
## How to Build and Install C++ SDK | ||
|
||
Prerequisite for Compiling on Linux: | ||
|
||
- gcc/g++ >= 5.4 (8.2 is recommended) | ||
- cmake >= 3.16.0, < 3.23.0 | ||
- popart >= 3.0.0 | ||
|
||
```bash | ||
git clone https://github.com/PaddlePaddle/FastDeploy.git | ||
cd FastDeploy | ||
mkdir build && cd build | ||
cmake .. -DENABLE_PADDLE_BACKEND=ON \ | ||
-DWITH_IPU=ON \ | ||
-DCMAKE_INSTALL_PREFIX=${PWD}/compiled_fastdeploy_sdk \ | ||
-DENABLE_VISION=ON | ||
make -j8 | ||
make install | ||
``` | ||
|
||
Once compiled, the C++ inference library is generated in the directory specified by `CMAKE_INSTALL_PREFIX` | ||
|
||
## How to Build and Install Python SDK | ||
|
||
Prerequisite for Compiling on Linux: | ||
|
||
- gcc/g++ >= 5.4 (8.2 is recommended) | ||
- cmake >= 3.16.0, < 3.23.0 | ||
- popart >= 3.0.0 | ||
- python >= 3.6 | ||
|
||
All compilation options are imported via environment variables | ||
|
||
```bash | ||
git clone https://github.com/PaddlePaddle/FastDeploy.git | ||
cd FastDeploy/python | ||
export ENABLE_VISION=ON | ||
export ENABLE_PADDLE_BACKEND=ON | ||
export WITH_IPU=ON | ||
|
||
python setup.py build | ||
python setup.py bdist_wheel | ||
``` | ||
|
||
The compiled `wheel` package will be generated in the `FastDeploy/python/dist` directory once finished. Users can pip-install it directly. | ||
|
||
During the compilation, if developers want to change the compilation parameters, it is advisable to delete the `build` and `.setuptools-cmake-build` subdirectories in the `FastDeploy/python` to avoid the possible impact from cache, and then recompile. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.