Skip to content

Conversation

adrianlizarraga
Copy link
Contributor

Description

A new overload of CreateProvider() was added to the to handle the extraction of EP options from the session option configurations.

Motivation and Context

Allows use of new Compile API.
Refer to #24207

@adrianlizarraga
Copy link
Contributor Author

Hi @wcy123, Could you please take look at this PR needed for ORT 1.22? Thanks.

@adrianlizarraga adrianlizarraga marked this pull request as ready for review April 16, 2025 18:46
@wcy123
Copy link
Contributor

wcy123 commented Apr 17, 2025

Hi @wcy123, Could you please take look at this PR needed for ORT 1.22? Thanks.

Thank @adrianlizarraga, I read the PR quickly, it looks like it is backward compatible. It looks good to me. please merge it, I would like not to block the next release.

jywu-msft
jywu-msft previously approved these changes Apr 17, 2025
@adrianlizarraga adrianlizarraga merged commit 689ec47 into main Apr 18, 2025
87 of 89 checks passed
@adrianlizarraga adrianlizarraga deleted the adrianl/vitisai-create-provider-from-session-options branch April 18, 2025 05:51
ashrit-ms pushed a commit that referenced this pull request Apr 24, 2025
…ession options (#24445)

### Description
A new overload of CreateProvider() was added to the to handle the
extraction of EP options from the session option configurations.

### Motivation and Context
Allows use of new Compile API.
Refer to #24207
intbf pushed a commit to intbf/onnxruntime that referenced this pull request Apr 25, 2025
…ession options (microsoft#24445)

### Description
A new overload of CreateProvider() was added to the to handle the
extraction of EP options from the session option configurations.

### Motivation and Context
Allows use of new Compile API.
Refer to microsoft#24207

Signed-off-by: bfilipek <[email protected]>
HectorSVC pushed a commit that referenced this pull request May 19, 2025
…el` flow (#24799)

### Description

convert all session configs, i.e. key-value pairs into provider options, the key prefixed with `ort_session_config.`


### Motivation and Context
#24445 has a bug when `Ort::CompileModel` is used, not all session config are passed to VITISAI EP backend.
It is because that the `session_option` which holds a reference to `VitisiAIExectuionProviderFactory` is not as same as the
`session_option` used for `Ort::CompileModel`. `Ort::CompileModel` create another `session_option` behind scene.

The symptom of this bug is that only the session configs in the first `SessionOptions` object is passed to `VitisiAIExectuionProviderFactory` and session configs in the second `SessionOptions` are not, so that VITISAI EP backend sometimes assumes that ep.cache_context is not enabled, and then ep context cache model is not created properly.
HectorSVC pushed a commit that referenced this pull request Jul 7, 2025
### Description

Add a new ORT API `GetSessionOptionConfigEntries`.

### Motivation and Context

#24887 allows plugin-EPs to interface with ORT using a binary stable interface. #24445 allows an EP to handle the extraction of EP options from the session option configurations. For an EP like VitisAI EP to comply with the requirements,

it is necessary for a plugin-EPs to access all config entries in a session option.

```c++
    OrtKeyValuePairs * kvps = nullptr;
    auto status = GetSessionOptionConfigEntries(session_option, &kvps);
    if(status) {
        throw status;
    }
    std::unique_ptr<OrtKeyValuePairs, void (*)(OrtKeyValuePairs*)>
        config_entries(kvps,
                       ort_api.ReleaseKeyValuePairs);
    const char* const* keys = nullptr;
    const char* const* values = nullptr;
    size_t num_keys = 0;
    // Get keys and values from the config entries
    Ort::GetApi().GetKeyValuePairs(config_entries.get(), &keys, &values, &num_keys);

    for (size_t i = 0; i < num_keys; ++i) {
        // process keys[i] and values[i]
    }
```
daijh pushed a commit to daijh/onnxruntime that referenced this pull request Jul 10, 2025
### Description

Add a new ORT API `GetSessionOptionConfigEntries`.

### Motivation and Context

microsoft#24887 allows plugin-EPs to interface with ORT using a binary stable interface. microsoft#24445 allows an EP to handle the extraction of EP options from the session option configurations. For an EP like VitisAI EP to comply with the requirements,

it is necessary for a plugin-EPs to access all config entries in a session option.

```c++
    OrtKeyValuePairs * kvps = nullptr;
    auto status = GetSessionOptionConfigEntries(session_option, &kvps);
    if(status) {
        throw status;
    }
    std::unique_ptr<OrtKeyValuePairs, void (*)(OrtKeyValuePairs*)>
        config_entries(kvps,
                       ort_api.ReleaseKeyValuePairs);
    const char* const* keys = nullptr;
    const char* const* values = nullptr;
    size_t num_keys = 0;
    // Get keys and values from the config entries
    Ort::GetApi().GetKeyValuePairs(config_entries.get(), &keys, &values, &num_keys);

    for (size_t i = 0; i < num_keys; ++i) {
        // process keys[i] and values[i]
    }
```
qti-yuduo pushed a commit to CodeLinaro/onnxruntime that referenced this pull request Aug 8, 2025
### Description

Add a new ORT API `GetSessionOptionConfigEntries`.

### Motivation and Context

microsoft#24887 allows plugin-EPs to interface with ORT using a binary stable interface. microsoft#24445 allows an EP to handle the extraction of EP options from the session option configurations. For an EP like VitisAI EP to comply with the requirements,

it is necessary for a plugin-EPs to access all config entries in a session option.

```c++
    OrtKeyValuePairs * kvps = nullptr;
    auto status = GetSessionOptionConfigEntries(session_option, &kvps);
    if(status) {
        throw status;
    }
    std::unique_ptr<OrtKeyValuePairs, void (*)(OrtKeyValuePairs*)>
        config_entries(kvps,
                       ort_api.ReleaseKeyValuePairs);
    const char* const* keys = nullptr;
    const char* const* values = nullptr;
    size_t num_keys = 0;
    // Get keys and values from the config entries
    Ort::GetApi().GetKeyValuePairs(config_entries.get(), &keys, &values, &num_keys);

    for (size_t i = 0; i < num_keys; ++i) {
        // process keys[i] and values[i]
    }
```
sanketkaleoss pushed a commit to sanketkaleoss/onnxruntime that referenced this pull request Aug 11, 2025
### Description

Add a new ORT API `GetSessionOptionConfigEntries`.

### Motivation and Context

microsoft#24887 allows plugin-EPs to interface with ORT using a binary stable interface. microsoft#24445 allows an EP to handle the extraction of EP options from the session option configurations. For an EP like VitisAI EP to comply with the requirements,

it is necessary for a plugin-EPs to access all config entries in a session option.

```c++
    OrtKeyValuePairs * kvps = nullptr;
    auto status = GetSessionOptionConfigEntries(session_option, &kvps);
    if(status) {
        throw status;
    }
    std::unique_ptr<OrtKeyValuePairs, void (*)(OrtKeyValuePairs*)>
        config_entries(kvps,
                       ort_api.ReleaseKeyValuePairs);
    const char* const* keys = nullptr;
    const char* const* values = nullptr;
    size_t num_keys = 0;
    // Get keys and values from the config entries
    Ort::GetApi().GetKeyValuePairs(config_entries.get(), &keys, &values, &num_keys);

    for (size_t i = 0; i < num_keys; ++i) {
        // process keys[i] and values[i]
    }
```
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.

3 participants