Skip to content

Conversation

@preetha-intel
Copy link

@preetha-intel preetha-intel commented Mar 6, 2025

Description

Add parsing for different mode execution via config file in OVEP

Motivation and Context

Support for the AUTO properties like ENABLE_RUNTIME_FALLBACK needs to be added in OVEP.

Sample .json file for this feature is :

auto_config.json

{
"AUTO":
{"ENABLE_STARTUP_FALLBACK":"NO",
"ENABLE_RUNTIME_FALLBACK" : "NO",
"EXECUTION_MODE_HINT" : "ACCURACY"}
}

The properties for a specified hardware is obtained from OV. Adding the syntax to print supported OV properties for a device using C++ API

auto device = "AUTO";
auto device_properties = ov::core.get_property(device, ov::supported_properties);
  //print device properties
  std::cout << " Properties for " << device << " : " << std::endl;
  for(auto& it : device_properties) {
    std::cout << it << std::endl;
  }

For checking whether the property is set correctly during OV model compilation, we can get and print the properties from OV compiled model using the below snippet in C++

    // output of the actual settings that the device selected
    auto compiledModel = ov::core.compile_model(onnx_model, ov::Tensor(), hw_target, device_config);
    auto supported_properties = compiledModel.get_property(ov::supported_properties);
    std::cout << "Model:" << std::endl;
    for (const auto& cfg : supported_properties) {
        if (cfg == ov::supported_properties)
            continue;
        auto prop = compiledModel.get_property(cfg);
        if (cfg == ov::device::properties) {
            auto devices_properties = prop.as<ov::AnyMap>();
            for (auto& item : devices_properties) {
                std::cout << "  " << item.first << ": " << std::endl;
                for (auto& item2 : item.second.as<ov::AnyMap>()) {
                    std::cout << "    " << item2.first << ": " << item2.second.as<std::string>() << std::endl;
                }
            }
        } else {
            std::cout << "  " << cfg << ": " << prop.as<std::string>() << std::endl;
        }
    }

HAFP-3004

@sfatimar
Copy link

sfatimar commented Mar 7, 2025

Please list what unit testing you have done for this code fix

@sfatimar
Copy link

Please resolve comments and close on this PR.

@preetha-intel preetha-intel force-pushed the preetha/load_config_support branch 2 times, most recently from ab94d32 to 32770ad Compare March 11, 2025 10:17
@MayureshV1
Copy link

@vthaniel , @jatinwadhwa921 - Can we create a test case for load_config feature and if it exists add AUTO, HETERO, MULTI into the tests.

@preetha-intel . Do we have a methodology to query whether a feature is set correctly in OpenVINO.
For e.g.: If "ENABLE_STARTUP_FALLBACK":"NO", can we query OV to check whether it was disabled?

@preetha-intel
Copy link
Author

@vthaniel , @jatinwadhwa921 - Can we create a test case for load_config feature and if it exists add AUTO, HETERO, MULTI into the tests.

@preetha-intel . Do we have a methodology to query whether a feature is set correctly in OpenVINO. For e.g.: If "ENABLE_STARTUP_FALLBACK":"NO", can we query OV to check whether it was disabled?

There is OPENVIINO_LOG_LEVEL=5 env variable that prints the properties of OV compiled model. But its working only for AUTO and MULTI. Looks like HETERO is broken

@preetha-intel preetha-intel force-pushed the preetha/load_config_support branch 2 times, most recently from f54b772 to 964c89e Compare March 16, 2025 20:33
@TejalKhade28
Copy link

@vthaniel , @jatinwadhwa921 - Can we create a test case for load_config feature and if it exists add AUTO, HETERO, MULTI into the tests.

@preetha-intel . Do we have a methodology to query whether a feature is set correctly in OpenVINO. For e.g.: If "ENABLE_STARTUP_FALLBACK":"NO", can we query OV to check whether it was disabled?

We can test load_config feature for AUTO, MULTI with the OPENVINO_LOG_LEVEL=5 env variable, but this does not work for HETERO. The logs for HETERO are not shown up.

@preetha-intel
Copy link
Author

preetha-intel commented Mar 18, 2025

@TejalKhade28 We can use the LOG_LEVEL config option to get the compiler level debug logs.
Update the json file with

auto_config.json

{
"AUTO":
{"ENABLE_STARTUP_FALLBACK":"NO",
"ENABLE_RUNTIME_FALLBACK" : "NO",
"EXECUTION_MODE_HINT" : "ACCURACY",
"LOG_LEVEL" : "LOG_DEBUG"}
}

@sfatimar
Copy link

@preetha-intel can you please rebase this branch

@preetha-intel preetha-intel force-pushed the preetha/load_config_support branch from 964c89e to 672e506 Compare March 19, 2025 13:41
@preetha-intel
Copy link
Author

@sfatimar Rebased and validated

@sfatimar
Copy link

@preetha-intel can you please update the branch

Copy link

@sfatimar sfatimar left a comment

Choose a reason for hiding this comment

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

Approved

@sfatimar
Copy link

Is the test case written for this ?

@preetha-intel preetha-intel force-pushed the preetha/load_config_support branch from 672e506 to 6be82a2 Compare March 27, 2025 04:06
@preetha-intel
Copy link
Author

Is the test case written for this ?

https://github.com/intel-innersource/frameworks.ai.edgecsp.ci.mlops/pull/89

@preetha-intel
Copy link
Author

@preetha-intel can you please update the branch

Rebased

@sfatimar
Copy link

Internal CI is failing
Please check @preetha-intel

@sfatimar
Copy link

sfatimar commented Apr 1, 2025

@preetha-intel Branch has conflicts

@preetha-intel preetha-intel force-pushed the preetha/load_config_support branch from 6be82a2 to 2d4d500 Compare April 2, 2025 08:43
@MayureshV1 MayureshV1 merged commit 25912f7 into ovep-develop Apr 2, 2025
6 of 11 checks passed
@preetha-intel preetha-intel deleted the preetha/load_config_support branch April 2, 2025 17:51
@MayureshV1
Copy link

MayureshV1 commented Apr 2, 2025

Merging this PR since #630 is dependent on changes here and would need to be rebased.

ankitm3k pushed a commit that referenced this pull request Apr 3, 2025
* Add support for parsing AUTO, HETERO and MULTI from json config

* Fix lint issues

* Address review comments
ankitm3k pushed a commit that referenced this pull request Jul 2, 2025
* Add support for parsing AUTO, HETERO and MULTI from json config

* Fix lint issues

* Address review comments
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.

6 participants