Computer Vision Inference Optimization
Optimize a measured image, document, retrieval, or video execution path. Freeze the
workload and quality contract, then locate the first bottleneck before changing input
resolution, precision, model, runtime, batching, or topology.
Core Rules
- Define workload classes by media type, resolution, codec, frame or clip length,
arrival pattern, concurrency, device, and required output.
- Measure capture/read, decode, color conversion, preprocessing, transfer, model,
postprocessing, tracking/indexing, serialization, queueing, and end-to-end tails.
- Change the smallest lever tied to the measured bottleneck; lower precision or a
smaller model does not guarantee lower tail latency or cost.
- Treat transforms, exported graph, runtime, precision, postprocessing, thresholds,
index/tracker state, hardware, and scheduler as one serving bundle.
- Validate numerical compatibility and task-specific hard slices after every serving
change, retaining a verified rollback bundle.
Boundaries And Handoffs
This skill owns CV execution profiling, resolution/tiling, runtime/export compatibility,
runtime precision and quantization, batching, device placement, pipeline capacity, and
serving rollback. Architecture retraining, QAT, pruning-aware training, or distillation
belongs to $computer-vision-modeling-and-training; quality acceptance belongs to
$computer-vision-evaluation.
Use $api-contract-engineering for HTTP/OpenAPI artifacts and wire compatibility.
Use $system-design for queues, storage, tenancy, and distributed topology;
$sre-reliability-engineering for SLOs, incidents, alerts, and on-call. If a VLM trace
localizes the bottleneck to token generation, KV cache, prefill, or decode, use
$llm-inference-optimization for that stage.
Reference Routing
- Read workload, measurement, and bottlenecks
for every performance or capacity investigation.
- Read spatial preprocessing and postprocessing
for resolution, tiling, batching, geometry, masks, OCR, and retrieval stages.
- Read runtime, compression, and compatibility
for export, precision, quantization, operator support, and validation.
- Read video, capacity, and release for
codecs, FPS/PTS, sampling, stateful tracking, overload, rollout, and operations.
Workflow
- Freeze representative workload classes and quality/latency/throughput/cost targets.
- Trace the complete path and name the first saturated or delayed stage.
- Estimate the resource model and choose one causal optimization hypothesis.
- Benchmark warm-up, steady state, tails, overload, and task-specific quality on the
target device and concurrency.
- Validate compatibility, fallback, telemetry, and rollback before expanding traffic.
- Hand generic service topology and operational ownership to their primary skills.
Output
Include workload and quality contract; stage trace; bottleneck evidence; capacity and
memory model; candidate levers and rejected alternatives; benchmark protocol and
results; compatibility and task regression checks; serving bundle; admission,
backpressure, telemetry, rollout, rollback, owner, risks, and next experiment.
Quality Bar
- Do not diagnose from average model-forward time or a workstation-only benchmark.
- Do not compare runtimes with different preprocessing, outputs, warm-up, batch,
concurrency, or quality settings without stating the difference.
- Do not claim a quantized or exported model is equivalent without task evidence.
- Do not increase buffering or batching without deadlines, ordering, cancellation,
overload behavior, and memory limits.
1---2name: computer-vision-inference-optimization3description: Use when profiling, deploying, or optimizing computer-vision inference pipelines for latency, throughput, memory, cost, FPS, or device constraints. Trigger for decode/preprocess/model/postprocess/index stages, tiling, batching, export and runtime compatibility, precision and quantization, streaming video, frame timing, and capacity planning. Not for model training or generic service and SRE ownership.4---56# Computer Vision Inference Optimization78Optimize a measured image, document, retrieval, or video execution path. Freeze the9workload and quality contract, then locate the first bottleneck before changing input10resolution, precision, model, runtime, batching, or topology.1112## Core Rules1314- Define workload classes by media type, resolution, codec, frame or clip length,15 arrival pattern, concurrency, device, and required output.16- Measure capture/read, decode, color conversion, preprocessing, transfer, model,17 postprocessing, tracking/indexing, serialization, queueing, and end-to-end tails.18- Change the smallest lever tied to the measured bottleneck; lower precision or a19 smaller model does not guarantee lower tail latency or cost.20- Treat transforms, exported graph, runtime, precision, postprocessing, thresholds,21 index/tracker state, hardware, and scheduler as one serving bundle.22- Validate numerical compatibility and task-specific hard slices after every serving23 change, retaining a verified rollback bundle.2425## Boundaries And Handoffs2627This skill owns CV execution profiling, resolution/tiling, runtime/export compatibility,28runtime precision and quantization, batching, device placement, pipeline capacity, and29serving rollback. Architecture retraining, QAT, pruning-aware training, or distillation30belongs to `$computer-vision-modeling-and-training`; quality acceptance belongs to31`$computer-vision-evaluation`.3233Use `$api-contract-engineering` for HTTP/OpenAPI artifacts and wire compatibility.34Use `$system-design` for queues, storage, tenancy, and distributed topology;35`$sre-reliability-engineering` for SLOs, incidents, alerts, and on-call. If a VLM trace36localizes the bottleneck to token generation, KV cache, prefill, or decode, use37`$llm-inference-optimization` for that stage.3839## Reference Routing4041- Read [workload, measurement, and bottlenecks](references/01_workload_measurement_bottlenecks.md)42 for every performance or capacity investigation.43- Read [spatial preprocessing and postprocessing](references/02_spatial_prepostprocess.md)44 for resolution, tiling, batching, geometry, masks, OCR, and retrieval stages.45- Read [runtime, compression, and compatibility](references/03_runtime_compression_compatibility.md)46 for export, precision, quantization, operator support, and validation.47- Read [video, capacity, and release](references/04_video_capacity_release.md) for48 codecs, FPS/PTS, sampling, stateful tracking, overload, rollout, and operations.4950## Workflow51521. Freeze representative workload classes and quality/latency/throughput/cost targets.532. Trace the complete path and name the first saturated or delayed stage.543. Estimate the resource model and choose one causal optimization hypothesis.554. Benchmark warm-up, steady state, tails, overload, and task-specific quality on the56 target device and concurrency.575. Validate compatibility, fallback, telemetry, and rollback before expanding traffic.586. Hand generic service topology and operational ownership to their primary skills.5960## Output6162Include workload and quality contract; stage trace; bottleneck evidence; capacity and63memory model; candidate levers and rejected alternatives; benchmark protocol and64results; compatibility and task regression checks; serving bundle; admission,65backpressure, telemetry, rollout, rollback, owner, risks, and next experiment.6667## Quality Bar6869- Do not diagnose from average model-forward time or a workstation-only benchmark.70- Do not compare runtimes with different preprocessing, outputs, warm-up, batch,71 concurrency, or quality settings without stating the difference.72- Do not claim a quantized or exported model is equivalent without task evidence.73- Do not increase buffering or batching without deadlines, ordering, cancellation,74 overload behavior, and memory limits.