Allow CPU_RUNTIME_CACHE_CAPACITY in plugin_config#4326
Conversation
OpenVINO's `CPU_RUNTIME_CACHE_CAPACITY` is an internal parameter that isn't returned by `get_property(pluginName, ov::supported_properties)`. This caused OVMS validation to fail when users attempted to configure it via `plugin_config`. This commit whitelists `CPU_RUNTIME_CACHE_CAPACITY` during validation (similar to `ENABLE_MMAP`) so that the configuration is passed down to OpenVINO Runtime, where it is supported.
|
Hi @atobiszei, @dtrawins pls let me know if this pr needs any changes or if it is good to merge |
There was a problem hiding this comment.
Pull request overview
This PR updates OVMS’ OpenVINO plugin-config validation to allow passing the CPU plugin’s internal CPU_RUNTIME_CACHE_CAPACITY setting via plugin_config, addressing startup failures when users configure it (as reported in #4299).
Changes:
- Whitelists
CPU_RUNTIME_CACHE_CAPACITYduring plugin-config key validation (similar to the existingENABLE_MMAPworkaround). - Adds a unit test asserting validation succeeds when
CPU_RUNTIME_CACHE_CAPACITYis present inplugin_config.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/ov_utils.cpp |
Extends validation allowlist to accept CPU_RUNTIME_CACHE_CAPACITY. |
src/test/ov_utils_test.cpp |
Adds a unit test covering the new allowlisted key. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
Hi @dtrawins I have added the suggesteed changes pls let me know if this pr needs any changes or if it is good to merge |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
src/test/ov_utils_test.cpp:254
- The new test case is missing its closing
}(and the file currently ends right after thecompile_modelline), which will cause a compilation failure.
auto status = ovms::validatePluginConfiguration(pluginConfig, "CPU", ieCore);
EXPECT_TRUE(status.ok());
auto model = ieCore.read_model(std::filesystem::current_path().u8string() + "/src/test/dummy/1/dummy.xml", {}, pluginConfig);
auto compiledModel = ieCore.compile_model(model, "CPU", pluginConfig);
aea10aa to
8548973
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
src/ov_utils.cpp:144
pluginSupportedConfigKeysis astd::set<std::string>, but the validation usesstd::find(begin,end, ...), which is O(n) and less clear than using the set lookup. PreferpluginSupportedConfigKeys.find(config.first)to keep the intent obvious and avoid linear scans.
for (auto& config : pluginConfig) {
if (std::find(pluginSupportedConfigKeys.begin(), pluginSupportedConfigKeys.end(), config.first) == pluginSupportedConfigKeys.end()) {
SPDLOG_LOGGER_ERROR(modelmanager_logger, "Plugin config key: {} not found in supported config keys for device: {}.", config.first, targetDevice);
| if (targetDevice.find("CPU") != std::string::npos) { | ||
| pluginSupportedConfigKeys.insert("CPU_RUNTIME_CACHE_CAPACITY"); // WA: supported by CPU plugin but not reported in supported_properties | ||
| } |
🛠 Summary
OpenVINO's
CPU_RUNTIME_CACHE_CAPACITYis an internal parameter that isn't returned byget_property(pluginName, ov::supported_properties). This caused OVMS validation to fail when users attempted to configure it viaplugin_config. This commit whitelistsCPU_RUNTIME_CACHE_CAPACITYduring validation (similar toENABLE_MMAP) so that the configuration is passed down to OpenVINO Runtime, where it is supported.Closes : #4299
JIRA/Issue if applicable.
Describe the changes.
Whitelisted CPU_RUNTIME_CACHE_CAPACITY in src/ov_utils.cpp
Added Unit Tests in src/test/ov_utils_test.cpp
🧪 Checklist
``