-
Notifications
You must be signed in to change notification settings - Fork 765
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
update hardware_info_cn.md #4653
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
d5a9266
update hardware_info_cn.md
adaxiadaxi 24a5e1a
update index_cn.rst
adaxiadaxi df0d983
delete index_cn.rst
adaxiadaxi 02f8bc8
update index_cn.rst
adaxiadaxi e466766
add file paadle_2.0_xpu2_cn.md
adaxiadaxi 1c1f669
add paddle_install_xpu2_cn.md
adaxiadaxi 0aaf9d0
add train_example_xpu2_cn.md
adaxiadaxi 7e83008
delete xpu2_train.md
adaxiadaxi 5246d36
update train_example_xpu2_cn.md
adaxiadaxi fcdca31
update index_cn.rst
adaxiadaxi 675170d
update install_xpu2_cn.md
adaxiadaxi 7b9bdbd
update index_cn.rst
adaxiadaxi e02978f
update paddle_2.0_xpu2_cn.md
adaxiadaxi 63eb818
update install.md
adaxiadaxi 4941463
update train_example
adaxiadaxi fe85dcc
update fix_code_style
adaxiadaxi a2321d6
update order_list
adaxiadaxi 2ebb7ea
Update train_example_xpu2_cn.md
TCChenlong 7c36e80
更新序号问题
adaxiadaxi c7234c7
Update train_example_xpu2_cn.md
TCChenlong dbc1ebc
Update train_example_xpu2_cn.md
TCChenlong File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
|
@@ -19,4 +19,4 @@ | |
xpu_docs/index_cn.rst | ||
rocm_docs/index_cn.rst | ||
npu_docs/index_cn.rst | ||
ipu_docs/index_cn.rst | ||
ipu_docs/index_cn.rst |
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 |
---|---|---|
@@ -1,21 +1,32 @@ | ||
.. _cn_xpu_information: | ||
|
||
#################### | ||
昆仑XPU芯片运行飞桨 | ||
昆仑芯片运行飞桨 | ||
#################### | ||
|
||
百度昆仑AI计算处理器(Baidu KUNLUN AI Computing Processor)是百度集十年AI产业技术实践于2019年推出的全功能AI芯片。基于自主研发的先进XPU架构,为云端和边缘端的人工智能业务而设计。 百度昆仑与飞桨及其他国产软硬件强强组合,打造一个全面领先的国产化AI技术生态,部署和应用于诸多 “人工智能+“的行业领域,包括智能云和高性能计算,智慧制造、智慧城市和安防等。更多昆仑XPU芯片详情及技术指标请 `点击这里 <https://cloud.baidu.com/product/kunlun.html>`_ 。 | ||
百度昆仑AI计算处理器(Baidu KUNLUN AI Computing Processor)是百度集十年AI产业技术实践于2019年推出的全功能AI芯片。基于自主研发的先进XPU架构,为云端和边缘端的人工智能业务而设计。 百度昆仑与飞桨及其他国产软硬件强强组合,打造一个全面领先的国产化AI技术生态,部署和应用于诸多 “人工智能+“的行业领域,包括智能云和高性能计算,智慧制造、智慧城市和安防等。更多昆仑XPU芯片详情及技术指标请 `点击这里 <https://www.kunlunxin.com.cn/>`_ 。 | ||
参考以下内容可快速了解和体验昆仑XPU芯片上运行飞桨: | ||
|
||
- `飞桨对昆仑XPU芯片的支持 <./paddle_2.0_xpu_cn.html>`_ : 飞桨支持昆仑XPU芯片运行 | ||
- `飞桨框架昆仑xpu版安装说明 <./paddle_install_cn.html>`_ : 飞桨框架昆仑xpu版安装说明 | ||
- `飞桨框架昆仑XPU版训练示例 <./train_example_cn.html>`_ : 飞桨框架昆仑XPU版训练示例 | ||
- `飞桨预测库昆仑XPU版安装及使用 <./inference_install_example_cn.html>`_ : 飞桨预测库昆仑XPU版安装及使用示例 | ||
昆仑芯2代芯片: | ||
|
||
- `飞桨对昆仑2代芯片的支持 <./paddle_2.0_xpu_cn.html>`_ : 飞桨支持昆仑2代芯片(R200、R300)运行 | ||
- `飞桨框架昆仑2代芯片安装说明 <./paddle_install_cn.html>`_ : 飞桨框架昆仑2代芯片(R200、R300)安装说明 | ||
- `飞桨框架昆仑2代芯片训练示例 <./train_example_cn.html>`_ : 飞桨框架昆仑2代芯片(R200、R300)训练示例 | ||
|
||
昆仑芯1代芯片: | ||
|
||
- `飞桨对昆仑1代芯片的支持 <./paddle_2.0_xpu_cn.html>`_ : 飞桨支持昆仑1代芯片(K100、K200)运行 | ||
- `飞桨框架昆仑1代芯片安装说明 <./paddle_install_cn.html>`_ : 飞桨框架昆仑1代芯片(K100、K200)安装说明 | ||
- `飞桨框架昆仑1代芯片训练示例 <./train_example_cn.html>`_ : 飞桨框架昆仑1代芯片(K100、K200)训练示例 | ||
- `飞桨预测库昆仑1代芯片安装及使用 <./inference_install_example_cn.html>`_ : 飞桨预测库昆仑1代芯片(K100、K200)版安装及使用示例 | ||
|
||
.. toctree:: | ||
:hidden: | ||
|
||
paddle_2.0_xpu2_cn.md | ||
paddle_install_xpu2_cn.md | ||
train_example_xpu2_cn.md | ||
paddle_2.0_xpu_cn.md | ||
paddle_install_cn.md | ||
train_example_cn.md | ||
inference_install_example_cn.md | ||
inference_install_example_cn.md |
36 changes: 36 additions & 0 deletions
36
docs/guides/09_hardware_support/xpu_docs/paddle_2.0_xpu2_cn.md
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,36 @@ | ||
# 飞桨对昆仑2代芯片的支持 | ||
|
||
飞桨自2.3rc版本起支持在昆仑2代芯片上(R200,R300)运行,经验证的模型训练的支持情况如下: | ||
|
||
## 训练支持 | ||
|
||
可进行单机单卡/单机多卡训练的模型,如下所示: | ||
|
||
| 模型 | 领域 | 编程范式 | 可用的CPU类型 | 单机单卡支持 | 单机多卡支持 | | ||
| ------------------ | -------- |------------- | ----------------------- | -------------- | -------------- | | ||
| ResNet50 | 图像分类 | 动态图 | X86(Intel) | 支持 |- | | ||
| MobileNet_v3 | 图像分类 | 动态图 | X86(Intel) | 支持 |- | | ||
| UNet | 图像分割 | 动态图 | X86(Intel) | 支持 |- | | ||
| Yolov3-DarkNet53 | 目标检测 | 动态图 | X86(Intel) | 支持 |- | | ||
| SSD-ResNet34 | 目标检测 | 动态图 | X86(Intel) | 支持 |支持 | | ||
| OCR-DB | 文字检测 | 动态图 | X86(Intel) | 支持 |- | | ||
| Bert-Base | NLP | 静态图 | X86(Intel) | 支持 |支持 | | ||
| Transformer | NLP | 静态图 | X86(Intel) | 支持 |支持 | | ||
| GPT-2 | NLP | 动态图 | X86(Intel) | 支持 |- | | ||
| DeepFM | 推荐 | 动态图 | X86(Intel) | 支持 |- | | ||
| Wide&Deep | 推荐 | 动态图 | X86(Intel) | 支持 |- | | ||
|
||
|
||
|
||
模型放置在飞桨模型套件中,作为github.com/PaddlePaddle下的独立repo存在,git clone下载即可获取所需的模型文件: | ||
|
||
| 领域 | 套件名称 | 分支/版本 | | ||
| -------- | --------------- | ----------- | | ||
| 图像分类 | [PaddleClas](https://github.com/PaddlePaddle/PaddleClas) | [develop](https://github.com/PaddlePaddle/PaddleClas/tree/develop) | | ||
| 目标检测 | [PaddleDetection](https://github.com/PaddlePaddle/PaddleDetection) | [develop](https://github.com/PaddlePaddle/PaddleDetection/tree/develop) | | ||
| 图像分割 | [PaddleSeg](https://github.com/PaddlePaddle/PaddleSeg) | [develop](https://github.com/PaddlePaddle/PaddleSeg/tree/develop) | | ||
| NLP | [PaddleNLP](https://github.com/PaddlePaddle/PaddleNLP) | [develop](https://github.com/PaddlePaddle/PaddleNLP/tree/develop) | | ||
| OCR | [PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR) | [dygraph](https://github.com/PaddlePaddle/PaddleOCR/tree/dygraph) | | ||
| 推荐 | [PaddleREC](https://github.com/PaddlePaddle/PaddleRec) | [master](https://github.com/PaddlePaddle/PaddleRec/tree/master) | | ||
|
||
* 注:支持基于Kermel Primitive算子的昆仑2代芯片支持,[点击这里](https://www.paddlepaddle.org.cn/documentation/docs/zh/guides/07_new_op/kernel_primitive_api/index_cn.html)。 |
175 changes: 175 additions & 0 deletions
175
docs/guides/09_hardware_support/xpu_docs/paddle_install_xpu2_cn.md
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,175 @@ | ||
# 飞桨框架昆仑2代芯片安装说明 | ||
|
||
在昆仑2代芯片上,飞桨框架支持基于python的训练和原生预测,当前最新版本为2.3rc,提供两种安装方式: | ||
|
||
**1. 预编译的支持昆仑2代芯片的wheel包** | ||
|
||
目前此wheel包只支持一种环境: | ||
|
||
英特尔CPU+昆仑2代芯片+Linux操作系统 | ||
|
||
**2. 源码编译安装** | ||
|
||
其他环境请选择源码编译安装。 | ||
|
||
## 安装方式一:通过Wheel包安装 | ||
|
||
### 下载安装包 | ||
|
||
**环境1:英特尔CPU+昆仑2代芯片+Linux操作系统** | ||
|
||
Linux发行版建议选择CentOS 7系统 | ||
|
||
Python3.7 | ||
|
||
``` | ||
wget https://paddle-inference-lib.bj.bcebos.com/2.3.0-rc0/python/Linux/XPU2/x86-64_gcc8.2_py36_avx_mkl/paddlepaddle_xpu-2.3.0rc0-cp37-cp37m-linux_x86_64.whl | ||
``` | ||
|
||
``` | ||
python3.7 -m pip install -U paddlepaddle_xpu-2.3.0rc0-cp37-cp37m-linux_x86_64.whl | ||
``` | ||
|
||
|
||
### 验证安装 | ||
|
||
安装完成后您可以使用 python 或 python3 进入python解释器,输入 | ||
|
||
``` | ||
import paddle | ||
``` | ||
|
||
再输入 | ||
|
||
``` | ||
paddle.utils.run_check() | ||
``` | ||
|
||
如果出现PaddlePaddle is installed successfully!,说明您已成功安装。 | ||
|
||
* 注:支持基于Kermel Primitive算子的昆仑2代芯片编译whl包,[点击这里查看](https://www.kunlunxin.com.cn)。 | ||
|
||
## 安装方式二:从源码编译支持昆仑XPU的包 | ||
|
||
### 环境准备 | ||
|
||
**英特尔CPU+昆仑2代芯片+CentOS系统** | ||
|
||
- **处理器:Intel(R) Xeon(R) Gold 6148 CPU @2.40GHz** | ||
- **操作系统:CentOS 7.8.2003(建议使用CentOS 7)** | ||
- **Python版本: 3.7 (64 bit)** | ||
- **pip或pip3版本:9.0.1+ (64 bit)** | ||
- **cmake版本:3.15+** | ||
- **gcc/g++版本:8.2+** | ||
|
||
|
||
### 源码编译安装步骤: | ||
|
||
|
||
(1)Paddle依赖cmake进行编译构建,需要cmake版本>=3.15,如果操作系统提供的源包括了合适版本的cmake,直接安装即可,否则需要 | ||
|
||
``` | ||
wget https://github.com/Kitware/CMake/releases/download/v3.16.8/cmake-3.16.8.tar.gz | ||
tar -xzf cmake-3.16.8.tar.gz && cd cmake-3.16.8 | ||
./bootstrap && make && sudo make install | ||
``` | ||
|
||
(2)Paddle内部使用patchelf来修改动态库的rpath,如果操作系统提供的源包括了patchelf,直接安装即可,否则需要源码安装,请参考 | ||
|
||
``` | ||
./bootstrap.sh | ||
./configure | ||
make | ||
make check | ||
sudo make install | ||
``` | ||
|
||
(3)根据[requirments.txt](https://github.com/PaddlePaddle/Paddle/blob/develop/python/requirements.txt)安装Python依赖库 | ||
|
||
(4)将Paddle的源代码克隆到当下目录下的Paddle文件夹中,并进入Paddle目录 | ||
|
||
``` | ||
git clone https://github.com/PaddlePaddle/Paddle.git | ||
cd Paddle | ||
``` | ||
|
||
使用较稳定的版本编译,建议切换到release2.3分支下: | ||
|
||
``` | ||
git checkout release/2.3 | ||
``` | ||
|
||
(5)进行Wheel包的编译,请创建并进入一个叫build的目录下 | ||
|
||
``` | ||
mkdir build && cd build | ||
``` | ||
|
||
具体编译选项含义可参见[编译选项表](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/install/Tables.html#Compile) | ||
|
||
**英特尔CPU+昆仑2代芯+CentOS系统** | ||
|
||
链接过程中打开文件数较多,可能超过系统默认限制导致编译出错,设置进程允许打开的最大文件数: | ||
|
||
``` | ||
ulimit -n 4096 | ||
``` | ||
|
||
执行cmake,完成编译 | ||
|
||
Python3.7 | ||
|
||
``` | ||
cmake .. -DPY_VERSION=3.7 \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DWITH_GPU=OFF \ | ||
-DWITH_XPU=ON \ | ||
-DON_INFER=ON \ | ||
-DWITH_PYTHON=ON \ | ||
-DWITH_AVX=ON \ | ||
-DWITH_MKL=ON \ | ||
-DWITH_MKLDNN=ON \ | ||
-DWITH_XPU_BKCL=ON \ | ||
-DWITH_DISTRIBUTE=ON \ | ||
-DWITH_NCCL=OFF | ||
|
||
make -j$(nproc) | ||
``` | ||
|
||
(6)编译成功后进入Paddle/build/python/dist目录下找到生成的.whl包 。 | ||
|
||
(7)将生成的.whl包copy至带有昆仑XPU的目标机器上,并在目标机器上根据[requirments.txt](https://github.com/PaddlePaddle/Paddle/blob/develop/python/requirements.txt)安装Python依赖库。(如果编译机器同时为带有昆仑XPU的目标机器,略过此步) | ||
|
||
(8)在带有昆仑XPU的目标机器安装编译好的.whl包:pip install -U(whl包的名字)或pip3 install -U(whl包的名字)。恭喜,至此您已完成昆仑XPU机器上PaddlePaddle的编译安装。 | ||
|
||
**验证安装** | ||
|
||
安装完成后您可以使用 python 或 python3 进入python解释器,输入 | ||
|
||
``` | ||
import paddle | ||
``` | ||
|
||
再输入 | ||
|
||
``` | ||
paddle.utils.run_check() | ||
``` | ||
|
||
如果出现PaddlePaddle is installed successfully!,说明您已成功安装。 | ||
|
||
### 如何卸载 | ||
|
||
使用以下命令卸载PaddlePaddle: | ||
|
||
``` | ||
pip uninstall paddlepaddle | ||
``` | ||
|
||
或 | ||
|
||
``` | ||
pip3 uninstall paddlepaddle | ||
``` | ||
|
||
* 注:支持基于Kermel Primitive算子的昆仑2代芯片源码编译,[点击这里查看](https://www.kunlunxin.com.cn)。 |
67 changes: 67 additions & 0 deletions
67
docs/guides/09_hardware_support/xpu_docs/train_example_xpu2_cn.md
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,67 @@ | ||
# 飞桨框架昆仑2代芯片训练示例 | ||
|
||
使用XPU训练与CPU/GPU相同,只需要简单配置XPU,就可以执行在昆仑设备上。 | ||
|
||
#### ResNet50下载并运行示例: | ||
|
||
1、 安装依赖: | ||
``` | ||
git clone https://github.com/PaddlePaddle/PaddleClas.git -b develop | ||
cd PaddleClas | ||
python -m pip install -r requirements.txt | ||
``` | ||
|
||
2、下载数据集: | ||
基于CIFAR100数据集的ResNet50训练任务 | ||
``` | ||
cd dataset | ||
rm -rf ILSVRC2012 | ||
wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/data/whole_chain/whole_chain_CIFAR100.tar | ||
tar xf whole_chain_CIFAR100.tar | ||
ln -s whole_chain_CIFAR100 ILSVRC2012 | ||
cd ILSVRC2012 | ||
mv train.txt train_list.txt | ||
mv test.txt val_list.txt | ||
``` | ||
|
||
3、配置XPU进行训练的命令非常简单: | ||
``` | ||
cd ../.. | ||
#FLAGS指定单卡或多卡训练,此示例运行1个卡 | ||
export FLAGS_selected_xpus=2 | ||
export XPUSIM_DEVICE_MODEL=KUNLUN2 | ||
#启动训练 | ||
python tools/train.py \ | ||
-c ppcls/configs/ImageNet/ResNet/ResNet50.yaml \ | ||
-o Global.device=xpu | ||
``` | ||
|
||
#### YOLOv3-DarkNet53下载并运行示例: | ||
|
||
1、安装依赖: | ||
``` | ||
git clone https://github.com/PaddlePaddle/PaddleDetection.git -b develop | ||
cd PaddleDetection/ | ||
pip install -U pip Cython | ||
pip install -r requirements.txt | ||
``` | ||
|
||
2、下载数据集 | ||
``` | ||
cd dataset/voc/ | ||
python download_voc.py | ||
python create_list.py | ||
cd ../.. | ||
``` | ||
|
||
3、配置XPU进行训练的命令非常简单: | ||
``` | ||
#FLAGS指定单卡或多卡训练,此示例运行1个卡 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 同resnet50 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 同上 |
||
export FLAGS_selected_xpus=2 | ||
export XPUSIM_DEVICE_MODEL=KUNLUN2 | ||
#启动训练 | ||
python -u tools/train.py \ | ||
-c configs/yolov3/yolov3_darknet53_270e_voc.yml \ | ||
-o use_gpu=false use_xpu=true LearningRate.base_lr=0.000125 \ | ||
--eval | ||
``` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ResNet50不支持多卡训练、建议只写“单卡”、因若支持多卡训练、一般会给出相应的训练命令;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里描述的初衷是:可以通过flags指定单卡或多卡训练,只是此处示例运行的单1张卡,所以还是先保留这样的描述吧