Skip to content

Conversation

Kotomi-Du
Copy link

Description

In Phi-Silica app which didn't rely on ORT-GenAI, we need an API to remove KV history. The kvcache_rewind is an OVEP function to achieve this, however there is no python API exposed. This PR is for this purpose.

@Kotomi-Du Kotomi-Du changed the base branch from master to ovep-develop October 10, 2025 23:33
#endif
})
.def(
"set_ep_dynamic_options", [](PyInferenceSession* sess, const py::dict& options) -> void {

Choose a reason for hiding this comment

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

Explicit return type in lambda is unnecessary starting with C++14. On top of that, -> void doesn't provide any additional information.
Some of the functions in this file use it, but not all of them. So let's remove it

gsl::make_span(values.data(), values.size()));

if (!status.IsOK()) {
throw std::runtime_error("Failed to set EP dynamic options: " + status.ErrorMessage());

Choose a reason for hiding this comment

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

Please don't throw raw C++ exceptions. There's an example in this file on how to report an error(OrtPybindThrowIfError or ORT_THROW, depending on the build type)

throw std::runtime_error("No options were provided");
}

// Call the underlying C++ method

Choose a reason for hiding this comment

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

Is this comment necessary?

@ankitm3k
Copy link

ankitm3k commented Oct 13, 2025

Please attach a JIRA for this feature request in the PR description.

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