agentleFS
vllm-projectvllm-project/vllm-omni/.claude/skills/omni-perf-opt/SKILL.md

omni-perf-opt

Skill7.8k starsChanged 3 days agoApache-2.0View on GitHub

Diagnose and optimize serving performance of multi-stage autoregressive omni models in vLLM-Omni (Qwen3-Omni, Qwen2.5-Omni, MiniCPM-o, and similar thinker/talker/code2wav pipelines). Use when asked to lower TTFT or first-audio latency (AUDIO_TTFP), keep AUDIO_RTF below 1 under load, raise throughput or concurrency, fit stages on fewer GPUs, fix choppy streaming audio, attribute latency to a stage or connector, tune deploy YAML performance knobs (batching, CUDA graphs, async_chunk codec chunking, MRv2, replicas), or plan and validate omni performance PRs. Diffusion workloads use `diffusion-perf-opt`.

Adopted by

Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data

Week of Sep 20: 0 new projectsWeek of Sep 27: 0 new projectsWeek of Oct 4: 0 new projectsWeek of Oct 11: 0 new projectsWeek of Oct 18: 0 new projectsWeek of Oct 25: 0 new projectsWeek of Nov 1: 0 new projectsWeek of Nov 8: 0 new projects
Sep 2026Oct 2026Nov 2026
New projects taking a version of this file each week, over the 8 weeks our latest run read: only 0 in all, so this is a hint, not a trend.

Who's talking about vllm-project/vllm-omni

The biggest 5 of 51 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 51

Talked about on GitHub and Hacker News (51 times).

On GitHub · 50

45 more on GitHub

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 8 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run a disciplined loop: freeze commands, measure a low-overhead baseline, attribute the gap to one stage or hop, change one lever, and …

    line 8
  2. Distinctive:

    Ask for anything not already known:

    line 15
  3. Distinctive:

    Freeze three commands: Write them as scripts with every variable explicit:

    line 34
  4. Distinctive:

    Collect a real baseline: No torch profiler, no orchestrator monitor.

    line 44
  5. Distinctive:

    Pick a lever: Use references/optimization-playbook.md.

    line 55
  6. Very specific:

    Keep operator/shape traces and host-stack traces separate.

    line 70
  7. Distinctive:

    Every optimization needs correctness evidence on the same workload, including "math-preserving" changes.

    line 91
  8. Distinctive:

    When the talker saturates, add talker replicas before raising thinker batch limits.

    line 132
  9. Distinctive:

    Never report profiler-enabled latency as a result.

    line 152

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Omni Model Performance Optimization

Run a disciplined loop: freeze commands, measure a low-overhead baseline, attribute the gap to one stage or hop, change one lever, and prove the gain without losing quality. Profiler traces diagnose; they never supply the final latency number.

First questions

Ask for anything not already known:

  • Hardware: accelerator model and count, interconnect, device sharing, and backend software stack (for Ascend: CANN, torch-npu, and vllm-ascend).
  • Model, checkpoint, vLLM and vLLM-Omni commits, and the deploy YAML actually loaded (default or --deploy-config, its base_config chain, platform section, --stage-overrides).
  • Session mode: turn (HTTP) or duplex (realtime). They have different defaults and different MRv2 support.
  • Workload: input modalities and sizes, output modalities (text only or text plus audio), output length, concurrency or request rate, streaming or not.
  • Target: TTFT, AUDIO_TTFP, AUDIO_RTF, audio continuity, throughput at a given concurrency, GPU count, or memory. Name one primary metric and its percentile (mean, P90, P99).
  • Quality tolerance: bitwise, within run-to-run variance, or a stated accuracy and WER budget. Default to quality-preserving.

