Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade current MacOS-13 to 14 #23293

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ jobs:
--osx_arch=${{ matrix.target_arch }}

Vcpkg:
runs-on: macos-13
runs-on: macOS-14
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand Down
23 changes: 23 additions & 0 deletions cmake/CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,29 @@
"rhs": "Darwin"
}
},
{
"name": "arm64-osx",
"inherits": [
"unit-test"
],
"generator": "Xcode",
"binaryDir": "${sourceParentDir}/cmake_build/arm64-osx",
"installDir": "${sourceParentDir}/cmake_build/out",
"cacheVariables": {
"CMAKE_OSX_ARCHITECTURES": "arm64",
"onnxruntime_BUILD_SHARED_LIB": true,
"onnxruntime_USE_XNNPACK": false,
"onnxruntime_USE_COREML": true,
"onnxruntime_BUILD_OBJC": true,
"onnxruntime_BUILD_APPLE_FRAMEWORK": true,
"CMAKE_CONFIGURATION_TYPES": "Debug;Release"
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Darwin"
}
},
{
"name": "x64-osx-vcpkg",
"inherits": [
Expand Down
16 changes: 13 additions & 3 deletions js/react_native/e2e/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '13.0'
platform :ios, '15.1'

pre_install do |installer|
# Custom pre-install script or commands
Expand All @@ -15,7 +15,14 @@ end
target 'OnnxruntimeModuleExample' do
config = use_native_modules!

use_react_native!(:path => config["reactNativePath"])
]# Check both symbol and string keys with default value
use_react_native!(
:path => config[:reactNativePath],
# Hermes is now enabled by default. Disable by setting this flag to false.
# Upcoming versions of React Native may rely on get_default_flags(), but
# we make it explicit here to aid in the React Native upgrade process.
:hermes_enabled => false
)

use_frameworks!

Expand All @@ -32,7 +39,10 @@ post_install do |installer|
installer.generated_projects.each do |project|
project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.1'

# TODO: remove this once we migrate the Pipelines to use arm64 MacOS
config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = "arm64"
end
end
end
Expand Down
18 changes: 13 additions & 5 deletions js/react_native/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '13.0'
platform :ios, '15.1'

pre_install do |installer|
# Custom pre-install script or commands
Expand All @@ -15,8 +15,14 @@ end
def shared
config = use_native_modules!

use_react_native!(:path => config["reactNativePath"])

# Check both symbol and string keys with default value
use_react_native!(
:path => config[:reactNativePath],
# Hermes is now enabled by default. Disable by setting this flag to false.
# Upcoming versions of React Native may rely on get_default_flags(), but
# we make it explicit here to aid in the React Native upgrade process.
:hermes_enabled => false
)
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!

Expand All @@ -43,8 +49,10 @@ post_install do |installer|
installer.generated_projects.each do |project|
project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.1'
# TODO: remove this once we migrate the Pipelines to use arm64 MacOS
config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = "arm64"
end
end
end
end
end
24 changes: 13 additions & 11 deletions onnxruntime/core/providers/coreml/model/model.mm
Original file line number Diff line number Diff line change
Expand Up @@ -369,20 +369,22 @@ void ProfileComputePlan(NSURL* compileUrl, MLModelConfiguration* config) {
#define HAS_COREMLOPTIMIZATIONHINT 0
#endif

API_AVAILABLE_COREML8

void ConfigureOptimizationHints(MLModelConfiguration* config, const CoreMLOptions& coreml_options) {
if (HAS_COREML8_OR_LATER) {
#if HAS_COREMLOPTIMIZATIONHINT
MLOptimizationHints* optimizationHints = [[MLOptimizationHints alloc] init];
if (coreml_options.UseStrategy("FastPrediction")) {
optimizationHints.specializationStrategy = MLSpecializationStrategyFastPrediction;
config.optimizationHints = optimizationHints;
} else if (coreml_options.UseStrategy("Default")) {
optimizationHints.specializationStrategy = MLSpecializationStrategyDefault;
config.optimizationHints = optimizationHints;
} else {
// not set
}
MLOptimizationHints* optimizationHints = [[MLOptimizationHints alloc] init];
if (coreml_options.UseStrategy("FastPrediction")) {
optimizationHints.specializationStrategy = MLSpecializationStrategyFastPrediction;
config.optimizationHints = optimizationHints;
} else if (coreml_options.UseStrategy("Default")) {
optimizationHints.specializationStrategy = MLSpecializationStrategyDefault;
config.optimizationHints = optimizationHints;
} else {
// not set
}
#endif
}
}

Status CompileOrReadCachedModel(NSURL* modelUrl, const CoreMLOptions& coreml_options,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
workspace:
clean: all
pool:
vmImage: 'macOS-13'
vmImage: 'macOS-14'
variables:
MACOSX_DEPLOYMENT_TARGET: '13.3'
TODAY: $[format('{0:dd}{0:MM}{0:yyyy}', pipeline.startTime)]
Expand Down
4 changes: 2 additions & 2 deletions tools/ci_build/github/azure-pipelines/mac-ios-ci-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ pr:
jobs:
- job: iOS_CI_on_Mac
pool:
vmImage: 'macOS-13'
vmImage: 'macOS-14'
variables:
PROTO_CACHE_DIR: $(Pipeline.Workspace)/proto_ccache
ORT_CACHE_DIR: $(Pipeline.Workspace)/ort_ccache
TODAY: $[format('{0:dd}{0:MM}{0:yyyy}', pipeline.startTime)]
# Note: Keep the Xcode version and iOS simulator version compatible.
# Check the table here to see what iOS simulator versions are supported by a particular Xcode version:
# https://developer.apple.com/support/xcode/
XCODE_VERSION: 14.3.1
XCODE_VERSION: 15.3.0
IOS_SIMULATOR_RUNTIME_VERSION: 16.4
timeoutInMinutes: 150
steps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ stages:
displayName: "Set common variables"

pool:
vmImage: "macOS-13"
vmImage: "macOS-14"

timeoutInMinutes: 5

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ stages:
clean: all
timeoutInMinutes: 120
pool:
vmImage: 'macOS-13'
vmImage: 'macOS-14'

variables:
- name: OnnxRuntimeBuildDirectory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ stages:
workspace:
clean: all
pool:
vmImage: 'macOS-13'
vmImage: 'macOS-14'

variables:
- name: OnnxRuntimeBuildDirectory
Expand Down
4 changes: 2 additions & 2 deletions tools/ci_build/github/azure-pipelines/post-merge-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ stages:
- job: IosDynamicFramework
timeoutInMinutes: 120
pool:
vmImage: "macOS-13"
vmImage: "macOS-14"

steps:
- task: UsePythonVersion@0
Expand Down Expand Up @@ -459,7 +459,7 @@ stages:
- job: IosMinimalTrainingBuild
timeoutInMinutes: 120
pool:
vmImage: "macOS-13"
vmImage: "macOS-14"

steps:
- task: UsePythonVersion@0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ stages:
parameters:
job_name: Test_MAC_Wheels
machine_pool:
vmImage: 'macOS-13'
vmImage: 'macOS-14'
itemPattern: '*/*mac*x86_64.whl'
- template: templates/py-package-smoking-test.yml
parameters:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ stages:
workspace:
clean: all
pool:
vmImage: 'macOS-13'
vmImage: 'macOS-14'
variables:
MACOSX_DEPLOYMENT_TARGET: '13.3'
strategy:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
workspace:
clean: all
pool:
vmImage: 'macOS-13'
vmImage: 'macOS-14'
variables:
- name: runCodesignValidationInjection
value: false
Expand Down
6 changes: 3 additions & 3 deletions tools/ci_build/github/azure-pipelines/templates/c-api-cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ stages:
workspace:
clean: all
pool:
vmImage: 'macOS-13'
vmImage: 'macOS-14'
timeoutInMinutes: 300
steps:
- template: set-version-number-variables-step.yml
Expand Down Expand Up @@ -816,7 +816,7 @@ stages:

- template: ../nuget/templates/test_macos.yml
parameters:
AgentPool : macOS-13
AgentPool : macOS-14
ArtifactSuffix: 'CPU'

- template: ../nodejs/templates/test_win.yml
Expand Down Expand Up @@ -852,4 +852,4 @@ stages:
OS: MacOS
BuildId: ${{ parameters.BuildId }}
SpecificArtifact: ${{ parameters.SpecificArtifact }}
PoolName: 'macOS-13'
PoolName: 'macOS-14'
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ stages:
jobs:
- job: MacOS_C_API_Package_Publish
pool:
vmImage: 'macOS-13'
vmImage: 'macOS-14'
steps:
- checkout: none
- template: flex-downloadPipelineArtifact.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
PROTO_CACHE_DIR: $(Pipeline.Workspace)/ccache_proto
ORT_CACHE_DIR: $(Pipeline.Workspace)/ccache_ort
pool:
vmImage: 'macOS-13'
vmImage: 'macOS-14'
timeoutInMinutes: 300
steps:
- checkout: self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ stages:

- job: Build_Ios_Pod_For_React_Native
pool:
vmImage: 'macOS-13'
vmImage: 'macOS-14'

timeoutInMinutes: 90

Expand Down Expand Up @@ -103,7 +103,7 @@ stages:
jobs:
- job: ReactNative_CI
pool:
vmImage: 'macOS-13'
vmImage: 'macOS-14'
variables:
runCodesignValidationInjection: false
timeoutInMinutes: 90
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ stages:
displayName: "Build iOS package for variant: ${{ parameters.packageVariant}}"

pool:
vmImage: "macOS-13"
vmImage: "macOS-14"

variables:
# Note: Keep the Xcode version and iOS simulator version compatible.
# Check the table here to see what iOS simulator versions are supported by a particular Xcode version:
# https://developer.apple.com/support/xcode/
xcodeVersion: "14.3.1"
xcodeVersion: "15.3.0"
iosSimulatorRuntimeVersion: "16.4"

ortPodVersion: $[stageDependencies.IosPackaging_SetCommonVariables.j.outputs['SetCommonVariables.ORT_POD_VERSION']]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
parameters:
- name: xcodeVersion
type: string
default: "14.3.1"
default: "15.3.0"

steps:
- bash: |
Expand Down