modify code based on review suggestions

Signed-off-by: tzhouam <tzhouam@connect.ust.hk>
Signed-off-by: 齐保元 <qibaoyuan@xiaomi.com>
This commit is contained in:
tzhouam authored and 齐保元 committed 2025-11-14 18:44:29 +08:00
1 parent a42dba230d
commit 7b9fa7708a
6 files changed
+44 -98

No files matched your search

@@ -269,13 +269,13 @@ class Qwen2_5OmniForConditionalGeneration(
# 2) Talker (if codec not provided)
if self.model_stage == "talker":
# Mixed-mode support: in一个step内同时支持 Prefill*n 与 Decode*n。
# 规则:
# - 使用特殊token将 Prefill 片段包裹为 [BOS][PAD...][EOS]
# - Decode 片段则为“单一非特殊token”
# - 若提供了 additional_information(可为按请求分割的 list 或拼接后的 tensor + 形状列表),
# 则对 Prefill 片段按请求重建 thinker→talker 的输入嵌入;
# - 对 Decode 片段,若提供了 per-request 的 decode 辅助嵌入(可选),则进行叠加;否则保留原嵌入。
# Mixed-mode support: In a single step, both Prefill*n and Decode*n are supported.
# Rules:
# - Prefill segments are wrapped with special tokens: [BOS][PAD...][EOS]
# - Decode segments consist of a single non-special token.
# - If additional_information is provided (can be a list split by request or a concatenated tensor plus a list of shapes),
# then for each request, reconstruct the thinker→talker input embeddings for the Prefill segments;
# - For Decode segments, if per-request auxiliary decode embeddings are provided (optional), add them; otherwise, keep the original embedding.
if input_ids is None and additional_information is None:
input_ids = torch.zeros(
@@ -1,7 +1,7 @@
# stage config for running qwen2.5-omni with architecture of OmniLLM.
stage_args:
- stage_id: 0
mrs:
runtime:
process: true # Run this stage in a separate process
devices: "0" # Visible devices for this stage (CUDA_VISIBLE_DEVICES/torch.cuda.set_device)
max_batch_size: 1
@@ -18,7 +18,7 @@ stage_args:
final_output: true
final_output_type: text
- stage_id: 1
mrs:
runtime:
process: true
devices: "1"
max_batch_size: 3
@@ -35,7 +35,7 @@ stage_args:
engine_input_source: [0]
custom_process_input_func: vllm_omni.model_executor.stage_input_processors.qwen2_5_omni.thinker2talker
- stage_id: 2
mrs:
runtime:
process: true
devices: "0" # Example: use a different GPU than the previous stage; use "0" if single GPU
max_batch_size: 1
@@ -53,8 +53,8 @@ stage_args:
final_output: true
final_output_type: audio
# Top-level MRS config (concise): default windows and stage edges
mrs:
# Top-level runtime config (concise): default windows and stage edges
runtime:
enabled: true
defaults:
window_size: -1 # Simplified: trigger downstream only after full upstream completion