Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/models/supported_models.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ th {
| `MiMoAudioModel` | MiMo-Audio-7B-Instruct | `XiaomiMiMo/MiMo-Audio-7B-Instruct` | ✅︎ | ✅︎ | | |
| `MiMoV2ASRForCausalLM` | MiMo-V2.5-ASR | `XiaomiMiMo/MiMo-V2.5-ASR` | ✅︎ | ✅︎ | | |
| `Flux2Pipeline` | FLUX.2-dev | `black-forest-labs/FLUX.2-dev` | ✅︎ | ✅︎ | | |
| `FishSpeechSlowARForConditionalGeneration` | Fish Speech S2 Pro | `fishaudio/s2-pro` | ✅︎ | ✅︎ | | |
| `FishSpeechSlowARForConditionalGeneration` | Fish Speech S2 Pro | `fishaudio/s2-pro` | ✅︎ | ✅︎ | | ✅︎ |
| `DreamIDOmniPipeline` | DreamID-Omni | `XuGuo699/DreamID-Omni` | ✅︎ | ✅︎ | | |
| `SenseNovaU1Pipeline` | SenseNova-U1 (DiT-only) | `SenseNova/SenseNova-U1-8B-MoT` | ✅︎ | | | |
| `LancePipeline` | Lance | `bytedance-research/Lance` | ✅︎ | | | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ def main(args):
output_dir = args.output_dir
os.makedirs(output_dir, exist_ok=True)

stage_configs_path = args.stage_configs_path or DEFAULT_STAGE_CONFIG
model_name = args.model or DEFAULT_MODEL

inputs = [
Expand All @@ -139,12 +138,17 @@ def main(args):
)
]

omni = Omni(
omni_kwargs = dict(
model=model_name,
stage_configs_path=stage_configs_path,
log_stats=args.log_stats,
stage_init_timeout=args.stage_init_timeout,
)
if args.deploy_config:
omni_kwargs["deploy_config"] = args.deploy_config
else:
omni_kwargs["stage_configs_path"] = args.stage_configs_path or DEFAULT_STAGE_CONFIG

omni = Omni(**omni_kwargs)

t_start = time.perf_counter()
for stage_outputs in omni.generate(inputs):
Expand All @@ -165,7 +169,6 @@ async def main_streaming(args):
output_dir = args.output_dir
os.makedirs(output_dir, exist_ok=True)

stage_configs_path = args.stage_configs_path or DEFAULT_STAGE_CONFIG
model_name = args.model or DEFAULT_MODEL

prompt = build_prompt(
Expand All @@ -175,23 +178,39 @@ async def main_streaming(args):
model_name=model_name,
)

omni = AsyncOmni(
omni_kwargs = dict(
model=model_name,
stage_configs_path=stage_configs_path,
log_stats=args.log_stats,
stage_init_timeout=args.stage_init_timeout,
)
if args.deploy_config:
omni_kwargs["deploy_config"] = args.deploy_config
else:
omni_kwargs["stage_configs_path"] = args.stage_configs_path or DEFAULT_STAGE_CONFIG
Comment thread
Liangyx2 marked this conversation as resolved.
Resolved

omni = AsyncOmni(**omni_kwargs)

request_id = "0"
t_start = time.perf_counter()
t_prev = t_start
chunk_idx = 0
all_audio_chunks: list[torch.Tensor] = []
sample_rate = None

async for stage_output in omni.generate(prompt, request_id=request_id):
mm = stage_output.request_output.outputs[0].multimodal_output
if not stage_output.finished:
t_now = time.perf_counter()
audio = mm.get("audio")
if audio is not None:
if isinstance(audio, list):
all_audio_chunks.extend(audio)
else:
all_audio_chunks.append(audio)
sr_raw = mm.get("sr")
if sr_raw is not None:
Comment thread
Liangyx2 marked this conversation as resolved.
Resolved
sr_val = sr_raw[-1] if isinstance(sr_raw, list) and sr_raw else sr_raw
sample_rate = sr_val.item() if hasattr(sr_val, "item") else int(sr_val)
Comment thread
Liangyx2 marked this conversation as resolved.
Resolved
n = len(audio) if isinstance(audio, list) else (0 if audio is None else 1)
dt_ms = (t_now - t_prev) * 1000
ttfa_ms = (t_now - t_start) * 1000
Expand All @@ -202,10 +221,29 @@ async def main_streaming(args):
t_prev = t_now
chunk_idx += 1
else:
# Collect any remaining audio in the final message
audio = mm.get("audio") if mm else None
if audio is not None:
if isinstance(audio, list):
all_audio_chunks.extend(audio)
else:
all_audio_chunks.append(audio)
sr_raw = mm.get("sr") if mm else None
if sr_raw is not None:
sr_val = sr_raw[-1] if isinstance(sr_raw, list) and sr_raw else sr_raw
sample_rate = sr_val.item() if hasattr(sr_val, "item") else int(sr_val)

t_end = time.perf_counter()
total_ms = (t_end - t_start) * 1000
logger.info("Request %s: done total=%.1fms chunks=%d", request_id, total_ms, chunk_idx)
_save_wav(output_dir, request_id, mm)

if all_audio_chunks and sample_rate:
audio_tensor = torch.cat(all_audio_chunks, dim=-1)
out_wav = os.path.join(output_dir, f"output_{request_id}.wav")
sf.write(out_wav, audio_tensor.float().cpu().numpy().flatten(), samplerate=sample_rate, format="WAV")
logger.info("Request %s: saved audio to %s (sr=%d)", request_id, out_wav, sample_rate)
else:
logger.warning("Request %s: no audio chunks received", request_id)


def parse_args():
Expand Down Expand Up @@ -236,11 +274,17 @@ def parse_args():
default=None,
help=f"HuggingFace model path (default: {DEFAULT_MODEL}).",
)
parser.add_argument(
"--deploy-config",
type=str,
default=None,
help="Deploy config YAML path (under vllm_omni/deploy/).",
)
parser.add_argument(
"--stage-configs-path",
type=str,
default=None,
help="Path to stage configs YAML.",
help="Path to stage configs YAML (legacy, prefer --deploy-config).",
)
parser.add_argument(
"--output-dir",
Expand Down
2 changes: 2 additions & 0 deletions vllm_omni/attention/fish_kvcache_attn.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ def can_use_fish_kvcache_attn(


def _is_cuda_graph_capturing() -> bool:
if not torch.cuda.is_available():
return False
return bool(torch.cuda.is_current_stream_capturing())


Expand Down
11 changes: 11 additions & 0 deletions vllm_omni/deploy/fish_qwen3_omni.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,14 @@ stages:
max_tokens: 65536
seed: 42
repetition_penalty: 1.0

platforms:
xpu:
Comment thread
Liangyx2 marked this conversation as resolved.
Resolved
stages:
- stage_id: 0
gpu_memory_utilization: 0.8
max_model_len: 2048
max_num_batched_tokens: 2048
- stage_id: 1
max_model_len: 2048
max_num_batched_tokens: 2048
Loading