openvino: [Bug]: OpenVINO will only use half of my available system threads on 2 socket configuration

OpenVINO Version

2024.0.0 - Current

Operating System

Windows 10 Professional 2004 [Version 10.0.19041.1415]

Device used for inference

CPU (Intel Xeon E-2288G CPU [Coffee Lake / 9th Generation Core])

Framework

Any

Model used

Any

Issue description

This is related to my previous issue here:

https://github.com/openvinotoolkit/openvino/issues/22678#issuecomment-1934093382

I’m an OpenVINO user of Topaz Video AI, and the current version uses only half of my total CPU. It uses OpenVINO 2024.3.0, but the problem I’m describing is specific to OpenVINO and started happening with 2024.0.0, and has history going back to at least 2023.0.1.

The system is a VM (VPS) running on a Hypervisor configured with two CPU sockets, each with 8 cores and 8 threads. The actual hardware and VM CPU is the Intel Xeon E-2288G CPU (Coffee Lake / 9th Generation Core).

The Intel Xeon E-2288G is listed as a supported processor for Windows 10 2004.

Intel Processor Diagnostic Tool v4.1.9.41 passes. TESTRESULTS.TXT contents: https://pastebin.com/zeWjbVur

CPU-Z Report: https://pastebin.com/uG071g8r

I used benchmark_app to track the history of when the problem started happening in OpenVINO. I beleive that the problem is that OpenVINO “thinks” that the total number of available threads on my system is only 8, when it is actually 16. I suspect it isn’t currently able to interpret and handle more than 1 CPU socket.

Here is what I discovered:

In OpenVINO 2023.0.1, the system uses all available 16 threads (output shows INFERENCE_NUM_THREADS: 16) when the following command is used: benchmark_app -api sync -hint latency -t 10 -m "C:\OpenVINO\intel\face-detection-0206\FP16\face-detection-0206.xml". It hangs and does nothing if -api async is used.

