Skip to content

Add num_threads config to cap CPU inference threads and disable pinning - #43

Open
anaghdin wants to merge 2 commits into
OpenVisualCloud:masterfrom
anaghdin:ivsr_opt
Open

Add num_threads config to cap CPU inference threads and disable pinning#43
anaghdin wants to merge 2 commits into
OpenVisualCloud:masterfrom
anaghdin:ivsr_opt

Conversation

@anaghdin

@anaghdin anaghdin commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Introduce a NUM_THREADS SDK config key that lets callers cap the OpenVINO CPU inference thread pool per instance (ov::inference_num_threads). When num_threads > 0, also disable OpenVINO CPU pinning (ov::hint::enable_cpu_pinning(false)).

Rationale: with inference_num_threads set, the CPU plugin enables thread pinning by default and deterministically binds every process to the same core block. Independent concurrent encodes then all collide on those few cores while the rest of the machine sits idle. Disabling pinning lets the OS scheduler spread jobs across the machine. In a 40-job sweep this raised throughput from ~258 to ~782 FPS. A value of 0 (default) preserves the prior uncapped OpenVINO behavior.

Changes:

  • ivsr_sdk: add NUM_THREADS key, parse it in ivsr_init, and thread it through parse_engine_config to emit inference_num_threads + enable_cpu_pinning(false).
  • ivsr_ffmpeg_plugin: add ffmpeg patch 0008 exposing a num_threads option in the ivsr DNN backend, plumbed to the SDK as NUM_THREADS.

Introduce a NUM_THREADS SDK config key that lets callers cap the OpenVINO
CPU inference thread pool per instance (ov::inference_num_threads). When
num_threads > 0, also disable OpenVINO CPU pinning
(ov::hint::enable_cpu_pinning(false)).

Rationale: with inference_num_threads set, the CPU plugin enables thread
pinning by default and deterministically binds every process to the same
core block. Independent concurrent encodes then all collide on those few
cores while the rest of the machine sits idle. Disabling pinning lets the
OS scheduler spread jobs across the machine. In a 40-job sweep this raised
throughput from ~258 to ~782 FPS. A value of 0 (default) preserves the
prior uncapped OpenVINO behavior.

Changes:
- ivsr_sdk: add NUM_THREADS key, parse it in ivsr_init, and thread it
  through parse_engine_config to emit inference_num_threads +
  enable_cpu_pinning(false).
- ivsr_ffmpeg_plugin: add ffmpeg patch 0004 exposing a num_threads
  option in the ivsr DNN backend, plumbed to the SDK as NUM_THREADS.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant