Add IE Config for NUM_BUILD_THREADS#15
Conversation
| } | ||
| } catch (const std::exception&) { | ||
| THROW_IE_EXCEPTION << "Wrong value for property key " << CLDNNConfigParams::KEY_CLDNN_MAX_NUM_THREADS | ||
| << ". Expected only integer"; |
There was a problem hiding this comment.
please add a usage example here too:
e.g., "Please specify the number of threads you want to use for build as integer. If you set this with a value out of range, it will be set as default number, i.e., maximum number of available threads."
There was a problem hiding this comment.
Are you saying we should set the number of threads to its default for the cases when invalid config value is given, such as string or character, and not throw an exception?
There was a problem hiding this comment.
no. I mean just update the message here to be shown by the user.
| THROW_IE_EXCEPTION_WITH_STATUS(NotFound) << "Unsupported KEY_CLDNN_ENABLE_FP16_FOR_QUANTIZED_MODELS flag value: " << val; | ||
| } | ||
| } else if (key.compare(CLDNNConfigParams::KEY_CLDNN_MAX_NUM_THREADS) == 0) { | ||
| int max_threads = std::thread::hardware_concurrency(); |
There was a problem hiding this comment.
https://en.cppreference.com/w/cpp/thread/thread/hardware_concurrency
It can return 0 if the environment does not defined the available concurrency.
I think we need to set it as 1 if it returns 0.
| device_id(""), | ||
| kernels_cache_dir("") { | ||
| kernels_cache_dir(""), | ||
| n_threads(std::thread::hardware_concurrency()) { |
There was a problem hiding this comment.
Samely, need to handle if the return value is 0.
| bool memory_pool = true, | ||
| uint16_t n_streams = 1, | ||
| const std::string& kernels_cache_path = "", | ||
| int n_threads = std::thread::hardware_concurrency(), |
| tuning_cache_path("cache.json"), | ||
| kernels_cache_path("") {} | ||
| kernels_cache_path(""), | ||
| n_threads(std::thread::hardware_concurrency()) {} |
3ff6755
into
yeonbok:taylor_async_batch_WW11_rebase_both_tbb_threadpool_default_with_threadpool
* Add IE Config for n_threads * Use IE Config n_threads in kernel_cache * Change default value of KEY_CLDNN_MAX_NUM_THREADS * set n_threads as 1 if concurrency returns 0 * Update error message
Details:
Tickets: