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
fastpt
Commits
3fd0c7cd
Commit
3fd0c7cd
authored
May 27, 2025
by
fengzch-das
Browse files
update: adjust the format of readme
parent
6b250c99
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
README.md
README.md
+12
-5
No files found.
README.md
View file @
3fd0c7cd
...
...
@@ -90,7 +90,7 @@ whl包安装完成后,为测试编译的组件是否可用,执行下面的
```
source /usr/local/bin/fastpt -E
```
此时终端会有如下提示:
此时终端会有如下提示:
```
No ROCm runtime is found, using ROCM_HOME='/opt/dtk'
torch mocker so 已存在
...
...
@@ -103,8 +103,11 @@ pytest -vs ./tests
测试完成后,如果用例全部成功测试通过,则该组件验证可用。如果出现失败用例,可以分析其失败原因,从而验证该组件是否可用。
### 3.1.3 不转码编译注意事项
(1)此工具适用于依赖torch的生态组件使用,应用中内含CUDA C/C++代码的工程在HCU环境下的开发、移植。Fastpt版本应与torch版本对应,当前torch版本要求最低torch-2.4.1;
(2)不支持依赖cutlass、内嵌汇编代码的编译;
(3)部分代码可能存在不支持的情况,如__CUDA_ARCH__宏,可以在代码中设置或在编译指令中添加支持,可设置arch对应sm_75;
(4)部分编译指令不支持,如下示例中的"-gencode","arch=compute_75, code=sm_75"需要使用"-gencode=arch=compute_75,code=sm_75"替换。
```
python
extra_compile_args
=
{
...
...
@@ -122,6 +125,7 @@ pytest -vs ./tests
+
generator_flag
,
},
```
(5) 编译模式(-C)与执行模式(-E)下,torch.version.cuda与torch.version.hip会分别被设置,少部分应用在执行时会依赖这两个变量,需要根据具体情况在应用端调整上述两个变量。
## 3.2 转码编译
FastPT提供了HCU下,转码到HIP格式,通过hipcc进行编译的方法,实现基于torch的应用中CUDA代码移植到HCU平台,工具接口包括CUDAExtension、CppExtension、hipify转码接口.编译时,转码一般是自动实现的。另外提供了自定义接口映射用来补充代码映射关系;提供了保持源码文件夹下文件相对路径的转码方法。
...
...
@@ -177,14 +181,17 @@ python fastptcode.py
```
### 3.2.4 注意事项
```
(1)此工具适用于依赖torch的生态组件或应用,内含CUDA C/C++代码的工程在HCU环境下的开发、移植,注意FastPT版本与torch版本对应;
(2)暂不支持CMake、make等代码语义处理。代码转换可通过上面3.2.3中的示例,通过执行python的转码脚本代码,将CUDA代码转换成HIP代码,CMake文件需要用户自行处理。为了便于适配建议通过CMake编译的组件使用3.1章节的不转码的方式,通过CUDA源码编译的方式适配;
(3)工程中存在三方依赖库时,三方库可能存在不被处理的情况,此时需要对三方依赖库进行单独处理;
(4)适配组件的setup.py 中可能会有CUDA环境检查来决定是否执行CUDA相关代码的编译,例如CUDA_PATH或torch.version.cuda的检查,可按情况进行处理;
(5)当不希望引入ATen/dtk_macros.h这个头文件时,可以通过以方式屏蔽此头文件的引入:export FASTPT_DTK_MACROS=1。
```
#
5
已支持组件列表
#
4
已支持组件列表
| | 组件名称 | 版本 | DAS仓库 | 备注说明 |
| -- | ------------------- | --------------------- | ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |
...
...
@@ -216,5 +223,5 @@ python fastptcode.py
| 26 | uni-core | main | http://developer.sourcefind.cn/codes/OpenDAS/Uni-Core.git | |
| 27 | apex | 24.04.1-dtk25.04 | http://developer.sourcefind.cn/codes/OpenDAS/apex.git | |
#
6
附录
#
5
附录
fastpt whl包链接地址:https://download.sourcefind.cn:65024/4/main/fastpt
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