Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions onnxruntime/core/providers/openvino/openvino_provider_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -374,13 +374,12 @@ static void ParseProviderInfo(const ProviderOptions& provider_options,
}

// Should likely account for meta devices as well, but for now keep the current behavior.
bool target_devices_support_dynamic_shapes =
pi.device_type.find("GPU") != std::string::npos ||
pi.device_type.find("CPU") != std::string::npos ||
(pi.device_type.find("NPU") != std::string::npos &&
pi.enable_causallm);

pi.disable_dynamic_shapes = !target_devices_support_dynamic_shapes;
// Respect the user-provided option for CPU/GPU. For NPU, keep the existing constraint:
const bool is_npu_device = pi.device_type.find("NPU") != std::string::npos;
if (is_npu_device && pi.enable_causallm && pi.disable_dynamic_shapes) {
LOGS_DEFAULT(WARNING) << "Enabling dynamic shapes for NPU because CausalLM is enabled.";
pi.disable_dynamic_shapes = false;
}
}

struct OpenVINOProviderFactory : IExecutionProviderFactory {
Expand Down
Loading