Skip to content

Commit 50e8039

Browse files
intbfankitm3k
authored andcommitted
[GPU] Enable qdq_stripping path for GPU (#694)
* update the statement so that we run CreateModelWithStrippedQDQNodes on GPU * ensure the capability checks are also updated * update the comment Signed-off-by: bfilipek <[email protected]> --------- Signed-off-by: bfilipek <[email protected]>
1 parent f150035 commit 50e8039

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

onnxruntime/core/providers/openvino/backend_manager.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,9 @@ BackendManager::GetModelProtoFromFusedNode(const onnxruntime::Node& fused_node,
380380
#endif
381381

382382
const auto& onnx_model_path_name = subgraph.ModelPath();
383-
// QDQ stripping enabled only for the NPU
384-
if (session_context_.device_type.find("NPU") != std::string::npos &&
383+
// QDQ stripping enabled only for the NPU and experimentally on the GPU
384+
if ((session_context_.device_type.find("NPU") != std::string::npos ||
385+
session_context_.device_type.find("GPU") != std::string::npos) &&
385386
(enable_ovep_qdq_optimizer || session_context_.so_share_ep_contexts)) {
386387
std::unique_ptr<onnxruntime::Model> model;
387388
Status status = CreateModelWithStrippedQDQNodes(subgraph, logger, session_context_.so_share_ep_contexts, enable_ovep_qdq_optimizer, model, shared_context_.shared_weights);

onnxruntime/core/providers/openvino/ov_versions/capability.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ GetCapability::GetCapability(const EPCtxHandler& ep_ctx_handler,
3434
graph_viewer_(graph_viewer_param),
3535
device_type_(std::move(device_type_param)) {
3636
bool npu_qdq_optimizer_enabled = false;
37-
if (device_type_.find("NPU") != std::string::npos) {
37+
if (device_type_.find("NPU") != std::string::npos || device_type_.find("GPU") != std::string::npos) {
3838
device_type_ = "CPU";
3939
if (enable_qdq_optimizer) npu_qdq_optimizer_enabled = true;
4040
}

0 commit comments

Comments
 (0)