Skip to content

Commit

Permalink
Address leftover comments for Lora support (#22322)
Browse files Browse the repository at this point in the history
### Description
Address comments


### Motivation and Context
Re: #22046
  • Loading branch information
yuslepukhin authored Oct 4, 2024
1 parent 0645ad1 commit 9f3676b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/onnxruntime/core/session/onnxruntime_c_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -4675,7 +4675,7 @@ struct OrtApi {
/** \brief Create an OrtLoraAdapter
*
* The function attempts to locate file specified by adapter_file_path, read it and create an OrtLoraAdapter
* instance. The adapter_file_path should be a valid absolute path to a file that contains a valid Lora Adapter
* instance. The adapter_file_path should be a valid path to a file that contains a valid Lora Adapter
* format. The function attempts to validate the format at load time. The file will always be memory mapped, unless
* the platform does not support memory mapping, in which case the file will be read into memory.
*
Expand Down
2 changes: 1 addition & 1 deletion include/onnxruntime/core/session/onnxruntime_cxx_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ struct RunOptions : detail::Base<OrtRunOptions> {
/** \brief Add the LoraAdapter to the list of active adapters.
* The setting does not affect RunWithBinding() calls.
*
* Wraps OrtApi::RunOptionsSetLoraAdapterActive
* Wraps OrtApi::RunOptionsAddActiveLoraAdapter
* \param adapter The LoraAdapter to be used as the active adapter
*/
RunOptions& AddActiveLoraAdapter(const LoraAdapter& adapter);
Expand Down
7 changes: 7 additions & 0 deletions onnxruntime/python/onnxruntime_pybind_state.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2228,7 +2228,14 @@ including arg name, arg type (contains both type and shape).)pbdoc")
OrtPybindThrowIfError(res.first);
return *(res.second); }, py::return_value_policy::reference_internal)
.def("run_with_iobinding", [](PyInferenceSession* sess, SessionIOBinding& io_binding, RunOptions* run_options = nullptr) -> void {

Status status;

if (run_options != nullptr && !run_options->active_adapters.empty()) {
LOGS(*sess->GetSessionHandle()->GetLogger(), WARNING)
<< "run_with_iobinding has active adapters specified, but won't have an effect";
}

// release GIL to allow multiple python threads to invoke Run() in parallel.
py::gil_scoped_release release;
if (!run_options)
Expand Down

0 comments on commit 9f3676b

Please sign in to comment.