Repository navigation
Replies: 1 comment
|
@SpitchAG From what you describe, this actually sounds like expected behavior, although the magnitude of the latency increase (60 ms → ~110 ms) will depend on the platform. Since the penalty appears only after the application has been idle for ~1 second, but disappears when inference runs continuously, I'd suspect it's related to the runtime and CPU scheduling rather than the model itself. A few possible causes:
One thing I'd be interested in is:
If this is the CPU plugin, you could also try compiling the model with the latency hint: ov::Core core;
auto compiled = core.compile_model(
model,
"CPU",
ov::hint::performance_mode(ov::hint::PerformanceMode::LATENCY)
);The latency hint configures the runtime for latency-oriented execution and is generally preferred over manually tuning low-level threading properties. :contentReference[oaicite:1]{index=1} One experiment that would help narrow it down is to vary the sleep duration:
If the latency penalty starts appearing only after some idle threshold, that would strongly suggest thread wake-up and/or CPU power management rather than any model-specific behavior. I couldn't find documentation stating that OpenVINO intentionally "parks" inference threads after one second of inactivity, so I'm not sure whether the observed latency is entirely due to oneTBB scheduling, CPU power states, or a combination of both. If this solves your problem, feel free to mark it as the accepted answer so others can find it easily. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hello
I would like to understand where comes an extra latency when executing a model inference:
if I run for (N times) model.infer(); sleep(1s); repeat ...
the very first model.infer() (within a loop) has always a penalty (instead of 60ms, it goes up to 110ms). Without the sleep(), no penalty (the first of the first loop always has, but then the repeated loops dont show this latency).
is this expected? how to mitigate ? (without doing busy dummy infer)
is that related to how tbb worker threads are rescheduled/initialized ? something else?
thanks!
All reactions