Skip to content

Commit

Permalink
feat(llama-infini): 添加 ascend 选项
Browse files Browse the repository at this point in the history
Signed-off-by: YdrMaster <[email protected]>
  • Loading branch information
YdrMaster committed Dec 31, 2024
1 parent d79b107 commit ab09e50
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/user-guide/doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ InfiniLM 通过多后端实现对多种加速软硬件的支持,包括但不

九源统一软件栈为多种国内外软硬件提供统一的算子库和运行时接口。目前包含两个分立的软件包,需要分别编译安装到默认路径 或指定的 `$INFINI_ROOT`。安装方式见各自的自述文档:

1. [统一算子库](https://github.com/PanZezhong1725/operators)
1. [统一算子库](https://github.com/PanZezhong1725/operators/tree/dev)
> **NOTICE** 使用 dev 分支。
2. [统一运行时](https://github.com/PanZezhong1725/infer.cc)

#### 1.5.2 Nvidia 支持
Expand Down Expand Up @@ -162,7 +164,7 @@ cargo test --release --package `model` --lib -- `test` --exact --nocapture
| `model` | `test` | `DEVICES` | 说明
|:--------------:|:---------------------------:|:----------|:-
| `llama-cpu` | `infer::test_infer` | 默认值“1”。任意间隔的正整数数组,表示每个线程分布模型的份数,数组的项数必须是 2 的幂 | 纯 cpu 后端,不需要任何额外依赖
| `llama-infini` | `infer::test_infer` | 默认值“cpu;0”。格式“硬件类型; 卡号” | 九源统一软件栈后端
| `llama-infini` | `infer::test_infer` | 默认值“cpu;0”。格式“硬件类型; 卡号”,硬件类型目前支持 `cpu``nv``ascend` | 九源统一软件栈后端
| `llama-cl` | `infer::test_infer` | TODO | OpenCL 后端
| `llama-nv` | `infer::test_infer` | 默认值“0”。单个非负整数,推理使用的卡号 | 原生 CUDA Toolkit 后端
| `llama-nv` | `nccl_parallel::test_infer` | 默认值“0”。任意间隔的非负整数集合,参与分布式推理的卡号 | 原生 CUDA Toolkit 后端,同时依赖 NCCL 实现分布式
Expand Down
4 changes: 4 additions & 0 deletions models/llama/infini/src/infer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ fn test_infer() {
infini_rt::init(infini_rt::DEVICE_NVIDIA);
WorkerSeed::new(InfiniNode::nv_gpu(&indices))
}
"ascend" => {
infini_rt::init(infini_rt::DEVICE_ASCEND);
WorkerSeed::new(InfiniNode::ascend_npu(&indices))
}
_ => todo!(),
};
thread::scope(|s| {
Expand Down

0 comments on commit ab09e50

Please sign in to comment.