Add configurable latency optimization for sub-second end-to-end latency #881
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds configurable latency optimization to achieve sub-second end-to-end latency on the full obj_detection_age_prediction pipeline.
Key Changes
Queue Optimization (
src/pipelines/obj_detection_age_prediction.sh)LOW_LATENCYmode:max-size-buffers=3 max-size-time=100000000(0.1s)MEDIUM_LATENCYmode:max-size-buffers=10 max-size-time=500000000(0.5s)Configurable Inference Interval
INFERENCE_INTERVALenvironment variable (default=3)Docker-Compose Environment Passthrough (Critical fix)
.envdirectlyLOW_LATENCY,MEDIUM_LATENCY,INFERENCE_INTERVAL,BATCH_SIZE_DETECT,BATCH_SIZE_CLASSIFYNPU+GPU Hybrid Configuration (
src/res/npu-gpu-flip.env)Benchmark Results (Lunar Lake)
Usage
# Run with latency optimization LOW_LATENCY=1 INFERENCE_INTERVAL=1 \ PIPELINE_SCRIPT=obj_detection_age_prediction.sh \ DEVICE_ENV=res/npu-gpu-flip.env \ make run-demoFiles Changed
src/pipelines/obj_detection_age_prediction.sh- Queue optimization logicsrc/docker-compose.yml- Environment variable passthroughsrc/docker-compose-reg.yml- Environment variable passthrough (registry version)src/res/npu-gpu-flip.env- New NPU+GPU hybrid device configurationTest Plan