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
FastMoE
Commits
c7cf31f5
Commit
c7cf31f5
authored
May 30, 2025
by
zhanggezhong
Browse files
Update README.md
parent
d155b819
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
57 deletions
+22
-57
README.md
README.md
+22
-57
No files found.
README.md
View file @
c7cf31f5
#
<div align="center"><strong>FastMoe</strong></div>
## 简介
#
FastMoE
一个易于使用和高效的系统,支持PyTorch的混合专家(MoE)模型。
## 安装
组件支持组合
| PyTorch版本 | fastpt版本 |FastMoe版本 | DTK版本 | Python版本 | 推荐编译方式 |
| ----------- | ----------- | ----------- | ------------------------ | -----------------| ------------ |
| 2.5.1 | 2.1.0 |1.1.0 | >= 25.04 | 3.8、3.10、3.11 | fastpt不转码 |
| 2.4.1 | 2.0.1 |1.1.0 | >= 25.04 | 3.8、3.10、3.11 | fastpt不转码 |
| 其他 | 其他 | 其他 | 其他 | 3.8、3.10、3.11 | hip转码 |
方式1:
+
pytorch版本大于2.4.1 && dtk版本大于25.04 推荐使用fastpt不转码编译。
在
[
这里
](
http://10.0.35.93:8000/customized/fastmoe/22.10/fastmoe-0.3.0%2Bdtk22.10-cp37-cp37m-linux_x86_64.whl
)
下载whl包,通过pip3 install安装(链接中的whl包为dtk22.10版本)
### 1、使用pip方式安装
fastmoe whl包下载目录:
[
光和开发者社区
](
https://download.sourcefind.cn:65024/4/main/fastmoe
)
,选择对应的pytorch版本和python版本下载对应fastmoe的whl包
```
shell
pip
install
torch
*
(
下载torch的whl包
)
pip
install
fastpt
*
--no-deps
(
下载fastpt的whl包
)
source
/usr/local/bin/fastpt
-E
pip
install
fastmoe
*
(
下载的fastmoe的whl包
)
```
### 2、使用源码编译方式安装
方式2:
#### 编译环境准备
提供基于fastpt不转码编译:
```
python3 setup.py build
python3 setup.py install
```
1.
基于光源pytorch基础镜像环境:镜像下载地址:
[
光合开发者社区
](
https://sourcefind.cn/#/image/dcu/pytorch
)
,根据pytorch、python、dtk及系统下载对应的镜像版本。
## 测试
2.
基于现有python环境:安装pytorch,fastpt whl包下载目录:
[
光合开发者社区
](
https://sourcefind.cn/#/image/dcu/pytorch
)
,根据python、dtk版本,下载对应pytorch的whl包。安装命令如下:
```
shell
pip
install
torch
*
(
下载torch的whl包
)
pip
install
fastpt
*
--no-deps
(
下载fastpt的whl包, 安装顺序,先安装torch,后安装fastpt
)
pip
install
setuptools
==
59.5.0 wheel
pip
install
dm-tree
pip
install
pytest
pip
install
wheel
```
所有测试文件在test文件夹中
#### 源码编译安装
-
代码下载
```
shell
git clone http://developer.sourcefind.cn/codes/OpenDAS/fastmoe.git
# 根据编译需要切换分支
```
-
提供2种源码编译方式(进入fastmoe目录):
pip3 install pytest
```
1. 设置不转码编译环境变量
source /usr/local/bin/fastpt -C
2. 编译whl包并安装
python3 setup.py -v bdist_wheel
pip install dist/fastmoe*
3. 源码编译安装
python3 setup.py install
```
#### 注意事项
+
编译使用fastmoe时,所依赖的fastpt、torch、dtk之间版本必须严格对应,如fastpt2.0.1-dtk2504、torch-2.4.1-dtk2504、dtk2504和fastpt2.0.1-dtk25041、torch-2.4.1-dtk25041、dtk25041
+
若使用pip install下载安装过慢,可添加pypi清华源:-i https://pypi.tuna.tsinghua.edu.cn/simple/
+
ROCM_PATH为dtk的路径,默认为/opt/dtk
+
在pytorch2.5.1环境下编译需要支持c++17语法,打开setup.py文件,把文件中的 -std=c++14 修改为 -std=c++17
## 验证
-
python -c "import fmoe; fmoe.
\_\_
version__",版本号与官方版本同步,查询该软件的版本号,例如1.1.0;
pytest -q test_dp.py
pytest -q test_ddp.py
pytest -q test_local_exchange.py
pytest -q test_numerical.py
pytest -q test_swipe.py
pytest -q test_zero.py
pytest -q test_gates.py
```
## Known Issue
-
无
测试过程中不出现failed,全部pass即为通过
## 参考资料
-
[
README_ORIGIN
](
README_ORIGIN.md
)
-
[
README_zh-CN
](
README_zh-CN.md
)
-
[
https://github.com/laekov/fastmoe
](
https://github.com/laekov/fastmoe
)
tips:Fastmoe系统应用于大规模分布式场景,因此在进行测试的时候,应使用不少于8张计算加速卡,否则会出现skip的问题。
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