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
[MLCompute] Add support for Xcode 13 beta 4. #12348
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,9 +92,15 @@ enum MLCConvolutionType { | |
enum MLCDataType { | ||
Invalid = 0, | ||
Float32 = 1, | ||
[iOS (15,0), TV (15,0), Mac (12,0), MacCatalyst (15,0)] | ||
Float16 = 3, | ||
Boolean = 4, | ||
Int64 = 5, | ||
Int32 = 7, | ||
Inot32 = 7, | ||
[iOS (15,0), TV (15,0), Mac (12,0), MacCatalyst (15,0)] | ||
Int8 = 8, | ||
[iOS (15,0), TV (15,0), Mac (12,0), MacCatalyst (15,0)] | ||
UInt8 = 9, | ||
// Count, // must be last, not available in swift | ||
} | ||
|
||
|
@@ -104,6 +110,7 @@ enum MLCDeviceType /* int32_t */ { | |
Cpu = 0, | ||
Gpu = 1, | ||
Any = 2, | ||
Ane = 3, // Apple neural engine | ||
spouliot marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// Count, // must be last, not available in swift | ||
} | ||
|
||
|
@@ -116,6 +123,7 @@ enum MLCExecutionOptions : ulong { | |
Synchronous = 0x2, | ||
Profiling = 0x4, | ||
ForwardForInference = 0x8, | ||
PerLayerProfiling = 0x10, | ||
spouliot marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
[iOS (14,0)][TV (14,0)][Mac (11,0)] | ||
|
@@ -229,6 +237,14 @@ enum MLCSoftmaxOperation { | |
LogSoftmax = 1, | ||
} | ||
|
||
[iOS (15,0), TV (15,0), Mac (12,0), NoWatch] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. catalyst ? |
||
public enum MLCGradientClippingType { | ||
Value = 0, | ||
Norm = 1, | ||
GlobalNorm = 2, | ||
} | ||
|
||
|
||
[iOS (14,0)][TV (14,0)][Mac (11,0)] | ||
[NoWatch] | ||
[BaseType (typeof (NSObject))] | ||
|
@@ -286,6 +302,10 @@ interface MLCLayer { | |
[Static] | ||
[Export ("supportsDataType:onDevice:")] | ||
bool SupportsDataType (MLCDataType dataType, MLCDeviceType device); | ||
|
||
[TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] | ||
[Export ("deviceType")] | ||
MLCDeviceType DeviceType { get; } | ||
} | ||
|
||
[iOS (14,0)][TV (14,0)][Mac (11,0)] | ||
|
@@ -442,6 +462,18 @@ interface MLCOptimizer : NSCopying { | |
|
||
[Export ("regularizationType")] | ||
MLCRegularizationType RegularizationType { get; } | ||
|
||
[TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] | ||
[Export ("gradientClippingType")] | ||
MLCGradientClippingType GradientClippingType { get; } | ||
|
||
[TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] | ||
[Export ("maximumClippingNorm")] | ||
float MaximumClippingNorm { get; } | ||
|
||
[TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] | ||
[Export ("customGlobalNorm")] | ||
float CustomGlobalNorm { get; } | ||
} | ||
|
||
[iOS (14,0)][TV (14,0)][Mac (11,0)] | ||
|
@@ -478,6 +510,23 @@ interface MLCOptimizerDescriptor : NSCopying { | |
[Static] | ||
[Export ("descriptorWithLearningRate:gradientRescale:appliesGradientClipping:gradientClipMax:gradientClipMin:regularizationType:regularizationScale:")] | ||
MLCOptimizerDescriptor Create (float learningRate, float gradientRescale, bool appliesGradientClipping, float gradientClipMax, float gradientClipMin, MLCRegularizationType regularizationType, float regularizationScale); | ||
|
||
[TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] | ||
[Static] | ||
[Export ("descriptorWithLearningRate:gradientRescale:appliesGradientClipping:gradientClippingType:gradientClipMax:gradientClipMin:maximumClippingNorm:customGlobalNorm:regularizationType:regularizationScale:")] | ||
MLCOptimizerDescriptor Create (float learningRate, float gradientRescale, bool appliesGradientClipping, MLCGradientClippingType gradientClippingType, float gradientClipMax, float gradientClipMin, float maximumClippingNorm, float customGlobalNorm, MLCRegularizationType regularizationType, float regularizationScale); | ||
|
||
[TV (15, 0), Mac (12, 0), iOS (15, 0), MacCatalyst (15,0)] | ||
[Export ("gradientClippingType")] | ||
MLCGradientClippingType GradientClippingType { get; } | ||
|
||
[TV (15, 0), Mac (12, 0), iOS (15, 0), MacCatalyst (15,0)] | ||
[Export ("maximumClippingNorm")] | ||
float MaximumClippingNorm { get; } | ||
|
||
[TV (15, 0), Mac (12, 0), iOS (15, 0), MacCatalyst (15,0)] | ||
[Export ("customGlobalNorm")] | ||
float CustomGlobalNorm { get; } | ||
} | ||
|
||
[iOS (14,0)][TV (14,0)][Mac (11,0)] | ||
|
@@ -498,13 +547,22 @@ interface MLCAdamOptimizer : NSCopying { | |
[Export ("timeStep")] | ||
nuint TimeStep { get; } | ||
|
||
[TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] | ||
[Export ("usesAMSGrad")] | ||
bool UsesAmsGrad { get; } | ||
|
||
[Static] | ||
[Export ("optimizerWithDescriptor:")] | ||
MLCAdamOptimizer Create (MLCOptimizerDescriptor optimizerDescriptor); | ||
|
||
[Static] | ||
[Export ("optimizerWithDescriptor:beta1:beta2:epsilon:timeStep:")] | ||
MLCAdamOptimizer Create (MLCOptimizerDescriptor optimizerDescriptor, float beta1, float beta2, float epsilon, nuint timeStep); | ||
|
||
[TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] | ||
[Static] | ||
[Export ("optimizerWithDescriptor:beta1:beta2:epsilon:usesAMSGrad:timeStep:")] | ||
MLCAdamOptimizer Create (MLCOptimizerDescriptor optimizerDescriptor, float beta1, float beta2, float epsilon, bool usesAmsGrad, nuint timeStep); | ||
} | ||
|
||
[iOS (14,0)][TV (14,0)][Mac (11,0)] | ||
|
@@ -538,11 +596,21 @@ interface MLCDevice : NSCopying { | |
[return: NullAllowed] | ||
MLCDevice GetDevice (IMTLDevice[] gpus); | ||
|
||
[TV (15,0), Mac (12,0), iOS (15,0)] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. catalyst ? |
||
[Static] | ||
[Export ("aneDevice")] | ||
[return: NullAllowed] | ||
MLCDevice GetAneDevice (); | ||
|
||
[iOS (14,2)][TV (14,2)] | ||
[Static] | ||
[Export ("deviceWithType:selectsMultipleComputeDevices:")] | ||
[return: NullAllowed] | ||
MLCDevice GetDevice (MLCDeviceType type, bool selectsMultipleComputeDevices); | ||
|
||
[TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] | ||
[Export ("actualDeviceType")] | ||
MLCDeviceType ActualDeviceType { get; } | ||
} | ||
|
||
[iOS (14,0)][TV (14,0)][Mac (11,0)] | ||
|
@@ -673,6 +741,31 @@ interface MLCTensor : NSCopying { | |
|
||
[Export ("bindOptimizerData:deviceData:")] | ||
bool BindOptimizer (MLCTensorData[] data, [NullAllowed] MLCTensorOptimizerDeviceData[] deviceData); | ||
|
||
[TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] | ||
[Export ("tensorByQuantizingToType:scale:bias:")] | ||
[return: NullAllowed] | ||
MLCTensor CreateByQuantizing (MLCDataType type, float scale, nint bias); | ||
|
||
[TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] | ||
[Export ("tensorByDequantizingToType:scale:bias:")] | ||
[return: NullAllowed] | ||
MLCTensor CreateByDequantizing (MLCDataType type, MLCTensor scale, MLCTensor bias); | ||
|
||
[TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] | ||
[Export ("tensorByQuantizingToType:scale:bias:axis:")] | ||
[return: NullAllowed] | ||
MLCTensor CreateByQuantizing (MLCDataType type, MLCTensor scale, MLCTensor bias, nint axis); | ||
|
||
[TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] | ||
[Export ("tensorByDequantizingToType:scale:bias:axis:")] | ||
[return: NullAllowed] | ||
MLCTensor CreateByDequantizing (MLCDataType type, MLCTensor scale, MLCTensor bias, nint axis); | ||
|
||
[Static] | ||
[TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] | ||
[Export ("tensorWithShape:randomInitializerType:dataType:")] | ||
MLCTensor Create (NSNumber[] shape, MLCRandomInitializerType randomInitializerType, MLCDataType dataType); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
} | ||
|
||
[iOS (14,0)][TV (14,0)][Mac (11,0)] | ||
|
@@ -2282,4 +2375,48 @@ interface MLCSelectionLayer { | |
[Export ("layer")] | ||
MLCSelectionLayer Create (); | ||
} | ||
|
||
[TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] | ||
[BaseType (typeof (NSObject))] | ||
spouliot marked this conversation as resolved.
Show resolved
Hide resolved
|
||
interface MLCPlatform { | ||
|
||
[Static] | ||
[Export ("setRNGSeedTo:")] | ||
void SetRngSeedTo ([BindAs (typeof (nuint))] NSNumber seed); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. -> |
||
|
||
[return: BindAs (typeof (nuint)), NullAllowed] | ||
[Static] | ||
[Export ("getRNGseed")] | ||
NSNumber GetRngSeed (); | ||
} | ||
|
||
[TV (15,0), Mac (12,0), iOS (15,0)] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. catalyst ? |
||
[BaseType (typeof (MLCOptimizer))] | ||
[DisableDefaultCtor] | ||
interface MLCAdamWOptimizer : NSCopying | ||
{ | ||
[Export ("beta1")] | ||
float Beta1 { get; } | ||
|
||
[Export ("beta2")] | ||
float Beta2 { get; } | ||
|
||
[Export ("epsilon")] | ||
float Epsilon { get; } | ||
|
||
[Export ("usesAMSGrad")] | ||
bool UsesAmsGrad { get; } | ||
|
||
[Export ("timeStep")] | ||
nuint TimeStep { get; } | ||
|
||
[Static] | ||
[Export ("optimizerWithDescriptor:")] | ||
MLCAdamWOptimizer GetOptimizer (MLCOptimizerDescriptor optimizerDescriptor); | ||
|
||
[Static] | ||
[Export ("optimizerWithDescriptor:beta1:beta2:epsilon:usesAMSGrad:timeStep:")] | ||
MLCAdamWOptimizer GetOptimizer (MLCOptimizerDescriptor optimizerDescriptor, float beta1, float beta2, float epsilon, bool usesAMSGrad, nuint timeStep); | ||
spouliot marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
} |
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
catalyst ?