From 5a6a09e373f23511196e820c38dd2f7dfcf2d5d0 Mon Sep 17 00:00:00 2001 From: Jaswanth Gannamaneni Date: Thu, 13 Nov 2025 21:22:04 -0800 Subject: [PATCH] Run lintrunner and fix formatting issues --- .../providers/openvino/openvino_provider_factory.cc | 2 +- onnxruntime/core/providers/openvino/ov_interface.h | 1 - .../providers/openvino/ov_stateful_patch_utils.cc | 12 ++++++------ .../openvino/qdq_transformations/qdq_scales_fix.cpp | 2 +- onnxruntime/python/onnxruntime_pybind_state.cc | 8 +++----- 5 files changed, 11 insertions(+), 14 deletions(-) diff --git a/onnxruntime/core/providers/openvino/openvino_provider_factory.cc b/onnxruntime/core/providers/openvino/openvino_provider_factory.cc index cb94fb3793024..7eb5b062fe7c8 100644 --- a/onnxruntime/core/providers/openvino/openvino_provider_factory.cc +++ b/onnxruntime/core/providers/openvino/openvino_provider_factory.cc @@ -193,7 +193,7 @@ static void ParseInnerMap(const nlohmann::json& json_map, ov::AnyMap& inner_map, const size_t max_levels = 8; if (level >= max_levels) { ORT_THROW("ParseInnerMap: load_config can have only up to " + std::to_string(max_levels) + - " levels of nested maps. Current level = " + std::to_string(level)); + " levels of nested maps. Current level = " + std::to_string(level)); } if (!json_map.is_object()) { diff --git a/onnxruntime/core/providers/openvino/ov_interface.h b/onnxruntime/core/providers/openvino/ov_interface.h index 5df5420a427f2..8765cd040d098 100644 --- a/onnxruntime/core/providers/openvino/ov_interface.h +++ b/onnxruntime/core/providers/openvino/ov_interface.h @@ -48,7 +48,6 @@ typedef std::shared_ptr OVTensorPtr; std::optional queryOVProperty(const std::string& property, const std::string& device_type); - struct OVCore : WeakSingleton { ov::Core core; diff --git a/onnxruntime/core/providers/openvino/ov_stateful_patch_utils.cc b/onnxruntime/core/providers/openvino/ov_stateful_patch_utils.cc index 7f276f565f795..20c8deb0698be 100644 --- a/onnxruntime/core/providers/openvino/ov_stateful_patch_utils.cc +++ b/onnxruntime/core/providers/openvino/ov_stateful_patch_utils.cc @@ -60,7 +60,7 @@ bool ModelHasInputOutputNames(std::shared_ptr model, const std::strin } std::string GetInputOutputName(std::shared_ptr ov_model, - const std::vector& candidate_names) { + const std::vector& candidate_names) { for (const auto& name : candidate_names) { if (ModelHasInputOutputNames(ov_model, name)) { return name; @@ -78,12 +78,12 @@ void FuseCacheReorder(std::shared_ptr ov_model, throw std::runtime_error("Model already has fused cache"); } - // Define input name candidates in priority order + // Define input name candidates in priority order const std::vector input_name_candidates = { - "inputs_embeds", // Default fallback - "input_ids", // Most common - "input_hidden_states", // Alternative - "/model/embed_tokens/Gather_output_0" // Specific model type + "inputs_embeds", // Default fallback + "input_ids", // Most common + "input_hidden_states", // Alternative + "/model/embed_tokens/Gather_output_0" // Specific model type }; std::string main_input_name = GetInputOutputName(ov_model, input_name_candidates); diff --git a/onnxruntime/core/providers/openvino/qdq_transformations/qdq_scales_fix.cpp b/onnxruntime/core/providers/openvino/qdq_transformations/qdq_scales_fix.cpp index a7b5c51882ff4..84d391a3f2ff3 100644 --- a/onnxruntime/core/providers/openvino/qdq_transformations/qdq_scales_fix.cpp +++ b/onnxruntime/core/providers/openvino/qdq_transformations/qdq_scales_fix.cpp @@ -472,7 +472,7 @@ struct CustomGraph { ORT_ENFORCE(type_str != nullptr, "Type string is null in QDQ scales fix."); auto type_cast = type_str->find("tensor(float)") != std::string::npos ? onnx::TensorProto_DataType_FLOAT : onnx::TensorProto_DataType_FLOAT16; ORT_ENFORCE((type_cast == onnx::TensorProto_DataType_FLOAT) || (type_str->find("tensor(float16)") != std::string::npos), - "QDQ type misalignment, expected float32 or float16 output"); + "QDQ type misalignment, expected float32 or float16 output"); cast_node.AddAttribute("to", static_cast(type_cast)); original_graph.AddEdge(prev.node_ptr->Index(), cast_node.Index(), diff --git a/onnxruntime/python/onnxruntime_pybind_state.cc b/onnxruntime/python/onnxruntime_pybind_state.cc index 704716e80eb1d..92cf6b085c01e 100644 --- a/onnxruntime/python/onnxruntime_pybind_state.cc +++ b/onnxruntime/python/onnxruntime_pybind_state.cc @@ -2810,8 +2810,7 @@ including arg name, arg type (contains both type and shape).)pbdoc") ORT_THROW("TunableOp and get_tuning_results are not supported in this build."); #endif }) - .def( - "set_ep_dynamic_options", [](PyInferenceSession* sess, const py::dict& options) { + .def("set_ep_dynamic_options", [](PyInferenceSession* sess, const py::dict& options) { std::vector keys; std::vector values; std::vector key_strings; @@ -2841,9 +2840,8 @@ including arg name, arg type (contains both type and shape).)pbdoc") if (!status.IsOK()) { ORT_THROW("Failed to set EP dynamic options: " + status.ErrorMessage()); - } - }, - R"pbdoc(Set dynamic options for execution providers. + } }, + R"pbdoc(Set dynamic options for execution providers. Args: options (dict): Dictionary of key-value pairs where both keys and values are strings.