mlboydaisuke's picture
Multifunction chunks: SDPA decode + N=512 prefill, 50% weight dedup
d445d15 verified
[
{
"metadataOutputVersion" : "3.0",
"storagePrecision" : "Mixed (Float16, Palettized (10 bits), Palettized (11 bits), Palettized (13 bits), Palettized (7 bits), UInt4)",
"outputSchema" : [
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 1 × 1536)",
"shortDescription" : "",
"shape" : "[1, 1, 1536]",
"name" : "hidden_states_out",
"type" : "MultiArray"
}
],
"modelParameters" : [
],
"specificationVersion" : 9,
"functions" : [
{
"inputSchema" : [
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 1 × 1536)",
"shortDescription" : "",
"shape" : "[1, 1, 1536]",
"name" : "hidden_states",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 1 × 1 × 2048)",
"shortDescription" : "",
"shape" : "[1, 1, 1, 2048]",
"name" : "causal_mask_full",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 1 × 1 × 512)",
"shortDescription" : "",
"shape" : "[1, 1, 1, 512]",
"name" : "causal_mask_sliding",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 1 × 2048 × 1)",
"shortDescription" : "",
"shape" : "[1, 1, 2048, 1]",
"name" : "update_mask",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 1 × 8960)",
"shortDescription" : "",
"shape" : "[1, 1, 8960]",
"name" : "per_layer_combined",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 1 × 1 × 256)",
"shortDescription" : "",
"shape" : "[1, 1, 1, 256]",
"name" : "cos_s",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 1 × 1 × 256)",
"shortDescription" : "",
"shape" : "[1, 1, 1, 256]",
"name" : "sin_s",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 1 × 1 × 512)",
"shortDescription" : "",
"shape" : "[1, 1, 1, 512]",
"name" : "cos_f",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 1 × 1 × 512)",
"shortDescription" : "",
"shape" : "[1, 1, 1, 512]",
"name" : "sin_f",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 1 × 512 × 256)",
"shortDescription" : "",
"shape" : "[1, 1, 512, 256]",
"name" : "kv13_k",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 1 × 512 × 256)",
"shortDescription" : "",
"shape" : "[1, 1, 512, 256]",
"name" : "kv13_v",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 1 × 2048 × 512)",
"shortDescription" : "",
"shape" : "[1, 1, 2048, 512]",
"name" : "kv14_k",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 1 × 2048 × 512)",
"shortDescription" : "",
"shape" : "[1, 1, 2048, 512]",
"name" : "kv14_v",
"type" : "MultiArray"
}
],
"computePrecision" : "Mixed (Float16, Int32)",
"storagePrecision" : "Mixed (Float16, Palettized (10 bits), Palettized (11 bits), Palettized (13 bits), Palettized (7 bits), UInt4)",
"stateSchema" : [
],
"outputSchema" : [
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 1 × 1536)",
"shortDescription" : "",
"shape" : "[1, 1, 1536]",
"name" : "hidden_states_out",
"type" : "MultiArray"
}
],
"name" : "decode",
"mlProgramOperationTypeHistogram" : {
"Ios18.constexprLutToDense" : 70,
"Ios18.scaledDotProductAttention" : 10,
"Ios18.expandDims" : 40,
"Ios18.conv" : 70,
"Ios18.gelu" : 20,
"Ios18.concat" : 70,
"Ios18.add" : 40,
"Ios18.sliceByIndex" : 10,
"Tile" : 4,
"Ios18.transpose" : 112,
"Ios18.layerNorm" : 60,
"Ios18.squeeze" : 20,
"Ios18.reshape" : 48,
"Split" : 70,
"Identity" : 1,
"Ios18.mul" : 180
}
},
{
"inputSchema" : [
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 512 × 1536)",
"shortDescription" : "",
"shape" : "[1, 512, 1536]",
"name" : "hidden_states",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 1 × 512 × 512)",
"shortDescription" : "",
"shape" : "[1, 1, 512, 512]",
"name" : "causal_mask",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 512 × 8960)",
"shortDescription" : "",
"shape" : "[1, 512, 8960]",
"name" : "per_layer_combined",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 1 × 512 × 256)",
"shortDescription" : "",
"shape" : "[1, 1, 512, 256]",
"name" : "cos_s",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 1 × 512 × 256)",
"shortDescription" : "",
"shape" : "[1, 1, 512, 256]",
"name" : "sin_s",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 1 × 512 × 512)",
"shortDescription" : "",
"shape" : "[1, 1, 512, 512]",
"name" : "cos_f",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 1 × 512 × 512)",
"shortDescription" : "",
"shape" : "[1, 1, 512, 512]",
"name" : "sin_f",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 1 × 512 × 256)",
"shortDescription" : "",
"shape" : "[1, 1, 512, 256]",
"name" : "kv13_k",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 1 × 512 × 256)",
"shortDescription" : "",
"shape" : "[1, 1, 512, 256]",
"name" : "kv13_v",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 1 × 512 × 512)",
"shortDescription" : "",
"shape" : "[1, 1, 512, 512]",
"name" : "kv14_k",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 1 × 512 × 512)",
"shortDescription" : "",
"shape" : "[1, 1, 512, 512]",
"name" : "kv14_v",
"type" : "MultiArray"
}
],
"computePrecision" : "Mixed (Float16, Int32)",
"storagePrecision" : "Mixed (Float16, Palettized (10 bits), Palettized (11 bits), Palettized (13 bits), Palettized (7 bits), UInt4)",
"stateSchema" : [
],
"outputSchema" : [
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 512 × 1536)",
"shortDescription" : "",
"shape" : "[1, 512, 1536]",
"name" : "hidden_states_out",
"type" : "MultiArray"
}
],
"name" : "prefill",
"mlProgramOperationTypeHistogram" : {
"Ios18.constexprLutToDense" : 70,
"Ios18.scaledDotProductAttention" : 10,
"Ios18.expandDims" : 40,
"Ios18.conv" : 70,
"Ios18.gelu" : 20,
"Ios18.concat" : 70,
"Ios18.add" : 40,
"Ios18.sliceByIndex" : 10,
"Tile" : 4,
"Ios18.transpose" : 122,
"Ios18.layerNorm" : 60,
"Ios18.squeeze" : 20,
"Ios18.reshape" : 48,
"Split" : 70,
"Ios18.mul" : 180
}
}
],
"mlProgramOperationTypeHistogram" : {
"Ios18.constexprLutToDense" : 70,
"Ios18.scaledDotProductAttention" : 10,
"Ios18.expandDims" : 40,
"Ios18.conv" : 70,
"Ios18.gelu" : 20,
"Ios18.concat" : 70,
"Ios18.add" : 40,
"Ios18.sliceByIndex" : 10,
"Tile" : 4,
"Ios18.transpose" : 112,
"Ios18.layerNorm" : 60,
"Ios18.squeeze" : 20,
"Ios18.reshape" : 48,
"Split" : 70,
"Identity" : 1,
"Ios18.mul" : 180
},
"isUpdatable" : "0",
"stateSchema" : [
],
"availability" : {
"macOS" : "15.0",
"tvOS" : "18.0",
"visionOS" : "2.0",
"watchOS" : "11.0",
"iOS" : "18.0",
"macCatalyst" : "18.0"
},
"computePrecision" : "Mixed (Float16, Int32)",
"modelType" : {
"name" : "MLModelType_mlProgram"
},
"inputSchema" : [
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 1 × 1536)",
"shortDescription" : "",
"shape" : "[1, 1, 1536]",
"name" : "hidden_states",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 1 × 1 × 2048)",
"shortDescription" : "",
"shape" : "[1, 1, 1, 2048]",
"name" : "causal_mask_full",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 1 × 1 × 512)",
"shortDescription" : "",
"shape" : "[1, 1, 1, 512]",
"name" : "causal_mask_sliding",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 1 × 2048 × 1)",
"shortDescription" : "",
"shape" : "[1, 1, 2048, 1]",
"name" : "update_mask",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 1 × 8960)",
"shortDescription" : "",
"shape" : "[1, 1, 8960]",
"name" : "per_layer_combined",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 1 × 1 × 256)",
"shortDescription" : "",
"shape" : "[1, 1, 1, 256]",
"name" : "cos_s",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 1 × 1 × 256)",
"shortDescription" : "",
"shape" : "[1, 1, 1, 256]",
"name" : "sin_s",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 1 × 1 × 512)",
"shortDescription" : "",
"shape" : "[1, 1, 1, 512]",
"name" : "cos_f",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 1 × 1 × 512)",
"shortDescription" : "",
"shape" : "[1, 1, 1, 512]",
"name" : "sin_f",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 1 × 512 × 256)",
"shortDescription" : "",
"shape" : "[1, 1, 512, 256]",
"name" : "kv13_k",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 1 × 512 × 256)",
"shortDescription" : "",
"shape" : "[1, 1, 512, 256]",
"name" : "kv13_v",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 1 × 2048 × 512)",
"shortDescription" : "",
"shape" : "[1, 1, 2048, 512]",
"name" : "kv14_k",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 1 × 2048 × 512)",
"shortDescription" : "",
"shape" : "[1, 1, 2048, 512]",
"name" : "kv14_v",
"type" : "MultiArray"
}
],
"defaultFunctionName" : "decode",
"generatedClassName" : "chunk3",
"userDefinedMetadata" : {
},
"method" : "predict"
}
]