Compare commits

...
13 Commits
Author SHA1 Message Date
Roger Wang 27c6917149 update
Signed-off-by: Roger Wang <hey@rogerw.io>
2025-11-27 01:24:32 +00:00
Roger Wang a2dd5feb80 test
Signed-off-by: Roger Wang <hey@rogerw.io>
2025-11-27 00:59:38 +00:00
Roger Wang 779aa534ba add back
Signed-off-by: Roger Wang <hey@rogerw.io>
2025-11-27 00:27:17 +00:00
Roger Wang effe5b347f Merge branch 'main' into buildkite-2 2025-11-27 00:24:54 +00:00
Roger Wang 42426e7c10 update
Signed-off-by: Roger Wang <hey@rogerw.io>
2025-11-27 00:14:41 +00:00
Roger Wang 1a6879b8a4 dummify
Signed-off-by: Roger Wang <hey@rogerw.io>
2025-11-27 00:10:27 +00:00
Roger Wang 3a3aebde0c test
Signed-off-by: Roger Wang <hey@rogerw.io>
2025-11-27 00:05:04 +00:00
Roger Wang b5bb75a032 update
Signed-off-by: Roger Wang <hey@rogerw.io>
2025-11-23 21:09:58 -08:00
Roger Wang 0e48b214da update
Signed-off-by: Roger Wang <hey@rogerw.io>
2025-11-23 21:03:46 -08:00
Roger Wang dc45f1b5cd update
Signed-off-by: Roger Wang <hey@rogerw.io>
2025-11-23 20:59:30 -08:00
Roger Wang c0a264452c update
Signed-off-by: Roger Wang <hey@rogerw.io>
2025-11-23 19:55:56 -08:00
Roger Wang 35e063e102 update
Signed-off-by: Roger Wang <hey@rogerw.io>
2025-11-23 19:24:02 -08:00
Roger Wang 89b1bdbb0e add
Signed-off-by: Roger Wang <hey@rogerw.io>
2025-11-23 19:12:58 -08:00
3 changed files with 72 additions and 25 deletions

No files matched your search

+4 -5
View File
@@ -1,7 +1,6 @@
steps:
- label: "Dummy pipeline"
if: "false"
agents:
queue: cpu_queue_premerge_us_east_1
- label: ":toolbox: Qwen2.5 omni offline example"
commands:
- "echo 'This pipeline is intentionally a no-op.'"
- ".buildkite/scripts/run_qwen_offline_example.sh"
agents:
queue: "gpu_1_queue" # g6.4xlarge instance on AWS, has 1 L4 GPU
+33
View File
@@ -0,0 +1,33 @@
#!/usr/bin/env bash
set -euo pipefail
# Move to repo root (script lives in .buildkite/scripts/)
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
cd "${ROOT_DIR}"
UV_INSTALL_DIR="${ROOT_DIR}/.local/bin"
case ":${PATH}:" in
*":${UV_INSTALL_DIR}:"*) ;;
*) export PATH="${UV_INSTALL_DIR}:${PATH}" ;;
esac
if ! command -v uv >/dev/null 2>&1; then
mkdir -p "${UV_INSTALL_DIR}"
curl -LsSf https://astral.sh/uv/install.sh | env UV_INSTALL_DIR="${UV_INSTALL_DIR}" sh
fi
UV_BIN=(uv)
"${UV_BIN[@]}" python install 3.12
"${UV_BIN[@]}" venv --python 3.12 .venv
source .venv/bin/activate
"${UV_BIN[@]}" pip install -e .
"${UV_BIN[@]}" pip install vllm==0.11.0 --torch-backend=auto
EXAMPLE_DIR="examples/offline_inference/qwen2_5_omni"
cd "${EXAMPLE_DIR}"
python end2end.py --query-type text \
--no-save-results
@@ -5,6 +5,7 @@ This example shows how to use vLLM-omni for running offline inference
with the correct prompt format on Qwen2.5-Omni
"""
import argparse
import os
from typing import NamedTuple
@@ -195,35 +196,43 @@ def main(args):
omni_outputs = omni_llm.generate(prompts, sampling_params_list)
# Determine output directory: prefer --output-dir; fallback to --output-wav
output_dir = args.output_dir if getattr(args, "output_dir", None) else args.output_wav
os.makedirs(output_dir, exist_ok=True)
output_dir = None
if args.save_results:
# Determine output directory: prefer --output-dir; fallback to --output-wav
output_dir = args.output_dir if getattr(args, "output_dir", None) else args.output_wav
os.makedirs(output_dir, exist_ok=True)
for stage_outputs in omni_outputs:
if stage_outputs.final_output_type == "text":
for output in stage_outputs.request_output:
request_id = int(output.request_id)
text_output = output.outputs[0].text
# Save aligned text file per request
prompt_text = prompts[request_id]["prompt"]
out_txt = os.path.join(output_dir, f"{request_id:05d}.txt")
lines = []
lines.append("Prompt:\n")
lines.append(str(prompt_text) + "\n")
lines.append("vllm_text_output:\n")
lines.append(str(text_output).strip() + "\n")
try:
with open(out_txt, "w", encoding="utf-8") as f:
f.writelines(lines)
except Exception as e:
print(f"[Warn] Failed writing text file {out_txt}: {e}")
print(f"Request ID: {request_id}, Text saved to {out_txt}")
if args.save_results:
# Save aligned text file per request
prompt_text = prompts[request_id]["prompt"]
out_txt = os.path.join(output_dir, f"{request_id:05d}.txt")
lines = []
lines.append("Prompt:\n")
lines.append(str(prompt_text) + "\n")
lines.append("vllm_text_output:\n")
lines.append(str(text_output).strip() + "\n")
try:
with open(out_txt, "w", encoding="utf-8") as f:
f.writelines(lines)
except Exception as e:
print(f"[Warn] Failed writing text file {out_txt}: {e}")
print(f"Request ID: {request_id}, Text saved to {out_txt}")
else:
print(f"Request ID: {request_id}, Text output:\n{text_output}")
elif stage_outputs.final_output_type == "audio":
for output in stage_outputs.request_output:
request_id = int(output.request_id)
audio_tensor = output.multimodal_output["audio"]
output_wav = os.path.join(output_dir, f"output_{output.request_id}.wav")
sf.write(output_wav, audio_tensor.detach().cpu().numpy(), samplerate=24000)
print(f"Request ID: {request_id}, Saved audio to {output_wav}")
if args.save_results:
output_wav = os.path.join(output_dir, f"output_{output.request_id}.wav")
sf.write(output_wav, audio_tensor.detach().cpu().numpy(), samplerate=24000)
print(f"Request ID: {request_id}, Saved audio to {output_wav}")
else:
print(f"Request ID: {request_id}, Received audio output (not saved).")
def parse_args():
@@ -266,6 +275,12 @@ def parse_args():
default=65536,
help="Threshold for using shared memory in bytes (default: 65536)",
)
parser.add_argument(
"--save-results",
action=argparse.BooleanOptionalAction,
default=True,
help="Save text/audio outputs to files (default: enabled). Use --no-save-results to disable.",
)
parser.add_argument(
"--output-wav",
default="output_audio",