Workflow

  1. Freeze three commands. Write them as scripts with every variable explicit:
    • server: vllm serve <model> --omni --deploy-config ... [--stage-overrides ...]
    • single request: one fixed /v1/chat/completions (or /v1/audio/speech, /v1/realtime) payload with fixed media, seed, and modalities
    • benchmark: vllm bench serve --omni ... with fixed dataset, prompt count, concurrency or rate, --extra-body, --percentile-metrics, --print-stage, --save-result Templates: references/measurement-protocol.md.
  2. Collect a real baseline. No torch profiler, no orchestrator monitor. Warm up (graph capture and first-request compilation distort small runs). Sweep concurrency at 1, a middle value, and the target. Record mean and P99 TTFT, AUDIO_TTFP, AUDIO_RTF, E2EL, throughput, failures, and audio_continuity_ok_rate. Run the accuracy baseline on the same build.
  3. Attribute the gap to a stage or hop. Re-run with --log-stats (per-stage wall time, stage_gen_time_ms, connector tx_time_ms, rx_decode_time_ms, in_flight_time_ms) and --print-stage. Classify with the bottleneck table below before touching code.
  4. Pick a lever. Use references/optimization-playbook.md. Try configuration-only levers before code changes, and existing model options before new kernels.
  5. A/B one variable at a time. Same hardware, commits, dataset, seed, prompt count, concurrency, and --extra-body. When the change is behind a switch, run every column on the same head and toggle the switch. Stacked changes get one column each.
  6. Pass the quality gate. See below. A failed or inconclusive gate blocks a ready claim.
  7. Trace only after narrowing. Profile the stage you already suspect: per-stage profiler_config through --stage-overrides, warm up, then POST /start_profile and POST /stop_profile with {"stages": [...]}. Keep operator/shape traces and host-stack traces separate. For timelines, reuse .claude/skills/diffusion-perf-opt/scripts/trace_analyzer.py.
  8. Write the plan. Classify candidates P0/P1/P2, tie each to evidence, and let the user choose before implementing anything above P0.

Bottleneck table

EvidenceLikely bottleneckFirst levers
High TTFT, thinker prefill dominatesThinker prefill or multimodal encodingEncoder CUDA graphs, max_num_batched_tokens, thinker TP, dedicated thinker GPU
Good TTFT, high AUDIO_TTFPTalker first chunk or code2wav first decodeinitial_codec_chunk_frames, MRv2 talker_first_audio + codec_chunk_ramp, first-chunk express
AUDIO_RTF ≥ 1 as concurrency risesTalker or code2wav saturatedStage max_num_seqs, CUDA graphs, talker replicas, code2wav graph batch sizes
Good mean RTF, low audio_continuity_ok_rateBursty chunk deliverycodec_chunk_frames, codec_left_context_frames, first-chunk express slack
High connector in_flight_time_ms or rx_decode_time_msTransport or payload sizeConnector type, payload trimming, co-location
High latency while GPUs idleOrchestrator loop or queue backlog--enable-orch-monitor, event-driven orchestrator, replica balance
OOM or cannot co-locateMemory splitgpu_memory_utilization, kv_cache_memory_bytes, graph budgets, MPS
Client time far above server timeClient, streaming encode, or networkResponse format, chunk size, bench client placement

Quality gate

Every optimization needs correctness evidence on the same workload, including "math-preserving" changes.

  • Text: thinker greedy output unchanged, or accuracy (Daily-Omni, Video-MME) within baseline run-to-run variance.
  • Speech: Seed-TTS WER (--seed-tts-wer-eval) within variance; for bitwise-claimed changes, identical codec ids and waveform for a fixed seed.
  • Streaming: same duration, no truncation or repetition, and audio_continuity_ok_rate not worse.
  • Concurrency: per-request outputs at concurrency 2+ equal single-request outputs.
  • Graphs: graph mode matches a control with outer and model-internal graphs explicitly disabled for touched stages; verify the effective switches.
  • Precision changes (TF32, fused kernels, cuDNN algorithm search, short KV, quantization) must state that rounding changes and show the metric delta.

Priority rules

  • P0: measurement fixes and configuration-only changes with low risk (warmup, frozen commands, batch limits, placement, replicas, existing opt-in deploy profiles, chunk sizes).
  • P1: contained code changes (graph capture for a new stage path, host sync removal, payload trimming, scheduler batching, fused existing ops).
  • P2: numerics-changing or invasive work (new custom kernels, TF32 or FP8 paths, short-KV attention, algorithm changes, MRv2 enablement for a new model).

