README.md 4.21 KB
Newer Older
raojy's avatar
raojy committed
1
2
3
# Qwen3_Omni
## 论文
[Qwen3_Omni](https://github.com/QwenLM/Qwen3-Omni/blob/main/assets/Qwen3_Omni.pdf)
raojy's avatar
raojy committed
4

raojy's avatar
raojy committed
5
6
7
8
9
10
11
## 模型简介

Qwen3-Omni 是一款原生的端到端全模态基座模型,具备对文本、图像、音频及视频的统一理解与生成能力。 该模型在多项音视频基准测试中展现出卓越的业界领先(SOTA)性能,其语音识别、音频理解及交互对话能力已可媲美 Gemini 2.5 Pro;同时,得益于早期的“文本优先”预训练策略,它在强化多模态支持的同时,完全保留了顶级的纯文本与图像处理水平,并支持多达 119 种文本语言及 19 种语音输入的跨语言交互。

在架构创新上,Qwen3-Omni 采用了基于 MoE(混合专家模型)的 “Thinker–Talker” 设计,结合 AuT 预训练与多码本技术,显著降低了推理延迟。 这种先进的设计使其能够支持极低延迟的流式音视频实时交互,实现自然的对话轮替与即时反馈。此外,模型提供了灵活的系统提示词控制机制,并同步开源了高精度的 30B 级别音频描述器(Captioner),为开源社区在全模态实时感知与复杂任务处理领域提供了强有力的支持。

<div align=center>
raojy's avatar
raojy committed
12
    <img src="./doc/arc2.png" width="50%" />
raojy's avatar
raojy committed
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
</div>

## 环境依赖
| 软件 |                    版本                     |
| :------: |:-----------------------------------------:|
| DTK |                   26.04                   |
| python |                  3.10.12                  |
| transformers |                5.2.0.dev0                 |
| vllm |       0.15.1+das.opt1.alpha.dtk2604       |
| triton | 3.3.0+das.opt2.dtk2604.20260203.g393ad86c |
| torch | 2.9.0+das.opt1.dtk2604.20260126.g22910426 |

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

- 挂载地址`-v` 根据实际模型情况修改
```bash
docker run -it \
    --shm-size 200g \
    --network=host \
    --name Qwen3_Omni \
    --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/ \
raojy's avatar
raojy committed
43
    harbor.sourcefind.cn:5443/dcu/admin/base/custom:vllm0.15.1-ubuntu22.04-dtk26.04-0130-py3.10-20260220 bash
raojy's avatar
raojy committed
44
45
46
```
更多镜像可前往[光源](https://sourcefind.cn/#/service-list)下载使用。

raojy's avatar
raojy committed
47
关于本项目DCU显卡所需的特殊深度学习库可从[光合](https://developer.sourcefind.cn/tool/)开发者社区下载安装,vllm,numpy库需要替换安装:
raojy's avatar
raojy committed
48
```
raojy's avatar
raojy committed
49
pip uninstall vllm numpy
raojy's avatar
raojy committed
50
pip install vllm-0.15.1+das.opt1.alpha.dtk2604-cp310-cp310-linux_x86_64.whl
raojy's avatar
raojy committed
51
pip install numpy==1.26.1
raojy's avatar
raojy committed
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
```

## 数据集
暂无

## 训练
暂无

## 推理
### vllm
#### 单机推理

```bash
## serve启动

raojy's avatar
raojy committed
67
vllm serve Qwen/Qwen3-Omni-30B-A3B-Instruct \
raojy's avatar
raojy committed
68
69
70
71
72
73
74
75
76
    --trust-remote-code \
    --tensor-parallel-size 4 \
    --dtype bfloat16 

## client访问
curl http://localhost:8000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer EMPTY" \
  -d '{
raojy's avatar
raojy committed
77
    "model": "Qwen/Qwen3-Omni-30B-A3B-Instruct",
raojy's avatar
raojy committed
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "image_url",
            "image_url": {
              "url": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg"
            }
          },
          {
            "type": "text",
            "text": "描述这张图片的内容。"
          }
        ]
      }
    ],
    "max_tokens": 512,
    "temperature": 0.7,
    "top_p": 0.8
  }'

```

## 效果展示
<div align=center>
raojy's avatar
raojy committed
104
    <img src="./doc/1.png"/>
raojy's avatar
raojy committed
105
106
107
108
109
110
111
112
</div>

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

## 预训练权重
|  模型名称  | 权重大小 | DCU型号  | 最低卡数需求 |         下载地址          |
|:------:|:----:|:----------:|:------:|:---------------------:|
raojy's avatar
raojy committed
113
| Qwen3-Omni-30B-A3B-Instruct | 30B | BW1000 |   2   | [Hugging Face](https://huggingface.co/Qwen/Qwen3-Omni-30B-A3B-Instruct) |
raojy's avatar
raojy committed
114
115
116
117
118
119
120


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

## 参考资料
- https://github.com/QwenLM/Qwen3-Omni