README.md 3.49 KB
Newer Older
luopl's avatar
luopl 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
## Intern-S1
## 论文
[Intern-S1: A Scientific Multimodal Foundation Model](https://arxiv.org/abs/2508.15763)

## 模型简介
Intern-S1 结合了强大的通用任务能力和在广泛科学任务上的最先进性能,可与领先的闭源商业模型相媲美。 基于一个235B MoE语言模型(Qwen3)和一个6B视觉编码器(InternViT),Intern-S1 在包含超过2.5万亿科学领域令牌的5万亿令牌多模态数据上进行了进一步预训练。这使得该模型能够保持强大的通用能力,同时在诸如解释化学结构、理解蛋白质序列和规划化合物合成路线等专业科学领域表现出色,使Intern-S1 成为现实世界科学研究中的有力助手。 特性

- 在语言和视觉推理基准测试中表现出色,特别是在科学任务上。

- 在大规模5T令牌数据集上持续预训练,其中超过50%是专门的科学数据,嵌入了深厚的领域专业知识。

- 动态分词器能够原生理解分子公式、蛋白质序列和地震信号。

## 环境依赖
| 软件 |   版本    |
| :------: |:-------:|
|     DTK      |  26.04  |
|    python    | 3.10.12 |
| transformers |  5.2.0  |
|    torch     |  2.9.0+das.opt1.dtk2604.20260331.g4e3c1e7  |
|     vllm     |  0.15.1+das.opt1.alpha.e375aa3.dtk2604  |

推荐使用镜像:harbor.sourcefind.cn:5443/dcu/admin/base/custom:vllm015-ubuntu22.04-dtk26.04-0409-modelzoo

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

```bash
docker run -it \
    --shm-size 200g \
    --network=host \
    --name Intern-S1 \
    --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:vllm015-ubuntu22.04-dtk26.04-0409-modelzoo bash
```

更多镜像可前往[光源](https://sourcefind.cn/#/service-list)下载使用。

关于本项目DCU显卡所需的特殊深度学习库可从[光合](https://developer.sourcefind.cn/tool/)开发者社区下载安装,vllm库需要卸载后重新安装:
```bash
pip uninstall vllm
pip install vllm-0.15.1+das.opt1.alpha.e375aa3.dtk2604-cp310-cp310-linux_x86_64.whl --no-deps
```
## 数据集
`暂无`

## 训练
`暂无`

## 推理
### vllm
#### 单机推理
luopl's avatar
luopl committed
61
启动vllm server:
luopl's avatar
luopl committed
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
```bash
vllm serve internlm/Intern-S1 \
    --port 8001 \
    --tensor-parallel-size 4 \
    --trust-remote-code \
    --reasoning-parser intern-s1 \
    --tool-call-parser intern-s1 \
    --gpu-memory-utilization 0.95 \
    --max-model-len 32768
```
启动完成后可通过以下方式访问:
```bash
curl http://localhost:8001/v1/chat/completions   \
    -H "Content-Type: application/json"  \
    -d '{
        "model": "internlm/Intern-S1",
        "messages": [
luopl's avatar
luopl committed
79
          {"role": "user", "content": "tell me about an interesting physical phenomenon"}
luopl's avatar
luopl committed
80
81
82
83
84
85
86
        ],
        "temperature": 0.6
    }'
```

## 效果展示
<div align=center>
luopl's avatar
luopl committed
87
    <img src="./doc/result-DCU.png"/>
luopl's avatar
luopl committed
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
</div>

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

## 预训练权重
| 模型名称  | 权重大小 | DCU型号  | 最低卡数需求 |下载地址|
|:-----:|:----:|:------:|:------:|:----------:|
| Intern-S1 | 241B | BW1100 |   4    | [Hugging Face](https://huggingface.co/internlm/Intern-S1) |

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

## 参考资料
- https://github.com/InternLM/Intern-S1