Present the plan as a table (priority, stage, lever, evidence, expected gain, validation, quality risk), then ask which item to implement. Proceed alone only on P0 measurement or instrumentation fixes.

Omni heuristics

  • async_chunk trades total compute for first-audio latency. It cuts AUDIO_TTFP sharply but can raise E2EL and RTF; offline batch jobs may be faster without it. Judge it against the stated primary metric.
  • Streaming output and async_chunk depend on each other: without async_chunk streaming cannot start early, and without streaming the client does not see the earlier first packet.
  • For the three-stage CUDA examples, start with a dedicated thinker GPU; verify stage costs before applying this placement to a different topology. When the talker saturates, add talker replicas before raising thinker batch limits.
  • Prefix caching is stage- and profile-specific. Default qwen3_omni_moe.yaml uses MRv2 on CUDA with Thinker prefix caching on; Talker and Code2Wav keep it off. The specialized qwen3_omni_moe_mrv2.yaml overlay and non-CUDA platform sections disable Thinker caching. Talker first-frame and fused MTP fast paths require caching off on the Talker, independently of Thinker caching. MiniCPM-o's default duplex deploy keeps caching off; its CUDA turn profile enables it for llm (stage 0), while the turn MRv2 overlay disables it again. Inspect the effective YAML before changing it.
  • MRv2 output is not bitwise identical to V1. Re-measure MRv2 numbers after any runner change; MiniCPM-o's earlier MRv2 numbers were invalidated. MRv2 downstream stages support turn mode; duplex needs its own profile and its own measurement.
  • Stages sharing one GPU under MRv2 should run under NVIDIA MPS.
  • Graph caches have fixed budgets. When a budget fills, uncached shapes run eagerly: correct but slower. Check startup capture logs after changing batch sizes or graph caps.
  • The orchestrator is event-driven by default (VLLM_OMNI_EVENT_DRIVEN_ORCH unset). Orchestrator monitor counts are not comparable across loop modes.
  • Never report profiler-enabled latency as a result.

Report template

## Summary
[Outcome, primary metric delta, and the stage it came from]

## Setup
- vllm-omni <sha>, vllm <sha>, <accelerator x N>, driver/backend versions
- Deploy: <yaml> + <overrides>; session mode <turn|duplex>
- Commands: serve / request / bench (scripts or exact lines)

## Results (warmup <w>, measured <n> requests, concurrency <c>)
| Metric | Baseline | Candidate | Delta |
|--------|----------|-----------|-------|
| TTFT mean / P99 (ms) | | | |
| AUDIO_TTFP mean / P99 (ms) | | | |
| AUDIO_RTF mean / P99 | | | |
| Throughput (req/s or audio-s/s) | | | |
| audio_continuity_ok_rate | | | |
| Failures | | | |

## Stage attribution
| Row | Baseline | Candidate |
|-----|----------|-----------|
| Stage 0 gen (ms) | | |
| Stage 1 gen (ms) | | |
| Stage 2 gen (ms) | | |
| Connector in-flight (ms) | | |
Isolation: [metric that stayed unchanged, isolating the gain to <stage>]

## Quality
[Accuracy / WER / parity result versus baseline variance]

## Next steps
[Candidate table or chosen item]

References

  • references/measurement-protocol.md: command templates, metric definitions, diagnostics, A/B rules
  • references/optimization-playbook.md: levers by layer with knobs, evidence, and validation
  • .claude/skills/vllm-omni/references/models/qwen3-omni.md, .claude/skills/vllm-omni/references/models/minicpm-o.md: model profiles
  • docs/design/qwen3_omni_tts_performance_optimization.md, docs/design/qwen3_omni_mrv2_performance.md, docs/design/minicpm_o45_mrv2_performance.md: design evidence
  • docs/contributing/profiling.md (sections on Omni AR/TTS stages and the orchestrator monitor), docs/contributing/metrics.md
  • .claude/skills/review-pr/references/checks/perf-verification.md: what reviewers will ask for
  • omni-perf-ceiling: reachable ceiling and per-stage headroom before choosing levers
  • quantization skill for precision work; vllm-omni-test for perf JSON rows under tests/dfx/perf/tests/

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.