Skip to content

Commit 73d59fc

Browse files
committed
[CVS-182934] Allowing user selected value for disable_dynamic_shapes for CPU/GPU
1 parent 6bf490a commit 73d59fc

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

onnxruntime/core/providers/openvino/openvino_provider_factory.cc

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -374,13 +374,10 @@ static void ParseProviderInfo(const ProviderOptions& provider_options,
374374
}
375375

376376
// Should likely account for meta devices as well, but for now keep the current behavior.
377-
bool target_devices_support_dynamic_shapes =
378-
pi.device_type.find("GPU") != std::string::npos ||
379-
pi.device_type.find("CPU") != std::string::npos ||
380-
(pi.device_type.find("NPU") != std::string::npos &&
381-
pi.enable_causallm);
382-
383-
pi.disable_dynamic_shapes = !target_devices_support_dynamic_shapes;
377+
// Respect the user-provided option for CPU/GPU. For NPU, keep the existing constraint:
378+
if (pi.device_type.find("NPU") != std::string::npos && !pi.enable_causallm) {
379+
pi.disable_dynamic_shapes = true;
380+
}
384381
}
385382

386383
struct OpenVINOProviderFactory : IExecutionProviderFactory {

0 commit comments

Comments
 (0)