smpanaro's picture
Update sequoia mode with transposed value cache and 4:508 input:cache length
722eedf verified
[
{
"metadataOutputVersion" : "3.0",
"storagePrecision" : "Float16",
"outputSchema" : [
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 4096 × 1 × 512)",
"shortDescription" : "",
"shape" : "[1, 4096, 1, 512]",
"name" : "new_x",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 32 × 128 × 508)",
"shortDescription" : "",
"shape" : "[1, 32, 128, 508]",
"name" : "new_k_cache_0",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 32 × 128 × 508)",
"shortDescription" : "",
"shape" : "[1, 32, 128, 508]",
"name" : "new_k_cache_1",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 32 × 128 × 508)",
"shortDescription" : "",
"shape" : "[1, 32, 128, 508]",
"name" : "new_k_cache_2",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 32 × 508 × 128)",
"shortDescription" : "",
"shape" : "[1, 32, 508, 128]",
"name" : "new_v_cache_0",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 32 × 508 × 128)",
"shortDescription" : "",
"shape" : "[1, 32, 508, 128]",
"name" : "new_v_cache_1",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 32 × 508 × 128)",
"shortDescription" : "",
"shape" : "[1, 32, 508, 128]",
"name" : "new_v_cache_2",
"type" : "MultiArray"
}
],
"modelParameters" : [
],
"specificationVersion" : 9,
"functions" : [
{
"inputSchema" : [
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 4096 × 1 × 512)",
"shortDescription" : "",
"shape" : "[1, 4096, 1, 512]",
"name" : "x",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 128 × 512)",
"shortDescription" : "",
"shape" : "[128, 512]",
"name" : "cos",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 128 × 512)",
"shortDescription" : "",
"shape" : "[128, 512]",
"name" : "sin",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 1 × 512 × 512)",
"shortDescription" : "",
"shape" : "[1, 1, 512, 512]",
"name" : "mask",
"type" : "MultiArray"
}
],
"computePrecision" : "Mixed (Float16, Int32)",
"storagePrecision" : "Float16",
"stateSchema" : [
],
"outputSchema" : [
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 4096 × 1 × 512)",
"shortDescription" : "",
"shape" : "[1, 4096, 1, 512]",
"name" : "new_x",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 32 × 128 × 508)",
"shortDescription" : "",
"shape" : "[1, 32, 128, 508]",
"name" : "new_k_cache_0",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 32 × 128 × 508)",
"shortDescription" : "",
"shape" : "[1, 32, 128, 508]",
"name" : "new_k_cache_1",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 32 × 128 × 508)",
"shortDescription" : "",
"shape" : "[1, 32, 128, 508]",
"name" : "new_k_cache_2",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 32 × 508 × 128)",
"shortDescription" : "",
"shape" : "[1, 32, 508, 128]",
"name" : "new_v_cache_0",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 32 × 508 × 128)",
"shortDescription" : "",
"shape" : "[1, 32, 508, 128]",
"name" : "new_v_cache_1",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 32 × 508 × 128)",
"shortDescription" : "",
"shape" : "[1, 32, 508, 128]",
"name" : "new_v_cache_2",
"type" : "MultiArray"
}
],
"name" : "input_512_context_512",
"mlProgramOperationTypeHistogram" : {
"Ios18.constexprLutToDense" : 21,
"Ios18.conv" : 21,
"Ios18.expandDims" : 6,
"Ios18.matmul" : 6,
"Ios18.concat" : 12,
"Ios18.add" : 15,
"Ios18.realDiv" : 6,
"Ios18.silu" : 3,
"Ios18.softmax" : 3,
"Ios18.sliceByIndex" : 18,
"Ios18.transpose" : 6,
"Ios16.reduceL2Norm" : 6,
"Ios18.squeeze" : 6,
"Ios18.reshape" : 12,
"Ios18.mul" : 57
}
},
{
"inputSchema" : [
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 4096 × 1 × 4)",
"shortDescription" : "",
"shape" : "[1, 4096, 1, 4]",
"name" : "x",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 128 × 4)",
"shortDescription" : "",
"shape" : "[128, 4]",
"name" : "cos",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 128 × 4)",
"shortDescription" : "",
"shape" : "[128, 4]",
"name" : "sin",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 1 × 4 × 512)",
"shortDescription" : "",
"shape" : "[1, 1, 4, 512]",
"name" : "mask",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "1",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 32 × 128 × 508)?",
"shortDescription" : "",
"shape" : "[1, 32, 128, 508]",
"name" : "k_cache_0",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "1",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 32 × 508 × 128)?",
"shortDescription" : "",
"shape" : "[1, 32, 508, 128]",
"name" : "v_cache_0",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "1",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 32 × 128 × 508)?",
"shortDescription" : "",
"shape" : "[1, 32, 128, 508]",
"name" : "k_cache_1",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "1",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 32 × 508 × 128)?",
"shortDescription" : "",
"shape" : "[1, 32, 508, 128]",
"name" : "v_cache_1",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "1",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 32 × 128 × 508)?",
"shortDescription" : "",
"shape" : "[1, 32, 128, 508]",
"name" : "k_cache_2",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "1",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 32 × 508 × 128)?",
"shortDescription" : "",
"shape" : "[1, 32, 508, 128]",
"name" : "v_cache_2",
"type" : "MultiArray"
}
],
"computePrecision" : "Mixed (Float16, Int32)",
"storagePrecision" : "Float16",
"stateSchema" : [
],
"outputSchema" : [
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 4096 × 1 × 4)",
"shortDescription" : "",
"shape" : "[1, 4096, 1, 4]",
"name" : "new_x",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 32 × 128 × 508)",
"shortDescription" : "",
"shape" : "[1, 32, 128, 508]",
"name" : "new_k_cache_0",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 32 × 128 × 508)",
"shortDescription" : "",
"shape" : "[1, 32, 128, 508]",
"name" : "new_k_cache_1",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 32 × 128 × 508)",
"shortDescription" : "",
"shape" : "[1, 32, 128, 508]",
"name" : "new_k_cache_2",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 32 × 508 × 128)",
"shortDescription" : "",
"shape" : "[1, 32, 508, 128]",
"name" : "new_v_cache_0",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 32 × 508 × 128)",
"shortDescription" : "",
"shape" : "[1, 32, 508, 128]",
"name" : "new_v_cache_1",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 32 × 508 × 128)",
"shortDescription" : "",
"shape" : "[1, 32, 508, 128]",
"name" : "new_v_cache_2",
"type" : "MultiArray"
}
],
"name" : "input_1_context_512",
"mlProgramOperationTypeHistogram" : {
"Ios18.constexprLutToDense" : 21,
"Ios18.conv" : 21,
"Ios18.expandDims" : 6,
"Ios18.matmul" : 6,
"Ios18.concat" : 18,
"Ios18.add" : 15,
"Ios18.realDiv" : 6,
"Ios18.silu" : 3,
"Ios18.softmax" : 3,
"Ios18.sliceByIndex" : 18,
"Ios18.transpose" : 6,
"Ios16.reduceL2Norm" : 6,
"Ios18.squeeze" : 6,
"Ios18.reshape" : 12,
"Ios18.mul" : 57
}
}
],
"mlProgramOperationTypeHistogram" : {
"Ios18.constexprLutToDense" : 21,
"Ios18.conv" : 21,
"Ios18.expandDims" : 6,
"Ios18.matmul" : 6,
"Ios18.concat" : 12,
"Ios18.add" : 15,
"Ios18.realDiv" : 6,
"Ios18.silu" : 3,
"Ios18.softmax" : 3,
"Ios18.sliceByIndex" : 18,
"Ios18.transpose" : 6,
"Ios16.reduceL2Norm" : 6,
"Ios18.squeeze" : 6,
"Ios18.reshape" : 12,
"Ios18.mul" : 57
},
"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 × 4096 × 1 × 512)",
"shortDescription" : "",
"shape" : "[1, 4096, 1, 512]",
"name" : "x",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 128 × 512)",
"shortDescription" : "",
"shape" : "[128, 512]",
"name" : "cos",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 128 × 512)",
"shortDescription" : "",
"shape" : "[128, 512]",
"name" : "sin",
"type" : "MultiArray"
},
{
"hasShapeFlexibility" : "0",
"isOptional" : "0",
"dataType" : "Float16",
"formattedType" : "MultiArray (Float16 1 × 1 × 512 × 512)",
"shortDescription" : "",
"shape" : "[1, 1, 512, 512]",
"name" : "mask",
"type" : "MultiArray"
}
],
"defaultFunctionName" : "input_512_context_512",
"generatedClassName" : "Llama_2_7b_hf_2024_07_17_19_34_17_merged_chunk2",
"userDefinedMetadata" : {
},
"method" : "predict"
}
]