Skip to content

Commit c8be7de

Browse files
authored
Disable MLOptimizationHints
1 parent bcf186e commit c8be7de

File tree

1 file changed

+6
-4
lines changed
  • onnxruntime/core/providers/coreml/model

1 file changed

+6
-4
lines changed

onnxruntime/core/providers/coreml/model/model.mm

+6-4
Original file line numberDiff line numberDiff line change
@@ -547,10 +547,12 @@ Status Predict(const std::unordered_map<std::string, OnnxTensorData>& inputs,
547547
}
548548

549549
// Set the specialization strategy to FastPrediction for macOS 10.15+
550-
if (HAS_COREML8_OR_LATER) {
551-
ConfigureOptimizationHints(config, coreml_options_);
552-
} else {
553-
LOGS(logger_, WARNING) << "iOS 17.4+/macOS 14.4+ or later is required to ConfigureOptimizationHints";
550+
if (@available(macOS 14.4, iOS 17.4, *)) {
551+
if (HAS_COREML8_OR_LATER) {
552+
ConfigureOptimizationHints(config, coreml_options_);
553+
} else {
554+
LOGS(logger_, WARNING) << "iOS 17.4+/macOS 14.4+ or later is required to ConfigureOptimizationHints";
555+
}
554556
}
555557

556558
if (coreml_options_.ProfileComputePlan()) {

0 commit comments

Comments
 (0)