Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
apex
Commits
e4f67dc0
Commit
e4f67dc0
authored
May 29, 2025
by
fengzch-das
Browse files
update readme
parent
9090eec1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
49 deletions
+34
-49
README.md
README.md
+34
-49
No files found.
README.md
View file @
e4f67dc0
# APEX
## 介绍
# 1 简介
DAS软件栈提供DCU适配版的apex深度学习框架。得益于DAS软件栈对apex特性功能的支持,开发者针对DCU加速卡开发应用时,可以便捷调用apex用于简化Pytorch中的混合精度和分布式训练等功能。
[
Introduction
](
README_ORIGIN.md
)
# 2 编译安装方式
##
# APEX 简介
##
2.1 环境准备
DAS软件栈提供DCU适配版的apex深度学习框架。得益于DAS软件栈对apex特性功能的支持,开发者针对DCU加速卡开发应用时,可以便捷调用apex用于简化Pytorch中的混合精度和分布式训练等功能
当前组件在下面的环境下已验证编译成功:
### 适配环境
| 序号 | FastPT版本 | Pytorch版本 | DTK版本 |
| :--: | :--------: | :---------: | :-----: |
| 1 | 2.1.0+das.dtk25041 |2.5.1|dtk25041|
| 2 | 2.1.0+das.dtk2504 |2.5.1|dtk2504|
| 3 | 2.0.1+das.dtk25041 |2.4.1|dtk25041|
| 4 | 2.0.1+das.dtk2504 |2.4.1|dtk2504|
```
shell
DTK: dtk-25.04
pytorch: 2.4.1
torch-mocker: v2.4
```
#### 安装mocker和torch
提供基于fastpt不转码编译:
1.
基于光源pytorch基础镜像环境:镜像下载地址:
[
https://sourcefind.cn/#/image/dcu/pytorch
](
https://sourcefind.cn/#/image/dcu/pytorch
)
,根据pytorch、python、dtk及系统下载对应的镜像版本。
2.
基于现有python环境:安装pytorch,fastpt whl包下载目录:
[
http://10.6.10.68:8000/debug/pytorch/dtk24.04.1/
](
http://10.6.10.68:8000/debug/pytorch/dtk24.04.1/
)
,根据python、dtk版本,下载对应pytorch的whl包。安装命令如下:
```
shell
pip
install
torch
*
(
下载的torch的whl包
)
pip
install
fastpt
*
(
下载的fastpt的whl包, 安装顺序, 先安装torch,后安装fastpt
)
pip
install
setuptools
==
59.5.0 wheel
```
#### 设置环境变量
```
shell
source
/opt/dtk/cuda/env.sh
export
LD_LIBRARY_PATH
=
/usr/local/lib/python3.10/site-packages/torch/lib:
$LD_LIBRARY_PATH
export
USE_FASTPT_CUDA
=
1
```
### 前置条件
使用 DAS PyTorch需要参考
[
《DCU新手入门教程》
](
https://developer.hpccube.com/gitbook//dcu_tutorial/index.html
)
在主机系统安装以下组件:
-
DCU驱动程序
-
DTK
-
Docker引擎
## 2.2 编译流程
### 使用命令安装
工具安装使用 pip 方式,从http://10.6.10.68:8000/debug/apex/dtk25.04-rc2/下载此工具的安装包。注意与 python,torch 版本匹配
### 2.2.1 基础环境检查
`pip3 install apex-xxx.whl`
*
检查当前环境是否安装 DTK,若没有则需要安装 DTK,并确定当前环境下 DTK 的版本;
*
检查当前环境是否安装 Pytorch,若没有则需要安装 Pytorch,并确定当前环境下 Pytorch 的版本是否与 DTK 版本对应;
*
检查当前环境是否安装 FastPT,若没有则需要安装 FastPT,并确定当前环境下 FastPT 的版本是否与 Pytorch 的版本相对应。
### 2.2.2 apex 编译流程
*
安装依赖
```
bash
pip
install
wheel
pip
install
pytest
### 使用源码安装
source
/usr/local/bin/fastpt
-C
#### 下载源码:
```
shell
http://developer.sourcefind.cn/codes/OpenDAS/apex.git
python3 setup.py
--cpp_ext
--cuda_ext
--peer_memory
--nccl_p2p
--fast_bottleneck
bdist_wheel
# 编译指令
```
#### 源码编译:
```
shell
cd
apex
git branch
-a
# 查看所有分支
git checkout 24.04.1-dtk25.04
# 切换到分支
并通过下面的命令安装 Pytorch3d:
```
bash
pip
install
dist/apex-0.1-cp310-cp310-linux_x86_64.whl
```
# 3 组件测试
执行下面的命令测试组件:
```
bash
pip
install
expecttest
python3 setup.py
--cpp_ext
--cuda_ext
--peer_memory
--nccl_p2p
--fast_bottleneck
bdist_wheel
# 编译指令
source
/usr/local/bin/fastpt
-E
pip
install
dist/apex
*
# 安装apex
cd
tests/L0
python run_test.py
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment