You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source_en/BestPractices/NPU-support.md
+63Lines changed: 63 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,22 @@
1
1
# NPU Support
2
2
3
+
We add Ascend NPU support in ms-swift, so you can fine-tune and run inference on Ascend NPUs.
4
+
5
+
This document describes how to prepare the environment, fine-tune, run inference and deploy on NPUs.
6
+
7
+
## Installation
8
+
9
+
Base environment requirements:
10
+
11
+
| Software | Version |
12
+
| --------- | --------------- |
13
+
| Python | >= 3.10, < 3.12 |
14
+
| CANN | == 8.3.RC1 |
15
+
| torch | == 2.7.1 |
16
+
| torch_npu | == 2.7.1 |
17
+
18
+
For detailed environment setup, please refer to the [Ascend PyTorch installation guide](https://gitcode.com/Ascend/pytorch).
19
+
3
20
## Environment Preparation
4
21
5
22
Experiment Environment: 8 * Ascend 910B3 64G (The device is provided by [@chuanzhubin](https://github.com/chuanzhubin), thanks for the support of modelscope and swift~)
@@ -17,6 +34,9 @@ pip install ms-swift -U
17
34
pip install torch-npu decorator
18
35
# If you want to use deepspeed (to control memory usage, training speed might decrease)
19
36
pip install deepspeed
37
+
38
+
# If you need the evaluation functionality, please install the following package
39
+
pip install evalscope[opencompass]
20
40
```
21
41
22
42
Check if the test environment is installed correctly and whether the NPU can be loaded properly.
@@ -221,3 +241,46 @@ ASCEND_RT_VISIBLE_DEVICES=0 swift deploy --adapters xxx/checkpoint-xxx --max_new
221
241
ASCEND_RT_VISIBLE_DEVICES=0 swift export --adapters xx/checkpoint-xxx --merge_lora true
222
242
ASCEND_RT_VISIBLE_DEVICES=0 swift deploy --model xxx/checkpoint-xxx-merged --max_new_tokens 2048
223
243
```
244
+
245
+
## Current Support Status
246
+
247
+
### Table 1: SFT Algorithms
248
+
249
+
| Algorithm | Model Families | Strategy | Hardware |
0 commit comments