In OpenVINO 2023.1.0 & 2023.2.0, OpenVINO doesn’t work at all; it crashes (as noted in the above Github issue #22678).

In OpenVINO 2023.3.0, now both -api sync and -api async work, but, -api sync runs using only 8 threads (output shows INFERENCE_NUM_THREADS: 8; using -hint none -nthreads 16 doesn’t work and output still shows INFERENCE_NUM_THREADS: 8). -api async works correctly and uses all 16 threads.

Starting with OpenVINO 2024.0.0, now both api-sync and api-async are only able to use 8 cores and there doesn’t seem to be any way to get OpenVINO to use all 16 cores.

Step-by-step reproduction

To reproduce someone will need a Windows 10 system that has the Intel Xeon E-2288G CPU configured as two sockets with 8 cores and 8 threads per socket. Alternatively, it’s possible this problem will manifest on a system configured with two CPU sockets and any similar Intel Xeon CPU models with X number of both cores and threads in each socket.

Install Python 3.9

Create a directory for virtual environment, i.e. C:\OpenVINO, and open a command prompt in this directory.

python -m venv openvino_env
openvino_env\Scripts\activate
python -m pip install --upgrade pip
python -m pip install openvino-dev==2023.3.0

omz_downloader --all
omz_converter --all

benchmark_app -api sync -hint latency -t 10 -m "C:\OpenVINO\intel\face-detection-0206\FP16\face-detection-0206.xml"

benchmark_app -api async -hint latency -t 10 -m "C:\OpenVINO\intel\face-detection-0206\FP16\face-detection-0206.xml"

Relevant log output

(openvino_env) C:\OpenVINO\test>benchmark_app -api async -hint latency -t 10 -m "C:\OpenVINO\intel\face-detection-0206\FP16\face-detection-0206.xml"
[Step 1/11] Parsing and validating input arguments
[ INFO ] Parsing input parameters
[Step 2/11] Loading OpenVINO Runtime
[ INFO ] OpenVINO:
[ INFO ] Build ................................. 2023.3.0-13775-ceeafaf64f3-releases/2023/3
[ INFO ]
[ INFO ] Device info:
[ INFO ] CPU
[ INFO ] Build ................................. 2023.3.0-13775-ceeafaf64f3-releases/2023/3
[ INFO ]
[ INFO ]
[Step 3/11] Setting device configuration
[Step 4/11] Reading model files
[ INFO ] Loading model files
[ INFO ] Read model took 109.38 ms
[ INFO ] Original model I/O parameters:
[ INFO ] Model inputs:
[ INFO ]     image (node: image) : f32 / [N,C,H,W] / [1,3,640,640]
[ INFO ] Model outputs:
[ INFO ]     boxes (node: boxes) : f32 / [...] / [..750,5]
[ INFO ]     labels (node: labels) : i64 / [...] / [..750]
[Step 5/11] Resizing model to match image sizes and given batch
[ INFO ] Model batch size: 1
[Step 6/11] Configuring input of the model
[ INFO ] Model inputs:
[ INFO ]     image (node: image) : u8 / [N,C,H,W] / [1,3,640,640]
[ INFO ] Model outputs:
[ INFO ]     boxes (node: boxes) : f32 / [...] / [..750,5]
[ INFO ]     labels (node: labels) : i64 / [...] / [..750]
[Step 7/11] Loading the model to the device
[ INFO ] Compile model took 1203.11 ms
[Step 8/11] Querying optimal runtime parameters
[ INFO ] Model:
[ INFO ]   NETWORK_NAME: torch-jit-export
[ INFO ]   OPTIMAL_NUMBER_OF_INFER_REQUESTS: 2
[ INFO ]   NUM_STREAMS: 2
[ INFO ]   AFFINITY: Affinity.NONE
[ INFO ]   INFERENCE_NUM_THREADS: 16
[ INFO ]   PERF_COUNT: NO
[ INFO ]   INFERENCE_PRECISION_HINT: <Type: 'float32'>
[ INFO ]   PERFORMANCE_HINT: LATENCY
[ INFO ]   EXECUTION_MODE_HINT: ExecutionMode.PERFORMANCE
[ INFO ]   PERFORMANCE_HINT_NUM_REQUESTS: 0
[ INFO ]   ENABLE_CPU_PINNING: False
[ INFO ]   SCHEDULING_CORE_TYPE: SchedulingCoreType.ANY_CORE
[ INFO ]   ENABLE_HYPER_THREADING: False
[ INFO ]   EXECUTION_DEVICES: ['CPU']
[ INFO ]   CPU_DENORMALS_OPTIMIZATION: False
[ INFO ]   CPU_SPARSE_WEIGHTS_DECOMPRESSION_RATE: 1.0
[Step 9/11] Creating infer requests and preparing input tensors
[ WARNING ] No input files were given for input 'image'!. This input will be filled with random values!
[ INFO ] Fill input 'image' with random values
[Step 10/11] Measuring performance (Start inference asynchronously, 2 inference requests, limits: 10000 ms duration)
[ INFO ] Benchmarking in inference only mode (inputs filling are not included in measurement loop).
[ INFO ] First inference took 619.90 ms
[Step 11/11] Dumping statistics report
[ INFO ] Execution Devices:['CPU']
[ INFO ] Count:            26 iterations
[ INFO ] Duration:         11093.38 ms
[ INFO ] Latency:
[ INFO ]    Median:        844.79 ms
[ INFO ]    Average:       853.04 ms
[ INFO ]    Min:           827.79 ms
[ INFO ]    Max:           945.26 ms
[ INFO ] Throughput:   2.34 FPS

(openvino_env) C:\OpenVINO\test>
(openvino_env) C:\OpenVINO\test>benchmark_app -api async -hint latency -t 10 -m "C:\OpenVINO\intel\face-detection-0206\FP16\face-detection-0206.xml"
[Step 1/11] Parsing and validating input arguments
[ INFO ] Parsing input parameters
[Step 2/11] Loading OpenVINO Runtime
[ INFO ] OpenVINO:
[ INFO ] Build ................................. 2024.4.0-16579-c3152d32c9c-releases/2024/4
[ INFO ]
[ INFO ] Device info:
[ INFO ] CPU
[ INFO ] Build ................................. 2024.4.0-16579-c3152d32c9c-releases/2024/4
[ INFO ]
[ INFO ]
[Step 3/11] Setting device configuration
[Step 4/11] Reading model files
[ INFO ] Loading model files
[ INFO ] Read model took 109.35 ms
[ INFO ] Original model I/O parameters:
[ INFO ] Model inputs:
[ INFO ]     image (node: image) : f32 / [N,C,H,W] / [1,3,640,640]
[ INFO ] Model outputs:
[ INFO ]     boxes (node: boxes) : f32 / [...] / [..750,5]
[ INFO ]     labels (node: labels) : i64 / [...] / [..750]
[Step 5/11] Resizing model to match image sizes and given batch
[ INFO ] Model batch size: 1
[Step 6/11] Configuring input of the model
[ INFO ] Model inputs:
[ INFO ]     image (node: image) : u8 / [N,C,H,W] / [1,3,640,640]
[ INFO ] Model outputs:
[ INFO ]     boxes (node: boxes) : f32 / [...] / [..750,5]
[ INFO ]     labels (node: labels) : i64 / [...] / [..750]
[Step 7/11] Loading the model to the device
[ INFO ] Compile model took 937.45 ms
[Step 8/11] Querying optimal runtime parameters
[ INFO ] Model:
[ INFO ]   NETWORK_NAME: torch-jit-export
[ INFO ]   OPTIMAL_NUMBER_OF_INFER_REQUESTS: 1
[ INFO ]   NUM_STREAMS: 1
[ INFO ]   INFERENCE_NUM_THREADS: 8
[ INFO ]   PERF_COUNT: NO
[ INFO ]   INFERENCE_PRECISION_HINT: <Type: 'float32'>
[ INFO ]   PERFORMANCE_HINT: LATENCY
[ INFO ]   EXECUTION_MODE_HINT: ExecutionMode.PERFORMANCE
[ INFO ]   PERFORMANCE_HINT_NUM_REQUESTS: 0
[ INFO ]   ENABLE_CPU_PINNING: False
[ INFO ]   SCHEDULING_CORE_TYPE: SchedulingCoreType.ANY_CORE
[ INFO ]   MODEL_DISTRIBUTION_POLICY: set()
[ INFO ]   ENABLE_HYPER_THREADING: False
[ INFO ]   EXECUTION_DEVICES: ['CPU']
[ INFO ]   CPU_DENORMALS_OPTIMIZATION: False
[ INFO ]   LOG_LEVEL: Level.NO
[ INFO ]   CPU_SPARSE_WEIGHTS_DECOMPRESSION_RATE: 1.0
[ INFO ]   DYNAMIC_QUANTIZATION_GROUP_SIZE: 32
[ INFO ]   KV_CACHE_PRECISION: <Type: 'float16'>
[ INFO ]   AFFINITY: Affinity.NONE
[Step 9/11] Creating infer requests and preparing input tensors
[ WARNING ] No input files were given for input 'image'!. This input will be filled with random values!
[ INFO ] Fill input 'image' with random values
[Step 10/11] Measuring performance (Start inference asynchronously, 1 inference requests, limits: 10000 ms duration)
[ INFO ] Benchmarking in inference only mode (inputs filling are not included in measurement loop).
[ INFO ] First inference took 619.75 ms
[Step 11/11] Dumping statistics report
[ INFO ] Execution Devices:['CPU']
[ INFO ] Count:            17 iterations
[ INFO ] Duration:         10680.20 ms
[ INFO ] Latency:
[ INFO ]    Median:        629.98 ms
[ INFO ]    Average:       628.07 ms
[ INFO ]    Min:           570.90 ms
[ INFO ]    Max:           702.74 ms
[ INFO ] Throughput:   1.59 FPS

(openvino_env) C:\OpenVINO\test>

Relevant log sections:

2023.3.0:

[ INFO ]   OPTIMAL_NUMBER_OF_INFER_REQUESTS: 2
[ INFO ]   NUM_STREAMS: 2
[ INFO ]   INFERENCE_NUM_THREADS: 16

2024.4.0:

[ INFO ]   OPTIMAL_NUMBER_OF_INFER_REQUESTS: 1
[ INFO ]   NUM_STREAMS: 1
[ INFO ]   INFERENCE_NUM_THREADS: 8

(Additional lines):

[ INFO ]   MODEL_DISTRIBUTION_POLICY: set()
[ INFO ]   LOG_LEVEL: Level.NO
[ INFO ]   DYNAMIC_QUANTIZATION_GROUP_SIZE: 32
[ INFO ]   KV_CACHE_PRECISION: <Type: 'float16'>

Issue submission checklist

  • I’m reporting an issue. It’s not a question.
  • I checked the problem with the documentation, FAQ, open issues, Stack Overflow, etc., and have not found a solution.
  • There is reproducer code and related data files such as images, videos, models, etc.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 28 (12 by maintainers)

Commits related to this issue

Most upvoted comments

Is there any way to automate the generation of those variables on different systems, so that applications that use OpenVINO (like Topaz Video AI) can automatically use all available cores & threads on the system in which it happens to be running? 😕