Specialist Supplier of Crystals & Frequency Control Componentssales@mecxtal.com.cn0755-26500570
MERLIN home / Rednote / System Validation and Replacement

Measuring First-Image Queue Delay When Batching Raises Inference Throughput | Crystal & Oscillator Handbook

Throughput counts completions in a window. First-result latency measures how long one input waits. Dynamic batching can improve the former by delaying the latter.

An owned edge system gets higher sustained throughput and a slower result for a single arrival. Acquisition and the 100 MHz reference are unchanged. Separate arrival, dispatch, execution, and visible output. A scheduler can wait briefly for more inputs, with the first waiting longest.

Identify the image, wait, and processing stage

Dynamic batching combines otherwise independent inference jobs for execution together. On suitable parallel hardware, a batch may take less total time than processing the same images individually. The result depends on the model, data shape, hardware, implementation, and workload. A throughput improvement in one test does not establish that all devices will finish faster. Some schedulers permit a limited wait to build a batch when requests arrive slowly.

Record when each request arrives, when scheduled execution starts, when computation or other processing ends, and when the application result becomes visible. End-to-end latency includes every stage. Dividing batch execution time by the number of images estimates an average share of the compute time. It does not give one image's end-to-end delay. Results per second likewise do not give the wait after an individual request.

If the camera delivers images at fixed intervals, verify that image and application request IDs correspond. A late first frame can originate in the capture chain, wait for a batch, or take longer in result processing. Compare those timestamps on a common basis to locate the change.

Example: two milliseconds less compute but a later first result

Four synthetic requests arrive at 0, 0.5, 1.0, and 1.5 ms. Assume one execution slot. One-at-a-time execution takes 1.5 ms per image, giving the first result at 1.5 ms and the last at 6.0 ms. This omits loading, transfer, and return overhead.

If four arrive before one 4 ms batch starts at 1.5 ms, all complete at 5.5 ms. Compute falls from 6 to 4 ms and completion of the last image is earlier, but first result moves from 1.5 to 5.5 ms. The 1 ms per-item average is not first-result latency.

ModeFirst resultLast resultInterpretation
Serial single items1.5 ms6.0 msFirst fast, later requests queue
Wait for four and batch5.5 ms5.5 msEntire set earlier, first slower

A real service may start a partial batch at its wait limit, use multiple compute units, or queue behind earlier work. The table neither assumes every group of four arrives together nor predicts that the service actually batches them. It illustrates how throughput and latency can move in opposite directions. It does not set a supplier response requirement.

Qualify the 100 MHz reference separately from scheduling

Taitien's OO-U from Taiwan has a suitable 100 MHz LVDS option for a compatible input. Verify full code, supply, load, temperature, and jitter convention. This is not an installed product part or processor core clock.

The nominal 100 MHz period is 10 ns. Verify the external reference against electrical requirements if it is part of the actual signal path. Milliseconds of queueing and batching belong to another layer and cannot reveal how many oscillator cycles were missed. Investigate independent clock or interface changes separately. If only the wait to form a batch changes, hold the workload constant and examine scheduling.

Retain throughput and first-result latency

Use the same model, input dimensions, and verified version for isolated bench archives or offline data. Keep sparse, short burst, and sustained input records separately. For each image, retain arrival, dispatch, execution start, and output time. If only some times are visible, document the covered interval without inferring individual delay from throughput. Separate startup and warm-up from steady use because they can also delay the first result.

CheckEvidenceError avoided
InputImage and request IDs, arrival pattern, target batchSubstituting steady requests for intermittent ones
SchedulingArrival, start, actual batch sizeCalling batch wait compute slowdown
OutputFirst result, latency percentiles, useful throughputReplacing observed response with batch average
ClockExact part, supply, pointUsing application results as component evidence

If procurement needs timely responses, specify first-image and tail-latency limits and the arrival pattern for throughput measurements. A maximum images-per-second figure does not establish prompt service when images are sparse. Qualify the timing supplier against the required electrical output separately from scheduling behavior.

Frequently asked questions

Does a larger batch always make responses slower? It depends on arrival and execution. Measure waiting, compute, and return separately.

Does unchanged capture cadence rule out software? Inference scheduling can change at the same cadence. Trace each image.

Report both completions under continuous input and the time until the first result under the specified arrival conditions. Verify both using the same controlled data so a throughput gain can be assessed alongside any added waiting time.

Separate low-load latency from congestion. One image arriving after a long idle period tests how long it takes to launch the next calculation. A queue of existing requests can add time while a previous batch occupies the execution resources. Combining those cases in a single average can hide whether the delay came from forming a batch or from existing work. Retain actual batch sizes and wait distributions and identify the arrival pattern for each group. Small synthetic examples cannot guarantee tail-latency percentiles in production.

If procurement requires timely notification of an anomalous image, measure through a verifiable application output. Server-side inference completion does not establish that a user received the result. Image transfer, result screening, and display updates may take more time. Compare samples at the same endpoint and set separate acceptance criteria aligned with the board reference, compute module, and scheduling software.

WeChat

MERLIN · TIMING COMPONENTS

Scan with WeChat to contact Sales

Add our WeCom contacts from your usual WeChat app.

On desktop, scan with your phone. On mobile, save the QR image and select it from your album in WeChat Scan.