1 Star 1 Fork 32

佳威 / DeepSpeed

forked from Ascend / DeepSpeed 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

deepspeed_npu: Ascend NPU 适配 deepspeed 插件

通过 deepspeed_npu,你可以在 Ascend910 芯片上使用 deepspeed,并基于 deepspeed 进行开发。目前,deepspeed_npu 主要支持以下特性:

  1. FP16
  2. Gradient Accumulation
  3. Data Parallelism
  4. Pipeline Parallelism
  5. Tensor Parallelism (Inference Engine)
  6. ZeRO (stage1-stage3)
  7. Activation Checkpointing
  8. ZeRO-Offload
  9. CPU Adam
  10. Fused Adam
  11. One-bit Adam
  12. MoE
  13. Zero Infinity

请参考 deepspeed 官方文档获取这些特性的详细说明:https://www.deepspeed.ai/

1.版本说明

目前仅支持 deepspeed 版本 0.9.2:https://github.com/microsoft/DeepSpeed/tree/v0.9.2

2.安装方法

  1. 先安装原生 deepspeed
pip3 install deepspeed==0.9.2
  1. 然后安装 deepspeed-npu 插件
git clone https://gitee.com/ascend/DeepSpeed.git -b v0.9.2 deepspeed_npu
cd DeepSpeed
pip3 install .

3.插件使用方法

在入口文件行首 import deepspeed_npu,并配合 deepspeed / torch 使用,例如

import deepspeed_npu
import torch
import torch_npu
...

4.运行单元测试

进入 unit_test 目录,运行各特性的单元测试

fp16:

bash test_fp16.sh

Pipeline:

bash test_pipeline.sh

ZeRO:

bash test_zero.sh

one-bit Adam:

bash test_onebit_adam.sh

MoE:

bash test_moe.sh

5.运行T5模型使用

请参考提供的T5模型使用指导

MIT License Copyright (c) Microsoft Corporation. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE

简介

后续主线切为0.9.2 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/jiaweizhuang/DeepSpeed.git
git@gitee.com:jiaweizhuang/DeepSpeed.git
jiaweizhuang
DeepSpeed
DeepSpeed
v0.9.2

搜索帮助