Large Language ModelsInference & Performance Optimization
How do you benchmark mixed text, image, audio, and video inference workloads while accurately measuring modality-specific latency, throughput, and GPU resource utilization?
Question 287 of 309 · Updated
On this page
- 1. Why a single tokens-per-second number is misleading
- 2. Define the request path and measurement boundaries
- 3. Build a modality-aware workload manifest
- 4. Normalize work without pretending modalities are equivalent
- 5. Measure stage-level latency and end-to-end user experience
- 6. Measure throughput in modality-specific units
- 7. Instrument GPU and CPU resource use by stage
- 8. Numerical example: why aggregate tokens hide the bottleneck
- 9. Benchmark concurrency and interference between modalities
- 10. Quality and correctness are part of the benchmark
- 11. Production incident: text SLOs collapse during a video burst
- 12. Practical benchmark protocol
- 13. Common mistakes
- 14. Release checklist
- 15. Interview-ready answer
- 16. Further reading
1. Why a single tokens-per-second number is misleading#
A text-only LLM benchmark can often describe work in input and output tokens. A multimodal inference request may also decode images, sample video frames, resample audio, run vision or speech encoders, create modality embeddings, merge them with text tokens, and then execute autoregressive generation. Some pipelines run several of these stages concurrently or on different devices.
Consequently, two requests that each produce 100 text tokens can consume radically different resources. One may contain a short text prompt. Another may contain a high-resolution image, a two-minute audio clip, or a video sampled into dozens of frames. Counting only generated text tokens hides preprocessing cost, encoder utilization, modality-specific queueing, and the amount of input work.
A useful benchmark must answer three questions:
- How much work did each modality introduce?
- Where did time and compute accumulate across the end-to-end request path?
- How does a mixed workload behave when modalities compete for shared CPU, GPU, memory, network, and scheduler capacity?
This lesson is about benchmark design and measurement for multimodal serving. It is distinct from the preceding lesson on adaptive benchmark fidelity: first define correct modality-aware measurements and workloads, then use the fidelity and calibration methods from Question 286 to validate whether cheaper tests predict production behavior.
2. Define the request path and measurement boundaries#
Map the actual execution path for each supported modality before choosing metrics. A common vision-language request may pass through:
- Request parsing, validation, authentication, and payload decoding.
- Image retrieval or upload handling, decompression, resizing, cropping, and patch construction.
- Vision encoder execution and image-feature preparation.
- Prompt assembly, modality-to-token alignment, and text prefill.
- KV-cache allocation and scheduling.
- Autoregressive text decoding.
- Response serialization and streaming to the client.
An audio input path may add codec decoding, sample-rate conversion, channel handling, voice activity detection, chunking, speech encoder execution, and alignment. Audio output may add text-to-speech generation, vocoder work, audio chunk serialization, and synchronization with generated text.
Video adds frame extraction, timestamp handling, frame sampling, image preprocessing for each selected frame, and potentially temporal aggregation. A real-time audio/video stream may overlap ingestion, encoding, reasoning, and response generation. Do not assume a single sequential pipeline if the production system uses pipelining.
Define timestamps at explicit boundaries:
- T0: request accepted by the serving gateway.
- T1: payload fully available to the service.
- T2: modality preprocessing begins.
- T3: modality preprocessing and encoding complete.
- T4: text prefill or decoder prefill begins.
- T5: first user-visible output event is emitted.
- T6: final output event is emitted.
- T7: response is fully delivered or the client disconnects.
Then derive:
- Payload wait = T2 − T0, when payload transfer is part of the measured service objective.
- Modality preprocessing = T3 − T2.
- Queue and scheduling delay = measured queue spans between stage completion and execution start.
- Text prefill = decoder prefill execution span.
- Time to first visible output = T5 − T0.
- Generation duration = T6 − T5, while separately reporting text-token and audio-chunk production.
- End-to-end completion = T7 − T0.
These definitions must match the user experience and the system architecture. If image decoding occurs in an API gateway, either include it in end-to-end latency or report it as a separate upstream span. Never silently exclude a stage and then claim the resulting number is end-to-end latency.
3. Build a modality-aware workload manifest#
A benchmark manifest should describe the actual input work, not just a prompt string and output-token count.
| Modality | Workload features to record |
|---|---|
| Text | Input and output token counts, tokenizer/model revision, prompt class, context length |
| Image | Image count, width, height, aspect ratio, bytes, format, crop/patch count, resolution bucket |
| Audio input | Duration, sample rate, channels, codec, bytes, speech density, silence ratio, chunk count |
| Audio output | Generated duration, sample rate, codec, chunk size, text/audio alignment mode |
| Video | Duration, frame rate, sampled frames, resolution per frame, timestamps, bytes |
| Mixed | Modality combinations, order, synchronization, text-to-media ratio, concurrent stage overlap |
For each feature, retain distributions and percentiles. Image count alone is not enough: one 4K image can require more preprocessing and vision tokens than several small thumbnails. Audio seconds alone are not enough if sample rates, codecs, speech density, and chunking differ. Video duration alone is not enough if one workload samples one frame per second and another samples ten.
Create realistic workload classes such as:
- Text-only chat.
- Single-image question answering.
- Multi-image document or product analysis.
- Short audio transcription.
- Long audio understanding.
- Speech-in/speech-out conversation.
- Short video summarization.
- Long video retrieval with sampled frames.
- Mixed text, image, and audio agent requests.
Preserve correlations. For example, high-resolution images may be more common in document analysis, while long audio may correlate with longer generated summaries. Independent random sampling can create unrealistic combinations. Include both common traffic and rare but resource-intensive cases.
4. Normalize work without pretending modalities are equivalent#
There is no universal conversion from image pixels, audio seconds, video frames, and text tokens into one meaningful token count. A model may turn one image into a variable number of patches or visual tokens depending on resolution, crop strategy, and architecture. Audio encoders may process fixed-duration windows or variable chunks. Video may multiply image work by the sampled frame count and add temporal processing.
Use a vector of workload measures rather than a fabricated single unit:
- Text input tokens and generated tokens.
- Images and processed image pixels.
- Vision patches or encoder input units.
- Audio input seconds and audio output seconds.
- Audio frames or encoder chunks.
- Video seconds, sampled frames, and processed pixels.
- Modality encoder invocations and accelerator time.
- CPU preprocessing time and bytes transferred.
For capacity planning, derive empirical cost coefficients for each model and deployment configuration. For example, estimate GPU milliseconds per image-resolution bucket, per audio second, per video frame, and per generated text token. These are local measurements, not portable physical constants.
A weighted workload unit can be useful for a particular fleet only after it has been calibrated against resource consumption. Keep the original modality dimensions available for diagnosis and fairness. Do not use a weighted unit to hide which workload class consumes the capacity.
5. Measure stage-level latency and end-to-end user experience#
Report latency distributions by modality and request class:
- Preprocessing p50, p90, p95, and p99.
- Encoder queue wait and execution latency.
- Decoder queue wait, prefill latency, and decode latency.
- Time to first visible output.
- Time to first text token, first audio chunk, or first video-related result, as applicable.
- Inter-chunk gaps and streaming stall duration.
- End-to-end completion latency.
- Cancellation, timeout, and partial-response rates.
For audio streaming, first audio chunk latency and inter-chunk cadence can matter more than the time to final completion. For transcription, time to first partial transcript and finalization delay may be separate service objectives. For video summarization, the time to first useful summary and total completion latency may be different objectives.
Do not average stage latencies across requests and add the averages if stages overlap. For a pipelined request, end-to-end time is determined by the critical path, not necessarily the sum of every stage's aggregate duration. Use per-request trace spans and dependency relationships to reconstruct the critical path.
Always report both aggregate and per-class metrics. An overall p95 can conceal severe p99 regressions for video or long audio if those classes are a small fraction of traffic.
6. Measure throughput in modality-specific units#
A benchmark should report:
- Requests per second and successful requests per second.
- Text input tokens/sec and generated text tokens/sec.
- Images/sec, processed megapixels/sec, and vision encoder invocations/sec.
- Audio input seconds/sec, audio chunks/sec, and generated audio seconds/sec.
- Video frames/sec and video seconds processed/sec.
- Mixed-workload goodput: requests meeting their class-specific latency and quality objectives per second.
State whether throughput is aggregate across replicas or per accelerator. Include the number and type of GPUs, CPU allocation, model replicas, tensor/pipeline parallelism, and serving engine configuration.
A system processing 500 images/sec at low resolution is not directly comparable with one processing 500 high-resolution images/sec. A system transcribing 20 audio hours per wall-clock hour is not directly comparable with one handling live speech at real-time latency. Throughput units must retain the workload definition.
For streaming services, measure cadence and continuity. A service may generate audio at a high aggregate rate but deliver chunks irregularly, creating poor user experience. Record chunk production time, chunk delivery time, jitter, and underruns where applicable.
7. Instrument GPU and CPU resource use by stage#
At minimum collect:
- GPU utilization and per-process or per-engine utilization where available.
- GPU memory allocated, reserved, peak, and fragmentation indicators.
- Memory bandwidth and relevant copy/transfer activity.
- SM and tensor-core activity where supported.
- CPU utilization by preprocessing worker and serving process.
- Host RAM, pinned memory, and page faults.
- PCIe or interconnect throughput and transfer wait.
- Encoder and decoder queue depth.
- Cache hit rates, cache occupancy, and evictions.
- Power draw and clock behavior where available.
Aggregate GPU utilization alone is insufficient. A GPU can show high utilization while one modality encoder starves decoder work, or low utilization while the service is bottlenecked on CPU image decoding, storage, or host-to-device transfers.
Use stage-scoped profiling and trace correlation. Attribute resource time to preprocessing, modality encoder, text prefill, decode, and postprocessing where the platform supports it. If the hardware profiler cannot isolate shared kernels, state that limitation and avoid false precision.
Measure resource use per successful request and per modality-specific unit. For example:
- GPU-seconds per 1,000 generated text tokens.
- GPU-seconds per 100 processed images in a defined resolution bucket.
- GPU-seconds per audio minute transcribed.
- GPU-seconds per video minute at a defined frame sampling rate.
- CPU-seconds per request and host-to-device bytes per image.
Include failed and cancelled work in cost accounting. If a request consumes substantial encoder compute and then times out, excluding it makes the service appear cheaper than it is.
8. Numerical example: why aggregate tokens hide the bottleneck#
Consider a two-GPU serving deployment tested for 10 minutes. It receives 600 requests:
- 300 text-only requests.
- 150 image requests, each with two 1-megapixel images.
- 100 audio requests, each with 30 seconds of input audio.
- 50 video requests, each with 20 seconds of video sampled at one frame per second.
The benchmark processes:
- 300 text requests × 800 input tokens = 240,000 text input tokens.
- 300 text requests × 120 generated tokens = 36,000 generated tokens.
- 150 image requests × 2 images = 300 images and 300 megapixels.
- 100 audio requests × 30 seconds = 3,000 audio seconds, or 50 audio minutes.
- 50 video requests × 20 sampled frames = 1,000 video frames.
Suppose stage telemetry shows 18 GPU-seconds spent on vision encoding, 24 GPU-seconds on audio encoding, 30 GPU-seconds on video frame encoding, and 48 GPU-seconds on text prefill and decode. Total measured accelerator time is 120 GPU-seconds across the ten-minute wall-clock interval.
The modality shares of measured GPU time are:
- Vision: 18 / 120 = 15%.
- Audio: 24 / 120 = 20%.
- Video: 30 / 120 = 25%.
- Text prefill and decode: 48 / 120 = 40%.
The video requests are only 8.3% of requests (50 / 600), but consume 25% of measured GPU time. A dashboard showing only generated text tokens would report 36,000 tokens and miss this disproportionate video cost.
The deployment's aggregate accelerator utilization averaged 10% if the 120 GPU-seconds are divided by two GPUs × 600 seconds. That average can still hide short periods of saturation in the vision encoder or a queueing bottleneck on the CPU preprocessing pool. Stage-level utilization and per-class latency are necessary to find the constraint.
If video preprocessing is moved to a separate CPU/GPU pool, rerun the mixed benchmark and compare end-to-end latency, resource use, and goodput. Do not declare success based solely on reducing decoder GPU utilization; the total system may simply have shifted work and cost elsewhere.
9. Benchmark concurrency and interference between modalities#
Test each modality alone first to establish baselines, then test mixed workloads. This separates intrinsic stage cost from contention.
A useful experiment matrix includes:
- Text-only baseline.
- Image-only baseline at several resolutions and image counts.
- Audio-only baseline at several durations and chunk sizes.
- Video-only baseline at several frame rates and resolutions.
- Pairwise mixes, such as text plus image and audio plus text.
- Production-weighted mixed traffic.
- Adversarial stress mixes with long video, high-resolution images, and long audio arriving in bursts.
Measure whether a modality causes head-of-line blocking for another. For example, a large video request may monopolize preprocessing workers or encoder capacity, delaying short text requests that share a scheduler. Record queue wait by stage and request class, not just total queue length.
Test both open-loop arrival rates and realistic concurrency. Closed-loop clients may reduce offered load when responses slow. For streaming audio/video, also model session duration, frame/chunk arrival cadence, and simultaneous active sessions. A request-count-only workload does not represent a long-lived stream.
Check fairness and isolation. A mixed-workload scheduler should prevent a small number of expensive media requests from consuming all shared capacity if latency-sensitive text or speech requests have separate SLOs. Report per-class goodput and tail latency before and after any scheduling policy change.
10. Quality and correctness are part of the benchmark#
A fast but incorrect multimodal response is not useful. Keep a representative quality set for each task:
- Image question answering: answer correctness and grounding against the image.
- Document understanding: extraction accuracy and layout-sensitive fields.
- Audio transcription: word error rate or task-appropriate transcription metric.
- Speech generation: intelligibility, alignment, and task-specific audio quality.
- Video summarization: factual coverage, temporal grounding, and hallucination rate.
Use fixed evaluation inputs for regression tests and a separate workload sample for load tests. Avoid scoring every high-volume stress request if evaluation cost changes the load profile; instead use controlled sampling and clearly report the sample rate.
Record model, processor, tokenizer, codec, sampling, and decoding revisions. A change in image resizing or audio resampling can change both quality and compute cost. Compare quality at equivalent task difficulty and input fidelity.
11. Production incident: text SLOs collapse during a video burst#
A multimodal assistant serves chat, image questions, and video summaries on a shared GPU pool. The text-only benchmark passes. A mixed test reports acceptable aggregate requests/sec, so the team increases traffic.
During a product launch, users upload many long clips. Video frame extraction and vision encoding saturate the shared preprocessing and encoder path. Text requests wait behind large media jobs; p99 TTFT rises, audio chunk cadence becomes irregular, and video requests themselves also time out because their queues grow.
The dashboard reports healthy average GPU utilization and high generated text tokens/sec. It does not expose modality-specific queue wait, frame counts, preprocessing CPU saturation, or per-class goodput. The team initially adds decoder replicas, which increases memory pressure but does not remove the upstream bottleneck.
The corrective work:
- Adds stage spans for payload decode, frame extraction, image/audio preprocessing, encoders, decoder prefill/decode, and response delivery.
- Adds modality-specific workload manifests and per-class latency and goodput dashboards.
- Separates or limits video preprocessing concurrency and uses bounded queues.
- Applies admission control based on estimated frame and encoder work, not request count alone.
- Protects latency-sensitive text and live audio with reserved capacity or priority scheduling.
- Replays the launch traffic mix and validates p99 latency, quality, and total cost.
The root cause was not insufficient decoder throughput. It was shared upstream modality processing and queue contention hidden by aggregate metrics.
12. Practical benchmark protocol#
A repeatable multimodal benchmark should proceed in this order:
A. Validate functionality. Check every modality path, supported formats, dimensions, sample rates, frame timestamps, streaming behavior, and failure handling.
B. Establish isolated baselines. Run each modality independently across representative input sizes. Measure per-stage latency, throughput, resource use, and quality.
C. Build realistic mixed traffic. Preserve modality proportions, input-size distributions, correlations, arrival timing, session duration, and cache behavior.
D. Sweep load. Increase open-loop arrival rate or active sessions until goodput stops increasing or a class-specific SLO is violated. Include burst and soak tests.
E. Attribute bottlenecks. Correlate per-request traces with CPU/GPU telemetry, queue depth, memory pressure, and data-transfer activity.
F. Validate the change. Compare before and after using the same workload manifest, seeds, model revisions, hardware, and measurement windows. Report class-specific outcomes and total fleet cost.
G. Revalidate production fidelity. Use Question 286's proxy-calibration approach: compare cheaper mixed-workload tests with full trace replay, and promote candidates whose uncertainty crosses an SLO or whose modality mix is outside the calibration domain.
13. Common mistakes#
- Reporting only generated text tokens/sec for a multimodal service.
- Treating one image as a fixed number of text tokens across resolutions and models.
- Reporting video duration without frame sampling rate or frame resolution.
- Reporting audio seconds without sample rate, codec, chunk size, and speech characteristics.
- Measuring only decoder time and omitting preprocessing and encoders.
- Averaging GPU utilization across the whole run and missing short stage saturation.
- Adding stage averages even when stages overlap.
- Testing modalities independently but never testing mixed contention.
- Ignoring streaming chunk cadence and long-lived session concurrency.
- Excluding failed or cancelled requests from resource-cost calculations.
- Comparing throughput without matching hardware, model, processor, and workload manifest.
- Treating speed as success without checking modality-specific quality.
14. Release checklist#
- [ ] Each modality's request path and timing boundaries are documented.
- [ ] The manifest captures text tokens, image dimensions, audio duration, video frames, and mixed combinations.
- [ ] Latency is reported by stage, request class, and percentile.
- [ ] First-visible-output and streaming cadence metrics are defined.
- [ ] Throughput uses modality-specific units and successful goodput.
- [ ] GPU, CPU, memory, transfer, and queue telemetry is collected.
- [ ] Resource cost includes failures, retries, and cancelled work.
- [ ] Each modality has isolated baselines and quality checks.
- [ ] Mixed and bursty workloads test cross-modality interference.
- [ ] Per-class SLOs and fairness are checked.
- [ ] Results include full model, processor, hardware, and workload manifests.
- [ ] Lower-fidelity results are calibrated against production-like mixed trace replay.
15. Interview-ready answer#
I would first map each modality's full request path, from payload handling and preprocessing through encoder execution, text prefill/decode, and streaming response delivery. I would define stage timestamps and report end-to-end latency as well as modality-specific spans. The workload manifest would capture text tokens, image count and resolution, audio duration and sample rate, video frame count and sampling rate, and the correlations between these features.
I would report separate throughput units—text tokens, images or megapixels, audio seconds, video frames—and successful requests meeting class-specific SLOs. I would correlate stage traces with GPU, CPU, memory, transfer, and queue telemetry, then test isolated modalities and realistic mixed traffic to expose interference and head-of-line blocking. Finally, I would validate output quality, include failures in cost accounting, and calibrate low-cost tests against full production-like mixed-workload replay. One aggregate tokens-per-second metric is not enough to operate a multimodal inference service.
16. Further reading#
- vLLM, Multimodal Processor Benchmark: https://docs.vllm.ai/en/latest/cli/bench/mm_processor/
- vLLM, Benchmark CLI and multimodal processor metrics: https://github.com/vllm-project/vllm/blob/main/docs/benchmarking/cli.md
- NVIDIA AIPerf, Benchmarking LLM Inference at Scale: https://docs.dynamo.nvidia.com/dynamo/dev/digest/aiperf-benchmarking
- NVIDIA AIPerf comprehensive benchmarking guide: https://docs.nvidia.com/aiperf/getting-started/ai-perf-comprehensive-llm-benchmarking
- MLPerf Inference v6.1, VLM and agentic workload coverage: https://lambda.com/blog/mlperf-inference-v6.1
- Rocks, Pebbles and Sand: Modality-aware Scheduling for Multimodal Large Language Model Inference: https://arxiv.org/abs/2603.26498
References
- 1.vLLM Multimodal Processor Benchmarkdocs.vllm.ai
- 2.vLLM Benchmark CLIgithub.com
- 3.NVIDIA AIPerf Benchmarkingdocs.dynamo.nvidia.com
- 4.NVIDIA AIPerf Comprehensive Benchmarkingdocs.nvidia.com
- 5.
- 6.
Related questions
- How do you benchmark and profile LLM inference performance?
- How do you optimize GPU utilization across mixed interactive and batch LLM inference workloads while preserving latency isolation?
- How do you design modality-aware admission control and scheduling to prevent expensive image, audio, and video requests from starving latency-sensitive text and real-time speech inference?
Explore other topics:Deep LearningRetrieval-Augmented GenerationAI Agents