README.md 2.73 KB
Newer Older
zzg_666's avatar
zzg_666 committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# Marco-Nano
## 论文
暂无
## 模型简介
Marco-Nano-Instruct是Marco-Nano-Base的后训练版本,由阿里巴巴国际数字商业集团开发,是Marco-MoE系列中的一款高稀疏度混合专家(MoE)多语言大模型。该模型每处理一个token仅激活80亿总参数中的6亿参数(激活比例为7.5%)。尽管具有极高的稀疏度,Marco-Nano-Instruct在英语、多语言通用以及多语言文化基准测试中,在所有激活参数量最高达38.4 亿的同类指令模型中,均取得了最佳的综合性能表现。


## 环境依赖
| 软件 | 版本 |
| :------: | :------: |
| DTK | 26.04 |
| python | 3.10.12 |
| torch | 2.9.0+das.opt1.dtk2604.20260206.g275d08c2 |
| transformers | 5.0.0.dev0 |
| vllm | 0.15.1+das.opt1.alpha.dtk2604.20260220.g2799735a |

推荐使用镜像: harbor.sourcefind.cn:5443/dcu/admin/base/custom:vllm0.15.1-ubuntu22.04-dtk26.04-0130-py3.10-20260220

- 挂载地址`-v`根据实际模型情况修改

```bash
docker run -it \
    --shm-size 200g \
    --network=host \
    --name Marco-Nano \
    --privileged \
    --device=/dev/kfd \
    --device=/dev/dri \
    --device=/dev/mkfd \
    --group-add video \
    --cap-add=SYS_PTRACE \
    --security-opt seccomp=unconfined \
    -u root \
    -v /opt/hyhal/:/opt/hyhal/:ro \
    -v /path/your_code_data/:/path/your_code_data/ \
    harbor.sourcefind.cn:5443/dcu/admin/base/custom:vllm0.15.1-ubuntu22.04-dtk26.04-0130-py3.10-20260220 bash
```

更多镜像可前往[光源](https://sourcefind.cn/#/service-list)下载使用,其它包安装:
```
pip install pycountry
```

## 数据集
`暂无`

## 训练
`暂无`

## 推理
### vllm
#### 单机推理
```bash
## serve启动
vllm serve  AIDC-AI/Marco-Nano-Instruct     --trust-remote-code --dtype bfloat16 -tp 1  --port 8010

## client访问
curl -X POST "http://localhost:8010/v1/chat/completions"      -H "Content-Type: application/json"     --data '{
                "model": "AIDC-AI/Marco-Nano-Instruct",
                "messages": [
                        {
                                "role": "user",
                                "content": "你是谁"
                        }
                ]
        }'


```

## 效果展示
<div align=center>
    <img src="./doc/result.png"/>
</div>

### 精度
`DCU与GPU精度一致,推理框架:vllm。`

## 预训练权重
| 模型名称  | 权重大小  | DCU型号  | 最低卡数需求 |下载地址|
|:-----:|:----------:|:----------:|:---------------------:|:----------:|
| Marco-Nano-Instruct | 8B | K100AI | 1 | [HuggingFace](https://huggingface.co/AIDC-AI/Marco-Nano-Instruct) |


## 源码仓库及问题反馈
- https://developer.sourcefind.cn/codes/modelzoo/marco-nano_vllm

## 参考资料
- https://huggingface.co/AIDC-AI/Marco-Nano-Instruct