Skip to content

Allow CPU_RUNTIME_CACHE_CAPACITY in plugin_config#4326

Open
andersendsa wants to merge 2 commits into
openvinotoolkit:mainfrom
andersendsa:fix_cpu_runtime
Open

Allow CPU_RUNTIME_CACHE_CAPACITY in plugin_config#4326
andersendsa wants to merge 2 commits into
openvinotoolkit:mainfrom
andersendsa:fix_cpu_runtime

Conversation

@andersendsa

@andersendsa andersendsa commented Jun 25, 2026

Copy link
Copy Markdown

🛠 Summary

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.
Closes : #4299
JIRA/Issue if applicable.
Describe the changes.

  1. Whitelisted CPU_RUNTIME_CACHE_CAPACITY in src/ov_utils.cpp

    • In the validatePluginConfiguration function, OVMS dynamically checks if the keys provided in plugin_config are supported by the target device.
    • I explicitly added pluginSupportedConfigKeys.insert("CPU_RUNTIME_CACHE_CAPACITY"); to bypass this validation failure for this specific key, similar to how it is handled for the ENABLE_MMAP configuration.
    • This ensures that OVMS allows the key and forwards it correctly to the OpenVINO Runtime, where it is functionally supported.
  2. Added Unit Tests in src/test/ov_utils_test.cpp

    • I implemented a new test case TEST(OVUtils, ValidatePluginConfigurationAllowCPURuntimeCacheCapacity).
    • This test initializes a mock configuration with CPU_RUNTIME_CACHE_CAPACITY set to "0" and verifies that ovms::validatePluginConfiguration successfully executes without returning any errors (validating status.ok()).

🧪 Checklist

  • Unit tests added.
  • The documentation updated.
  • Change follows security best practices.
    ``

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.
Copilot AI review requested due to automatic review settings June 25, 2026 15:31
@andersendsa

Copy link
Copy Markdown
Author

Hi @atobiszei, @dtrawins pls let me know if this pr needs any changes or if it is good to merge

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_CAPACITY during plugin-config key validation (similar to the existing ENABLE_MMAP workaround).
  • Adds a unit test asserting validation succeeds when CPU_RUNTIME_CACHE_CAPACITY is present in plugin_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.

Comment thread src/ov_utils.cpp
Comment on lines +137 to +138
pluginSupportedConfigKeys.insert("ENABLE_MMAP"); // WA: always supported
pluginSupportedConfigKeys.insert("CPU_RUNTIME_CACHE_CAPACITY"); // WA: always supported
Comment on lines +245 to +252
ov::Core ieCore;
ovms::ModelConfig config;
config.setTargetDevice("CPU");
config.setPluginConfig({{"CPU_RUNTIME_CACHE_CAPACITY", "0"}});
ovms::plugin_config_t pluginConfig = ovms::ModelInstance::prepareDefaultPluginConfig(config);
auto status = ovms::validatePluginConfiguration(pluginConfig, "CPU", ieCore);
EXPECT_TRUE(status.ok());
}
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.

CPU_RUNTIME_CACHE_CAPACITY is unsupported in OVMS plugin_config but works in raw OpenVINO Runtime

2 participants