sequenceDiagram
participant U as 用户
box rgb(255,243,205) 上游vLLM
participant E as Engine
participant R as ModelRegistry
participant W as Worker
participant S as Sampler
end
box rgb(212,237,218) 本项目vllm-ascend
participant P as Ascend插件
participant MR as NPUModelRunner
participant A as Attention
participant O as Ops
end
participant N as NPU
U->>E: model=DeepseekV4, input=你好
E->>P: 初始化插件
P->>R: register_model()
R->>R: 存储模型映射
E->>R: 查找模型
R-->>E: 返回类路径
E->>MR: 动态导入并实例化
MR->>MR: 加载权重
loop 每个token
E->>W: 发送输入
W->>O: RMSNorm归一化
O->>N: NPU执行
N-->>O: 结果
W->>A: MLA注意力计算
A->>N: NPU执行
N-->>A: 结果
W->>O: FFN前馈网络
O->>N: NPU执行
N-->>O: 结果
W->>S: 采样得到token
S-->>W: token
end
W-->>U: 返回: 你好, 我是...