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

Merged
merged 27 commits into from
Mar 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
2b8129d
Adding x64 to the ARCHs
jchen351 Jan 8, 2025
a494b38
Update macos to 14
jchen351 Jan 8, 2025
6a5c760
update xcode version
jchen351 Jan 8, 2025
3bd93d6
API_AVAILABLE(macos(15), ios(18))
jchen351 Jan 8, 2025
2058317
adding arm64 preset
jchen351 Jan 8, 2025
09f793f
merge with main
jchen351 Jan 9, 2025
e6e3747
Merge branch 'main' into Cjian/macos_14
jchen351 Jan 9, 2025
2eb900a
Adding preprocessor define for checking CAN_USE_COREML8_OR_LATER
jchen351 Jan 10, 2025
f8d1e9b
Adding preprocessor define for checking CAN_USE_COREML8_OR_LATER
jchen351 Jan 10, 2025
f142392
rolling back ios changes
jchen351 Jan 10, 2025
f4accbe
Apply suggestions from code review
jchen351 Jan 10, 2025
9af881a
update project.pbxproj
jchen351 Jan 14, 2025
f1a195b
using the new Podfile
jchen351 Jan 14, 2025
0ebf33a
update Podfile and comment out :mac_catalyst_enabled => false,
jchen351 Jan 14, 2025
e858aa7
Merge branch 'main' into Cjian/macos_14
jchen351 Feb 26, 2025
402f047
Merge branch 'main' into Cjian/macos_14
jchen351 Mar 7, 2025
48574ef
Merge branch 'main' into Cjian/macos_14
jchen351 Mar 7, 2025
275f799
Merge remote-tracking branch 'origin/main' into Cjian/macos_14
jchen351 Mar 7, 2025
d300649
update ios target
jchen351 Mar 7, 2025
59e7ccc
Trying apple_deploy_target to 16.0
jchen351 Mar 12, 2025
af7c0d4
Rolling back 16.0 and add condition to check if FP16 ios supported
jchen351 Mar 12, 2025
e60e3ca
Reformat code
jchen351 Mar 12, 2025
df6ef97
Update #define CAN_BUILD_COREML6_OR_LATER (__MAC_OS_X_VERSION_MAX_ALL…
jchen351 Mar 13, 2025
940d3f3
Merge branch 'main' into Cjian/macos_14
jchen351 Mar 13, 2025
f1bfade
Update #if __has_include(<CoreML/MLOptimizationHints.h>) && CAN_BUILD…
jchen351 Mar 13, 2025
f8c5b09
Lint update
jchen351 Mar 14, 2025
12a84c8
Upgrade simulator to iPhone 15 iOS 17.4
jchen351 Mar 17, 2025
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
23 changes: 23 additions & 0 deletions cmake/CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,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
4 changes: 2 additions & 2 deletions js/react_native/e2e/.detoxrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ module.exports = {
simulator: {
type: 'ios.simulator',
device: {
type: 'iPhone 14',
os: 'iOS 16.4',
type: 'iPhone 15',
os: 'iOS 17.4',
},
},
attached: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "core/providers/coreml/builders/helper.h"
#include "core/providers/coreml/builders/impl/base_op_builder.h"
#include "core/providers/coreml/builders/model_builder.h"
#include "core/providers/coreml/model/host_utils.h"
#include "core/providers/shared/utils/utils.h"

using namespace CoreML::Specification;
Expand Down Expand Up @@ -113,10 +114,12 @@ bool BaseOpBuilder::IsInputDtypeSupport(const Node& node, size_t idx,
return true;
}

#if CAN_BUILD_COREML6_OR_LATER
// only MLProgram support FP16
if (input_params.create_mlprogram && input_type == ONNX_NAMESPACE::TensorProto_DataType_FLOAT16) {
return true;
}
#endif

LOGS(logger, VERBOSE) << "[" << node.OpType() << "] Input type: [" << input_type << "] is not currently supported";
return false;
Expand Down
8 changes: 7 additions & 1 deletion onnxruntime/core/providers/coreml/model/host_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,13 @@
#define API_AVAILABLE_COREML7 API_AVAILABLE(macos(14), ios(17))
#define API_AVAILABLE_COREML8 API_AVAILABLE(macos(15), ios(18))

// @available is used in implementation code
// The previous macros are used in header files to declare the availability of the APIs.
// The following macros are used in build time checks to determine if the APIs are available.
#define CAN_BUILD_COREML8_OR_LATER (__MAC_OS_X_VERSION_MAX_ALLOWED >= 150000 && __IPHONE_OS_VERSION_MAX_ALLOWED >= 180000)
#define CAN_BUILD_COREML7_OR_LATER (__MAC_OS_X_VERSION_MAX_ALLOWED >= 140000 && __IPHONE_OS_VERSION_MAX_ALLOWED >= 170000)
#define CAN_BUILD_COREML6_OR_LATER (__MAC_OS_X_VERSION_MAX_ALLOWED >= 130000 && __IPHONE_OS_VERSION_MAX_ALLOWED >= 160000)

// @available is used in implementation code to check the availability of the APIs at runtime.
// Base required OS to run CoreML Specification Version 4 (Core ML 3)
#define HAS_COREML3_OR_LATER @available(macOS 10.15, iOS 13, *)
#define HAS_COREML4_OR_LATER @available(macOS 11, iOS 14, *)
Expand Down
3 changes: 1 addition & 2 deletions onnxruntime/core/providers/coreml/model/model.mm
Original file line number Diff line number Diff line change
Expand Up @@ -363,13 +363,12 @@ void ProfileComputePlan(NSURL* compileUrl, MLModelConfiguration* config) {
#endif
}

#if __has_include(<CoreML/MLOptimizationHints.h>)
#if __has_include(<CoreML/MLOptimizationHints.h>) && CAN_BUILD_COREML8_OR_LATER
#define HAS_COREMLOPTIMIZATIONHINT 1
#else
#define HAS_COREMLOPTIMIZATIONHINT 0
#endif

API_AVAILABLE_COREML8
void ConfigureOptimizationHints(MLModelConfiguration* config, const CoreMLOptions& coreml_options) {
#if HAS_COREMLOPTIMIZATIONHINT
MLOptimizationHints* optimizationHints = [[MLOptimizationHints alloc] init];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ extends:
# Update the pool with your team's 1ES hosted pool.
pool:
name: "Azure Pipelines"
image: "macOS-13"
image: "macOS-14"
os: macOS
sdl:
sourceAnalysisPool:
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 @@ -427,7 +427,7 @@ stages:
- job: IosDynamicFramework
timeoutInMinutes: 120
pool:
vmImage: "macOS-13"
vmImage: "macOS-14"

steps:
- task: UsePythonVersion@0
Expand Down Expand Up @@ -463,7 +463,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'
arch: 'x86_64'
- template: templates/py-package-smoking-test.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ stages:
clean: all
pool:
name: "Azure Pipelines"
image: "macOS-13"
image: "macOS-14"
os: macOS
variables:
MACOSX_DEPLOYMENT_TARGET: '13.3'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:
pool: 'onnxruntime-Ubuntu2204-AMD-CPU'
workspace:
clean: all
pool:
vmImage: 'macOS-14'
variables:
runCodesignValidationInjection: false
ANDROID_AVD_HOME: $(Agent.TempDirectory)
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 @@ -123,7 +123,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 @@ -797,7 +797,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 @@ -833,4 +833,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 @@ -64,11 +64,11 @@ stages:
- job: ReactNative_CI_iOS
${{ if eq(parameters.is1ES, false) }}:
pool:
vmImage: 'macOS-13'
vmImage: 'macOS-14'
${{ if eq(parameters.is1ES, true) }}:
pool:
name: 'Azure Pipelines'
image: 'macOS-13'
image: 'macOS-14'
os: 'macOS'

timeoutInMinutes: 120
Expand Down Expand Up @@ -212,7 +212,7 @@ stages:
scheme: 'OnnxruntimeModuleTest'
packageApp: false
destinationPlatformOption: 'iOS'
destinationSimulators: 'iPhone 14,OS=16.4'
destinationSimulators: 'iPhone 15,OS=17.4'
workingDirectory: '$(Build.SourcesDirectory)/js/react_native/ios'
xcprettyArgs: '--output build/reports/test-results.xml'
publishJUnitResults: true
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
Loading