Add configurable latency optimization for sub-second end-to-end latency#881
Open
jcork-intel wants to merge 5 commits intolatency-fixfrom
Open
Add configurable latency optimization for sub-second end-to-end latency#881jcork-intel wants to merge 5 commits intolatency-fixfrom
jcork-intel wants to merge 5 commits intolatency-fixfrom
Conversation
…tency - Add LOW_LATENCY and MEDIUM_LATENCY queue optimization modes - Add configurable INFERENCE_INTERVAL (default=3, use 1 for every frame) - Add separate inference options for face detection vs object detection - Add support for INT8 model paths for NPU compatibility
Allow shell environment variables to override .env file defaults for: - LOW_LATENCY, MEDIUM_LATENCY - INFERENCE_INTERVAL - BATCH_SIZE_DETECT, BATCH_SIZE_CLASSIFY Also add sample-media volume mount for benchmarking.
…try version) Allow shell environment variables to override .env file defaults for: - LOW_LATENCY, MEDIUM_LATENCY - INFERENCE_INTERVAL - BATCH_SIZE_DETECT, BATCH_SIZE_CLASSIFY Also add sample-media volume mount and update image name.
New device configuration for Lunar Lake that runs: - YOLO11n object detection on NPU - EfficientNet classification on GPU with VA surface sharing - Face detection and age classification on GPU This configuration achieves sub-second latency while maximizing stream density.
Latency benchmarks were run using a locally-built image (pipeline-runner-asc) based on DLStreamer 2025.0.1 with Intel NPU drivers for Lunar Lake.
jcork-intel
commented
Nov 26, 2025
Author
jcork-intel
left a comment
There was a problem hiding this comment.
@sachinkaushik @avinash-palleti --> I created this PR just so you could see side by side the changes that I made in my fork when running my experiments.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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