Update ORT to 1.24.1 (#42)

This commit is contained in:
Edward Chen
2026-02-24 17:24:30 -08:00
committed by GitHub
11 changed files with 69 additions and 18 deletions
@@ -3,7 +3,7 @@
displayName: "Test with ORT Extensions native pod" displayName: "Test with ORT Extensions native pod"
pool: pool:
vmImage: "macOS-13" vmImage: "macOS-14"
variables: variables:
artifactsName: "ios_packaging_artifacts_full" artifactsName: "ios_packaging_artifacts_full"
@@ -87,9 +87,9 @@
cp "$(Build.ArtifactStagingDirectory)/$(artifactsNameForExt)/${POD_ARCHIVE_EXT}" swift/ cp "$(Build.ArtifactStagingDirectory)/$(artifactsNameForExt)/${POD_ARCHIVE_EXT}" swift/
export ORT_EXTENSIONS_POD_LOCAL_PATH="swift/${POD_ARCHIVE_EXT}" export ORT_EXTENSIONS_POD_LOCAL_PATH="swift/${POD_ARCHIVE_EXT}"
xcodebuild test -scheme onnxruntime-Package -destination 'platform=iOS Simulator,name=iPhone 14' xcodebuild test -scheme onnxruntime-Package -destination 'platform=iOS Simulator,name=iPhone 16'
xcodebuild test -scheme onnxruntime-Package -destination 'platform=macosx' xcodebuild test -scheme onnxruntime-Package -destination 'platform=macOS'
rm swift/pod-archive-onnxruntime-c-*.zip rm swift/pod-archive-onnxruntime-c-*.zip
rm swift/pod-archive-onnxruntime-extensions-c-*.zip rm swift/pod-archive-onnxruntime-extensions-c-*.zip
@@ -3,7 +3,7 @@
displayName: "Test with released ORT native pod" displayName: "Test with released ORT native pod"
pool: pool:
vmImage: "macOS-13" vmImage: "macOS-14"
timeoutInMinutes: 60 timeoutInMinutes: 60
@@ -14,8 +14,8 @@
# and OnnxRuntimeExtensions targets. # and OnnxRuntimeExtensions targets.
- script: | - script: |
set -e -x set -e -x
xcodebuild test -scheme onnxruntime-Package -destination 'platform=iOS Simulator,name=iPhone 14' xcodebuild test -scheme onnxruntime-Package -destination 'platform=iOS Simulator,name=iPhone 16'
xcodebuild test -scheme onnxruntime-Package -destination 'platform=macosx' xcodebuild test -scheme onnxruntime-Package -destination 'platform=macOS'
workingDirectory: "$(Build.SourcesDirectory)" workingDirectory: "$(Build.SourcesDirectory)"
displayName: "Test Package.swift usage" displayName: "Test Package.swift usage"
+1 -1
View File
@@ -3,7 +3,7 @@
parameters: parameters:
- name: xcodeVersion - name: xcodeVersion
type: string type: string
default: "14.3.1" default: "16.2"
steps: steps:
- bash: | - bash: |
+6 -9
View File
@@ -1,7 +1,5 @@
// swift-tools-version: 5.6 // swift-tools-version: 5.9
// The swift-tools-version declares the minimum version of Swift required to build this package and MUST be the first
// line of this file. 5.6 is required to support zip files for the pod archive binaryTarget.
//
// Copyright (c) Microsoft Corporation. All rights reserved. // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. // Licensed under the MIT License.
// //
@@ -21,8 +19,8 @@ import class Foundation.ProcessInfo
let package = Package( let package = Package(
name: "onnxruntime", name: "onnxruntime",
platforms: [.iOS(.v13), platforms: [.iOS(.v15),
.macOS(.v11)], .macOS(.v14)],
products: [ products: [
.library(name: "onnxruntime", .library(name: "onnxruntime",
type: .static, type: .static,
@@ -86,7 +84,6 @@ if let pod_archive_path = ProcessInfo.processInfo.environment["ORT_POD_LOCAL_PAT
// See https://onnxruntime.ai/docs/build/custom.html#ios // See https://onnxruntime.ai/docs/build/custom.html#ios
// Example command: // Example command:
// python3 tools/ci_build/github/apple/build_and_assemble_apple_pods.py \ // python3 tools/ci_build/github/apple/build_and_assemble_apple_pods.py \
// --variant Full \
// --build-settings-file tools/ci_build/github/apple/default_full_apple_framework_build_settings.json // --build-settings-file tools/ci_build/github/apple/default_full_apple_framework_build_settings.json
// //
// This should produce the pod archive in build/apple_pod_staging, and ORT_POD_LOCAL_PATH can be set to // This should produce the pod archive in build/apple_pod_staging, and ORT_POD_LOCAL_PATH can be set to
@@ -98,9 +95,9 @@ if let pod_archive_path = ProcessInfo.processInfo.environment["ORT_POD_LOCAL_PAT
// ORT release // ORT release
package.targets.append( package.targets.append(
Target.binaryTarget(name: "onnxruntime", Target.binaryTarget(name: "onnxruntime",
url: "https://download.onnxruntime.ai/pod-archive-onnxruntime-c-1.23.0.zip", url: "https://download.onnxruntime.ai/pod-archive-onnxruntime-c-1.24.1.zip",
// SHA256 checksum // SHA256 checksum
checksum: "756a78e0168f29840bc614b43aeb03e63673f44022e0221d21698a2c8ed747ef") checksum: "dab5e98ceba017cfcb74d4a03cc3ab3f0069ede02bc9334ee81ebee310e6e639")
) )
} }
+1 -1
View File
@@ -11,7 +11,7 @@ void ORTSaveCodeAndDescriptionToError(int code, const char* descriptionCstr, NSE
if (!error) return; if (!error) return;
NSString* description = [NSString stringWithCString:descriptionCstr NSString* description = [NSString stringWithCString:descriptionCstr
encoding:NSASCIIStringEncoding]; encoding:NSUTF8StringEncoding];
*error = [NSError errorWithDomain:kOrtErrorDomain *error = [NSError errorWithDomain:kOrtErrorDomain
code:code code:code
@@ -70,7 +70,22 @@ NS_ASSUME_NONNULL_BEGIN
*/ */
- (BOOL)appendCoreMLExecutionProviderWithOptions:(ORTCoreMLExecutionProviderOptions*)options - (BOOL)appendCoreMLExecutionProviderWithOptions:(ORTCoreMLExecutionProviderOptions*)options
error:(NSError**)error; error:(NSError**)error;
/**
* Enables the CoreML execution provider in the session configuration options.
* It is appended to the execution provider list which is ordered by
* decreasing priority.
*
* @param provider_options The CoreML execution provider options in dict.
* available keys-values: more detail in core/providers/coreml/coreml_execution_provider.h
* kCoremlProviderOption_MLComputeUnits: one of "CPUAndNeuralEngine", "CPUAndGPU", "CPUOnly", "All"
* kCoremlProviderOption_ModelFormat: one of "MLProgram", "NeuralNetwork"
* kCoremlProviderOption_RequireStaticInputShapes: "1" or "0"
* kCoremlProviderOption_EnableOnSubgraphs: "1" or "0"
* @param error Optional error information set if an error occurs.
* @return Whether the provider was enabled successfully.
*/
- (BOOL)appendCoreMLExecutionProviderWithOptionsV2:(NSDictionary*)provider_options
error:(NSError**)error;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
+1
View File
@@ -50,6 +50,7 @@ typedef NS_ENUM(int32_t, ORTGraphOptimizationLevel) {
ORTGraphOptimizationLevelNone, ORTGraphOptimizationLevelNone,
ORTGraphOptimizationLevelBasic, ORTGraphOptimizationLevelBasic,
ORTGraphOptimizationLevelExtended, ORTGraphOptimizationLevelExtended,
ORTGraphOptimizationLevelLayout,
ORTGraphOptimizationLevelAll, ORTGraphOptimizationLevelAll,
}; };
@@ -43,6 +43,21 @@ BOOL ORTIsCoreMLExecutionProviderAvailable() {
#endif #endif
} }
- (BOOL)appendCoreMLExecutionProviderWithOptionsV2:(NSDictionary*)provider_options
error:(NSError**)error {
#if ORT_OBJC_API_COREML_EP_AVAILABLE
try {
return [self appendExecutionProvider:@"CoreML" providerOptions:provider_options error:error];
}
ORT_OBJC_API_IMPL_CATCH_RETURNING_BOOL(error);
#else // !ORT_OBJC_API_COREML_EP_AVAILABLE
static_cast<void>(provider_options);
ORTSaveCodeAndDescriptionToError(ORT_FAIL, "CoreML execution provider is not enabled.", error);
return NO;
#endif
}
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
+1
View File
@@ -68,6 +68,7 @@ constexpr GraphOptimizationLevelInfo kGraphOptimizationLevelInfos[]{
{ORTGraphOptimizationLevelNone, ORT_DISABLE_ALL}, {ORTGraphOptimizationLevelNone, ORT_DISABLE_ALL},
{ORTGraphOptimizationLevelBasic, ORT_ENABLE_BASIC}, {ORTGraphOptimizationLevelBasic, ORT_ENABLE_BASIC},
{ORTGraphOptimizationLevelExtended, ORT_ENABLE_EXTENDED}, {ORTGraphOptimizationLevelExtended, ORT_ENABLE_EXTENDED},
{ORTGraphOptimizationLevelLayout, ORT_ENABLE_LAYOUT},
{ORTGraphOptimizationLevelAll, ORT_ENABLE_ALL}, {ORTGraphOptimizationLevelAll, ORT_ENABLE_ALL},
}; };
+22
View File
@@ -223,6 +223,28 @@ NS_ASSUME_NONNULL_BEGIN
ORTAssertNullableResultSuccessful(session, err); ORTAssertNullableResultSuccessful(session, err);
} }
- (void)testAppendCoreMLEP_v2 {
NSError* err = nil;
ORTSessionOptions* sessionOptions = [ORTSessionTest makeSessionOptions];
NSDictionary* provider_options = @{@"EnableOnSubgraphs" : @"1"}; // set an arbitrary option
BOOL appendResult = [sessionOptions appendCoreMLExecutionProviderWithOptionsV2:provider_options
error:&err];
if (!ORTIsCoreMLExecutionProviderAvailable()) {
ORTAssertBoolResultUnsuccessful(appendResult, err);
return;
}
ORTAssertBoolResultSuccessful(appendResult, err);
ORTSession* session = [[ORTSession alloc] initWithEnv:self.ortEnv
modelPath:[ORTSessionTest getAddModelPath]
sessionOptions:sessionOptions
error:&err];
ORTAssertNullableResultSuccessful(session, err);
}
- (void)testAppendXnnpackEP { - (void)testAppendXnnpackEP {
NSError* err = nil; NSError* err = nil;
ORTSessionOptions* sessionOptions = [ORTSessionTest makeSessionOptions]; ORTSessionOptions* sessionOptions = [ORTSessionTest makeSessionOptions];
Vendored Regular → Executable
View File