Clemens Hemmerling commited on
Commit
c522826
·
1 Parent(s): d4e745f

compile model

Browse files
CompiledModel/TinyGPT2.mlmodelc/analytics/coremldata.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8eed951770f6ddba60b999585b5de885d80064e66d3f345097a7926aaf73b021
3
+ size 243
CompiledModel/TinyGPT2.mlmodelc/coremldata.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9dbf3328fbbf2b00822542623df28b9ba447db58b7a5557e6c9d03fc7df6ccae
3
+ size 317
CompiledModel/TinyGPT2.mlmodelc/metadata.json ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "metadataOutputVersion" : "3.0",
4
+ "storagePrecision" : "Float16",
5
+ "outputSchema" : [
6
+ {
7
+ "hasShapeFlexibility" : "0",
8
+ "isOptional" : "0",
9
+ "dataType" : "Float16",
10
+ "formattedType" : "MultiArray (Float16 1 × 5 × 50257)",
11
+ "shortDescription" : "",
12
+ "shape" : "[1, 5, 50257]",
13
+ "name" : "var_289",
14
+ "type" : "MultiArray"
15
+ }
16
+ ],
17
+ "modelParameters" : [
18
+
19
+ ],
20
+ "specificationVersion" : 8,
21
+ "mlProgramOperationTypeHistogram" : {
22
+ "Ios17.layerNorm" : 5,
23
+ "Ios17.reshape" : 22,
24
+ "Ios17.cast" : 1,
25
+ "Ios17.gather" : 1,
26
+ "Split" : 2,
27
+ "Ios17.matmul" : 12,
28
+ "Ios17.add" : 7,
29
+ "Ios17.transpose" : 8,
30
+ "Ios16.softmax" : 2,
31
+ "Ios16.gelu" : 2,
32
+ "Ios17.linear" : 1
33
+ },
34
+ "computePrecision" : "Mixed (Float16, Int32)",
35
+ "isUpdatable" : "0",
36
+ "stateSchema" : [
37
+
38
+ ],
39
+ "availability" : {
40
+ "macOS" : "14.0",
41
+ "tvOS" : "17.0",
42
+ "visionOS" : "1.0",
43
+ "watchOS" : "10.0",
44
+ "iOS" : "17.0",
45
+ "macCatalyst" : "17.0"
46
+ },
47
+ "modelType" : {
48
+ "name" : "MLModelType_mlProgram"
49
+ },
50
+ "userDefinedMetadata" : {
51
+ "com.github.apple.coremltools.source_dialect" : "TorchScript",
52
+ "com.github.apple.coremltools.source" : "torch==2.6.0",
53
+ "com.github.apple.coremltools.version" : "8.2"
54
+ },
55
+ "inputSchema" : [
56
+ {
57
+ "hasShapeFlexibility" : "0",
58
+ "isOptional" : "0",
59
+ "dataType" : "Float16",
60
+ "formattedType" : "MultiArray (Float16 1 × 5)",
61
+ "shortDescription" : "",
62
+ "shape" : "[1, 5]",
63
+ "name" : "input_ids_1",
64
+ "type" : "MultiArray"
65
+ }
66
+ ],
67
+ "generatedClassName" : "TinyGPT2",
68
+ "method" : "predict"
69
+ }
70
+ ]
CompiledModel/TinyGPT2.mlmodelc/model.mil ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ program(1.0)
2
+ [buildInfo = dict<tensor<string, []>, tensor<string, []>>({{"coremlc-component-MIL", "3404.16.1"}, {"coremlc-version", "3404.23.1"}, {"coremltools-component-torch", "2.6.0"}, {"coremltools-source-dialect", "TorchScript"}, {"coremltools-version", "8.2"}})]
3
+ {
4
+ func main<ios17>(tensor<fp16, [1, 5]> input_ids_1) {
5
+ tensor<string, []> cast_2_dtype_0 = const()[name = tensor<string, []>("cast_2_dtype_0"), val = tensor<string, []>("int32")];
6
+ tensor<int32, []> inputs_embeds_axis_0 = const()[name = tensor<string, []>("inputs_embeds_axis_0"), val = tensor<int32, []>(0)];
7
+ tensor<int32, []> inputs_embeds_batch_dims_0 = const()[name = tensor<string, []>("inputs_embeds_batch_dims_0"), val = tensor<int32, []>(0)];
8
+ tensor<bool, []> inputs_embeds_validate_indices_0 = const()[name = tensor<string, []>("inputs_embeds_validate_indices_0"), val = tensor<bool, []>(false)];
9
+ tensor<fp16, [50257, 2]> model_transformer_wte_weight_to_fp16 = const()[name = tensor<string, []>("model_transformer_wte_weight_to_fp16"), val = tensor<fp16, [50257, 2]>(BLOBFILE(path = tensor<string, []>("@model_path/weights/weight.bin"), offset = tensor<uint64, []>(64)))];
10
+ tensor<int32, [1, 5]> input_ids_1_to_int32 = cast(dtype = cast_2_dtype_0, x = input_ids_1)[name = tensor<string, []>("cast_32")];
11
+ tensor<fp16, [1, 5, 2]> inputs_embeds_cast_fp16 = gather(axis = inputs_embeds_axis_0, batch_dims = inputs_embeds_batch_dims_0, indices = input_ids_1_to_int32, validate_indices = inputs_embeds_validate_indices_0, x = model_transformer_wte_weight_to_fp16)[name = tensor<string, []>("inputs_embeds_cast_fp16")];
12
+ tensor<fp16, [1, 5, 2]> const_3_to_fp16 = const()[name = tensor<string, []>("const_3_to_fp16"), val = tensor<fp16, [1, 5, 2]>(BLOBFILE(path = tensor<string, []>("@model_path/weights/weight.bin"), offset = tensor<uint64, []>(201216)))];
13
+ tensor<fp16, [1, 5, 2]> input_3_cast_fp16 = add(x = inputs_embeds_cast_fp16, y = const_3_to_fp16)[name = tensor<string, []>("input_3_cast_fp16")];
14
+ tensor<int32, [1]> x_1_axes_0 = const()[name = tensor<string, []>("x_1_axes_0"), val = tensor<int32, [1]>([-1])];
15
+ tensor<fp16, [2]> model_transformer_h_0_ln_1_weight_to_fp16 = const()[name = tensor<string, []>("model_transformer_h_0_ln_1_weight_to_fp16"), val = tensor<fp16, [2]>([0x1p+0, 0x1p+0])];
16
+ tensor<fp16, [2]> model_transformer_h_0_ln_1_bias_to_fp16 = const()[name = tensor<string, []>("model_transformer_h_0_ln_1_bias_to_fp16"), val = tensor<fp16, [2]>([0x0p+0, 0x0p+0])];
17
+ tensor<fp16, []> var_19_to_fp16 = const()[name = tensor<string, []>("op_19_to_fp16"), val = tensor<fp16, []>(0x1.5p-17)];
18
+ tensor<fp16, [1, 5, 2]> x_1_cast_fp16 = layer_norm(axes = x_1_axes_0, beta = model_transformer_h_0_ln_1_bias_to_fp16, epsilon = var_19_to_fp16, gamma = model_transformer_h_0_ln_1_weight_to_fp16, x = input_3_cast_fp16)[name = tensor<string, []>("x_1_cast_fp16")];
19
+ tensor<int32, [2]> var_88 = const()[name = tensor<string, []>("op_88"), val = tensor<int32, [2]>([-1, 2])];
20
+ tensor<fp16, [5, 2]> var_89_cast_fp16 = reshape(shape = var_88, x = x_1_cast_fp16)[name = tensor<string, []>("op_89_cast_fp16")];
21
+ tensor<bool, []> matmul_0_transpose_x_0 = const()[name = tensor<string, []>("matmul_0_transpose_x_0"), val = tensor<bool, []>(false)];
22
+ tensor<bool, []> matmul_0_transpose_y_0 = const()[name = tensor<string, []>("matmul_0_transpose_y_0"), val = tensor<bool, []>(false)];
23
+ tensor<fp16, [2, 6]> model_transformer_h_0_attn_c_attn_weight_to_fp16 = const()[name = tensor<string, []>("model_transformer_h_0_attn_c_attn_weight_to_fp16"), val = tensor<fp16, [2, 6]>(BLOBFILE(path = tensor<string, []>("@model_path/weights/weight.bin"), offset = tensor<uint64, []>(201344)))];
24
+ tensor<fp16, [5, 6]> matmul_0_cast_fp16 = matmul(transpose_x = matmul_0_transpose_x_0, transpose_y = matmul_0_transpose_y_0, x = var_89_cast_fp16, y = model_transformer_h_0_attn_c_attn_weight_to_fp16)[name = tensor<string, []>("matmul_0_cast_fp16")];
25
+ tensor<int32, [3]> var_91 = const()[name = tensor<string, []>("op_91"), val = tensor<int32, [3]>([1, 5, 6])];
26
+ tensor<fp16, [1, 5, 6]> var_92_cast_fp16 = reshape(shape = var_91, x = matmul_0_cast_fp16)[name = tensor<string, []>("op_92_cast_fp16")];
27
+ tensor<int32, [3]> tile_0 = const()[name = tensor<string, []>("tile_0"), val = tensor<int32, [3]>([2, 2, 2])];
28
+ tensor<int32, []> var_93_axis_0 = const()[name = tensor<string, []>("op_93_axis_0"), val = tensor<int32, []>(2)];
29
+ tensor<fp16, [1, 5, 2]> var_93_cast_fp16_0, tensor<fp16, [1, 5, 2]> var_93_cast_fp16_1, tensor<fp16, [1, 5, 2]> var_93_cast_fp16_2 = split(axis = var_93_axis_0, split_sizes = tile_0, x = var_92_cast_fp16)[name = tensor<string, []>("op_93_cast_fp16")];
30
+ tensor<int32, [4]> var_101 = const()[name = tensor<string, []>("op_101"), val = tensor<int32, [4]>([1, 5, -1, 1])];
31
+ tensor<fp16, [1, 5, 2, 1]> var_102_cast_fp16 = reshape(shape = var_101, x = var_93_cast_fp16_0)[name = tensor<string, []>("op_102_cast_fp16")];
32
+ tensor<int32, [4]> var_104 = const()[name = tensor<string, []>("op_104"), val = tensor<int32, [4]>([1, 5, -1, 1])];
33
+ tensor<fp16, [1, 5, 2, 1]> var_105_cast_fp16 = reshape(shape = var_104, x = var_93_cast_fp16_1)[name = tensor<string, []>("op_105_cast_fp16")];
34
+ tensor<int32, [4]> var_107 = const()[name = tensor<string, []>("op_107"), val = tensor<int32, [4]>([1, 5, -1, 1])];
35
+ tensor<fp16, [1, 5, 2, 1]> var_108_cast_fp16 = reshape(shape = var_107, x = var_93_cast_fp16_2)[name = tensor<string, []>("op_108_cast_fp16")];
36
+ tensor<int32, [4]> value_1_perm_0 = const()[name = tensor<string, []>("value_1_perm_0"), val = tensor<int32, [4]>([0, 2, 1, 3])];
37
+ tensor<bool, []> matmul_1_transpose_y_0 = const()[name = tensor<string, []>("matmul_1_transpose_y_0"), val = tensor<bool, []>(true)];
38
+ tensor<bool, []> matmul_1_transpose_x_0 = const()[name = tensor<string, []>("matmul_1_transpose_x_0"), val = tensor<bool, []>(false)];
39
+ tensor<int32, [4]> transpose_8_perm_0 = const()[name = tensor<string, []>("transpose_8_perm_0"), val = tensor<int32, [4]>([0, 2, -3, -1])];
40
+ tensor<int32, [4]> transpose_9_perm_0 = const()[name = tensor<string, []>("transpose_9_perm_0"), val = tensor<int32, [4]>([0, 2, -3, -1])];
41
+ tensor<fp16, [1, 2, 5, 1]> transpose_9 = transpose(perm = transpose_9_perm_0, x = var_105_cast_fp16)[name = tensor<string, []>("transpose_17")];
42
+ tensor<fp16, [1, 2, 5, 1]> transpose_8 = transpose(perm = transpose_8_perm_0, x = var_102_cast_fp16)[name = tensor<string, []>("transpose_18")];
43
+ tensor<fp16, [1, 2, 5, 5]> matmul_1_cast_fp16 = matmul(transpose_x = matmul_1_transpose_x_0, transpose_y = matmul_1_transpose_y_0, x = transpose_8, y = transpose_9)[name = tensor<string, []>("matmul_1_cast_fp16")];
44
+ tensor<fp16, [1, 1, 5, 5]> var_64_to_fp16 = const()[name = tensor<string, []>("op_64_to_fp16"), val = tensor<fp16, [1, 1, 5, 5]>(BLOBFILE(path = tensor<string, []>("@model_path/weights/weight.bin"), offset = tensor<uint64, []>(201472)))];
45
+ tensor<fp16, [1, 2, 5, 5]> add_0_cast_fp16 = add(x = matmul_1_cast_fp16, y = var_64_to_fp16)[name = tensor<string, []>("add_0_cast_fp16")];
46
+ tensor<int32, []> softmax_0_axis_0 = const()[name = tensor<string, []>("softmax_0_axis_0"), val = tensor<int32, []>(-1)];
47
+ tensor<fp16, [1, 2, 5, 5]> softmax_0_cast_fp16 = softmax(axis = softmax_0_axis_0, x = add_0_cast_fp16)[name = tensor<string, []>("softmax_0_cast_fp16")];
48
+ tensor<bool, []> attn_output_1_transpose_x_0 = const()[name = tensor<string, []>("attn_output_1_transpose_x_0"), val = tensor<bool, []>(false)];
49
+ tensor<bool, []> attn_output_1_transpose_y_0 = const()[name = tensor<string, []>("attn_output_1_transpose_y_0"), val = tensor<bool, []>(false)];
50
+ tensor<fp16, [1, 2, 5, 1]> value_1_cast_fp16 = transpose(perm = value_1_perm_0, x = var_108_cast_fp16)[name = tensor<string, []>("transpose_19")];
51
+ tensor<fp16, [1, 2, 5, 1]> attn_output_1_cast_fp16 = matmul(transpose_x = attn_output_1_transpose_x_0, transpose_y = attn_output_1_transpose_y_0, x = softmax_0_cast_fp16, y = value_1_cast_fp16)[name = tensor<string, []>("attn_output_1_cast_fp16")];
52
+ tensor<int32, [4]> var_119_perm_0 = const()[name = tensor<string, []>("op_119_perm_0"), val = tensor<int32, [4]>([0, 2, 1, 3])];
53
+ tensor<int32, [2]> var_131 = const()[name = tensor<string, []>("op_131"), val = tensor<int32, [2]>([-1, 2])];
54
+ tensor<fp16, [1, 5, 2, 1]> var_119_cast_fp16 = transpose(perm = var_119_perm_0, x = attn_output_1_cast_fp16)[name = tensor<string, []>("transpose_16")];
55
+ tensor<fp16, [5, 2]> var_132_cast_fp16 = reshape(shape = var_131, x = var_119_cast_fp16)[name = tensor<string, []>("op_132_cast_fp16")];
56
+ tensor<bool, []> matmul_2_transpose_x_0 = const()[name = tensor<string, []>("matmul_2_transpose_x_0"), val = tensor<bool, []>(false)];
57
+ tensor<bool, []> matmul_2_transpose_y_0 = const()[name = tensor<string, []>("matmul_2_transpose_y_0"), val = tensor<bool, []>(false)];
58
+ tensor<fp16, [2, 2]> model_transformer_h_0_attn_c_proj_weight_to_fp16 = const()[name = tensor<string, []>("model_transformer_h_0_attn_c_proj_weight_to_fp16"), val = tensor<fp16, [2, 2]>([[-0x1.54cp-10, -0x1.3d8p-10], [-0x1.d4p-5, -0x1.8p-6]])];
59
+ tensor<fp16, [5, 2]> matmul_2_cast_fp16 = matmul(transpose_x = matmul_2_transpose_x_0, transpose_y = matmul_2_transpose_y_0, x = var_132_cast_fp16, y = model_transformer_h_0_attn_c_proj_weight_to_fp16)[name = tensor<string, []>("matmul_2_cast_fp16")];
60
+ tensor<int32, [3]> var_134 = const()[name = tensor<string, []>("op_134"), val = tensor<int32, [3]>([1, 5, 2])];
61
+ tensor<fp16, [1, 5, 2]> input_5_cast_fp16 = reshape(shape = var_134, x = matmul_2_cast_fp16)[name = tensor<string, []>("input_5_cast_fp16")];
62
+ tensor<fp16, [1, 5, 2]> input_7_cast_fp16 = add(x = input_5_cast_fp16, y = input_3_cast_fp16)[name = tensor<string, []>("input_7_cast_fp16")];
63
+ tensor<int32, [1]> x_9_axes_0 = const()[name = tensor<string, []>("x_9_axes_0"), val = tensor<int32, [1]>([-1])];
64
+ tensor<fp16, [2]> model_transformer_h_0_ln_2_weight_to_fp16 = const()[name = tensor<string, []>("model_transformer_h_0_ln_2_weight_to_fp16"), val = tensor<fp16, [2]>([0x1p+0, 0x1p+0])];
65
+ tensor<fp16, [2]> model_transformer_h_0_ln_2_bias_to_fp16 = const()[name = tensor<string, []>("model_transformer_h_0_ln_2_bias_to_fp16"), val = tensor<fp16, [2]>([0x0p+0, 0x0p+0])];
66
+ tensor<fp16, [1, 5, 2]> x_9_cast_fp16 = layer_norm(axes = x_9_axes_0, beta = model_transformer_h_0_ln_2_bias_to_fp16, epsilon = var_19_to_fp16, gamma = model_transformer_h_0_ln_2_weight_to_fp16, x = input_7_cast_fp16)[name = tensor<string, []>("x_9_cast_fp16")];
67
+ tensor<int32, [2]> var_149 = const()[name = tensor<string, []>("op_149"), val = tensor<int32, [2]>([-1, 2])];
68
+ tensor<fp16, [5, 2]> var_150_cast_fp16 = reshape(shape = var_149, x = x_9_cast_fp16)[name = tensor<string, []>("op_150_cast_fp16")];
69
+ tensor<bool, []> matmul_3_transpose_x_0 = const()[name = tensor<string, []>("matmul_3_transpose_x_0"), val = tensor<bool, []>(false)];
70
+ tensor<bool, []> matmul_3_transpose_y_0 = const()[name = tensor<string, []>("matmul_3_transpose_y_0"), val = tensor<bool, []>(false)];
71
+ tensor<fp16, [2, 8]> model_transformer_h_0_mlp_c_fc_weight_to_fp16 = const()[name = tensor<string, []>("model_transformer_h_0_mlp_c_fc_weight_to_fp16"), val = tensor<fp16, [2, 8]>(BLOBFILE(path = tensor<string, []>("@model_path/weights/weight.bin"), offset = tensor<uint64, []>(201600)))];
72
+ tensor<fp16, [5, 8]> matmul_3_cast_fp16 = matmul(transpose_x = matmul_3_transpose_x_0, transpose_y = matmul_3_transpose_y_0, x = var_150_cast_fp16, y = model_transformer_h_0_mlp_c_fc_weight_to_fp16)[name = tensor<string, []>("matmul_3_cast_fp16")];
73
+ tensor<int32, [3]> var_152 = const()[name = tensor<string, []>("op_152"), val = tensor<int32, [3]>([1, 5, 8])];
74
+ tensor<fp16, [1, 5, 8]> input_9_cast_fp16 = reshape(shape = var_152, x = matmul_3_cast_fp16)[name = tensor<string, []>("input_9_cast_fp16")];
75
+ tensor<string, []> x_13_mode_0 = const()[name = tensor<string, []>("x_13_mode_0"), val = tensor<string, []>("TANH_APPROXIMATION")];
76
+ tensor<fp16, [1, 5, 8]> x_13_cast_fp16 = gelu(mode = x_13_mode_0, x = input_9_cast_fp16)[name = tensor<string, []>("x_13_cast_fp16")];
77
+ tensor<int32, [2]> var_171 = const()[name = tensor<string, []>("op_171"), val = tensor<int32, [2]>([-1, 8])];
78
+ tensor<fp16, [5, 8]> var_172_cast_fp16 = reshape(shape = var_171, x = x_13_cast_fp16)[name = tensor<string, []>("op_172_cast_fp16")];
79
+ tensor<bool, []> matmul_4_transpose_x_0 = const()[name = tensor<string, []>("matmul_4_transpose_x_0"), val = tensor<bool, []>(false)];
80
+ tensor<bool, []> matmul_4_transpose_y_0 = const()[name = tensor<string, []>("matmul_4_transpose_y_0"), val = tensor<bool, []>(false)];
81
+ tensor<fp16, [8, 2]> model_transformer_h_0_mlp_c_proj_weight_to_fp16 = const()[name = tensor<string, []>("model_transformer_h_0_mlp_c_proj_weight_to_fp16"), val = tensor<fp16, [8, 2]>(BLOBFILE(path = tensor<string, []>("@model_path/weights/weight.bin"), offset = tensor<uint64, []>(201728)))];
82
+ tensor<fp16, [5, 2]> matmul_4_cast_fp16 = matmul(transpose_x = matmul_4_transpose_x_0, transpose_y = matmul_4_transpose_y_0, x = var_172_cast_fp16, y = model_transformer_h_0_mlp_c_proj_weight_to_fp16)[name = tensor<string, []>("matmul_4_cast_fp16")];
83
+ tensor<int32, [3]> var_174 = const()[name = tensor<string, []>("op_174"), val = tensor<int32, [3]>([1, 5, 2])];
84
+ tensor<fp16, [1, 5, 2]> input_11_cast_fp16 = reshape(shape = var_174, x = matmul_4_cast_fp16)[name = tensor<string, []>("input_11_cast_fp16")];
85
+ tensor<fp16, [1, 5, 2]> input_13_cast_fp16 = add(x = input_7_cast_fp16, y = input_11_cast_fp16)[name = tensor<string, []>("input_13_cast_fp16")];
86
+ tensor<int32, [1]> x_17_axes_0 = const()[name = tensor<string, []>("x_17_axes_0"), val = tensor<int32, [1]>([-1])];
87
+ tensor<fp16, [2]> model_transformer_h_1_ln_1_weight_to_fp16 = const()[name = tensor<string, []>("model_transformer_h_1_ln_1_weight_to_fp16"), val = tensor<fp16, [2]>([0x1p+0, 0x1p+0])];
88
+ tensor<fp16, [2]> model_transformer_h_1_ln_1_bias_to_fp16 = const()[name = tensor<string, []>("model_transformer_h_1_ln_1_bias_to_fp16"), val = tensor<fp16, [2]>([0x0p+0, 0x0p+0])];
89
+ tensor<fp16, [1, 5, 2]> x_17_cast_fp16 = layer_norm(axes = x_17_axes_0, beta = model_transformer_h_1_ln_1_bias_to_fp16, epsilon = var_19_to_fp16, gamma = model_transformer_h_1_ln_1_weight_to_fp16, x = input_13_cast_fp16)[name = tensor<string, []>("x_17_cast_fp16")];
90
+ tensor<int32, [2]> var_193 = const()[name = tensor<string, []>("op_193"), val = tensor<int32, [2]>([-1, 2])];
91
+ tensor<fp16, [5, 2]> var_194_cast_fp16 = reshape(shape = var_193, x = x_17_cast_fp16)[name = tensor<string, []>("op_194_cast_fp16")];
92
+ tensor<bool, []> matmul_5_transpose_x_0 = const()[name = tensor<string, []>("matmul_5_transpose_x_0"), val = tensor<bool, []>(false)];
93
+ tensor<bool, []> matmul_5_transpose_y_0 = const()[name = tensor<string, []>("matmul_5_transpose_y_0"), val = tensor<bool, []>(false)];
94
+ tensor<fp16, [2, 6]> model_transformer_h_1_attn_c_attn_weight_to_fp16 = const()[name = tensor<string, []>("model_transformer_h_1_attn_c_attn_weight_to_fp16"), val = tensor<fp16, [2, 6]>(BLOBFILE(path = tensor<string, []>("@model_path/weights/weight.bin"), offset = tensor<uint64, []>(201856)))];
95
+ tensor<fp16, [5, 6]> matmul_5_cast_fp16 = matmul(transpose_x = matmul_5_transpose_x_0, transpose_y = matmul_5_transpose_y_0, x = var_194_cast_fp16, y = model_transformer_h_1_attn_c_attn_weight_to_fp16)[name = tensor<string, []>("matmul_5_cast_fp16")];
96
+ tensor<int32, [3]> var_196 = const()[name = tensor<string, []>("op_196"), val = tensor<int32, [3]>([1, 5, 6])];
97
+ tensor<fp16, [1, 5, 6]> var_197_cast_fp16 = reshape(shape = var_196, x = matmul_5_cast_fp16)[name = tensor<string, []>("op_197_cast_fp16")];
98
+ tensor<int32, [3]> tile_1 = const()[name = tensor<string, []>("tile_1"), val = tensor<int32, [3]>([2, 2, 2])];
99
+ tensor<int32, []> var_198_axis_0 = const()[name = tensor<string, []>("op_198_axis_0"), val = tensor<int32, []>(2)];
100
+ tensor<fp16, [1, 5, 2]> var_198_cast_fp16_0, tensor<fp16, [1, 5, 2]> var_198_cast_fp16_1, tensor<fp16, [1, 5, 2]> var_198_cast_fp16_2 = split(axis = var_198_axis_0, split_sizes = tile_1, x = var_197_cast_fp16)[name = tensor<string, []>("op_198_cast_fp16")];
101
+ tensor<int32, [4]> var_206 = const()[name = tensor<string, []>("op_206"), val = tensor<int32, [4]>([1, 5, -1, 1])];
102
+ tensor<fp16, [1, 5, 2, 1]> var_207_cast_fp16 = reshape(shape = var_206, x = var_198_cast_fp16_0)[name = tensor<string, []>("op_207_cast_fp16")];
103
+ tensor<int32, [4]> var_209 = const()[name = tensor<string, []>("op_209"), val = tensor<int32, [4]>([1, 5, -1, 1])];
104
+ tensor<fp16, [1, 5, 2, 1]> var_210_cast_fp16 = reshape(shape = var_209, x = var_198_cast_fp16_1)[name = tensor<string, []>("op_210_cast_fp16")];
105
+ tensor<int32, [4]> var_212 = const()[name = tensor<string, []>("op_212"), val = tensor<int32, [4]>([1, 5, -1, 1])];
106
+ tensor<fp16, [1, 5, 2, 1]> var_213_cast_fp16 = reshape(shape = var_212, x = var_198_cast_fp16_2)[name = tensor<string, []>("op_213_cast_fp16")];
107
+ tensor<int32, [4]> value_5_perm_0 = const()[name = tensor<string, []>("value_5_perm_0"), val = tensor<int32, [4]>([0, 2, 1, 3])];
108
+ tensor<bool, []> matmul_6_transpose_y_0 = const()[name = tensor<string, []>("matmul_6_transpose_y_0"), val = tensor<bool, []>(true)];
109
+ tensor<bool, []> matmul_6_transpose_x_0 = const()[name = tensor<string, []>("matmul_6_transpose_x_0"), val = tensor<bool, []>(false)];
110
+ tensor<int32, [4]> transpose_10_perm_0 = const()[name = tensor<string, []>("transpose_10_perm_0"), val = tensor<int32, [4]>([0, 2, -3, -1])];
111
+ tensor<int32, [4]> transpose_11_perm_0 = const()[name = tensor<string, []>("transpose_11_perm_0"), val = tensor<int32, [4]>([0, 2, -3, -1])];
112
+ tensor<fp16, [1, 2, 5, 1]> transpose_11 = transpose(perm = transpose_11_perm_0, x = var_210_cast_fp16)[name = tensor<string, []>("transpose_13")];
113
+ tensor<fp16, [1, 2, 5, 1]> transpose_10 = transpose(perm = transpose_10_perm_0, x = var_207_cast_fp16)[name = tensor<string, []>("transpose_14")];
114
+ tensor<fp16, [1, 2, 5, 5]> matmul_6_cast_fp16 = matmul(transpose_x = matmul_6_transpose_x_0, transpose_y = matmul_6_transpose_y_0, x = transpose_10, y = transpose_11)[name = tensor<string, []>("matmul_6_cast_fp16")];
115
+ tensor<fp16, [1, 2, 5, 5]> add_1_cast_fp16 = add(x = matmul_6_cast_fp16, y = var_64_to_fp16)[name = tensor<string, []>("add_1_cast_fp16")];
116
+ tensor<int32, []> softmax_1_axis_0 = const()[name = tensor<string, []>("softmax_1_axis_0"), val = tensor<int32, []>(-1)];
117
+ tensor<fp16, [1, 2, 5, 5]> softmax_1_cast_fp16 = softmax(axis = softmax_1_axis_0, x = add_1_cast_fp16)[name = tensor<string, []>("softmax_1_cast_fp16")];
118
+ tensor<bool, []> attn_output_7_transpose_x_0 = const()[name = tensor<string, []>("attn_output_7_transpose_x_0"), val = tensor<bool, []>(false)];
119
+ tensor<bool, []> attn_output_7_transpose_y_0 = const()[name = tensor<string, []>("attn_output_7_transpose_y_0"), val = tensor<bool, []>(false)];
120
+ tensor<fp16, [1, 2, 5, 1]> value_5_cast_fp16 = transpose(perm = value_5_perm_0, x = var_213_cast_fp16)[name = tensor<string, []>("transpose_15")];
121
+ tensor<fp16, [1, 2, 5, 1]> attn_output_7_cast_fp16 = matmul(transpose_x = attn_output_7_transpose_x_0, transpose_y = attn_output_7_transpose_y_0, x = softmax_1_cast_fp16, y = value_5_cast_fp16)[name = tensor<string, []>("attn_output_7_cast_fp16")];
122
+ tensor<int32, [4]> var_224_perm_0 = const()[name = tensor<string, []>("op_224_perm_0"), val = tensor<int32, [4]>([0, 2, 1, 3])];
123
+ tensor<int32, [2]> var_236 = const()[name = tensor<string, []>("op_236"), val = tensor<int32, [2]>([-1, 2])];
124
+ tensor<fp16, [1, 5, 2, 1]> var_224_cast_fp16 = transpose(perm = var_224_perm_0, x = attn_output_7_cast_fp16)[name = tensor<string, []>("transpose_12")];
125
+ tensor<fp16, [5, 2]> var_237_cast_fp16 = reshape(shape = var_236, x = var_224_cast_fp16)[name = tensor<string, []>("op_237_cast_fp16")];
126
+ tensor<bool, []> matmul_7_transpose_x_0 = const()[name = tensor<string, []>("matmul_7_transpose_x_0"), val = tensor<bool, []>(false)];
127
+ tensor<bool, []> matmul_7_transpose_y_0 = const()[name = tensor<string, []>("matmul_7_transpose_y_0"), val = tensor<bool, []>(false)];
128
+ tensor<fp16, [2, 2]> model_transformer_h_1_attn_c_proj_weight_to_fp16 = const()[name = tensor<string, []>("model_transformer_h_1_attn_c_proj_weight_to_fp16"), val = tensor<fp16, [2, 2]>([[0x1.e5cp-8, 0x1.54p-7], [0x1.2d8p-6, -0x1.594p-6]])];
129
+ tensor<fp16, [5, 2]> matmul_7_cast_fp16 = matmul(transpose_x = matmul_7_transpose_x_0, transpose_y = matmul_7_transpose_y_0, x = var_237_cast_fp16, y = model_transformer_h_1_attn_c_proj_weight_to_fp16)[name = tensor<string, []>("matmul_7_cast_fp16")];
130
+ tensor<int32, [3]> var_239 = const()[name = tensor<string, []>("op_239"), val = tensor<int32, [3]>([1, 5, 2])];
131
+ tensor<fp16, [1, 5, 2]> input_15_cast_fp16 = reshape(shape = var_239, x = matmul_7_cast_fp16)[name = tensor<string, []>("input_15_cast_fp16")];
132
+ tensor<fp16, [1, 5, 2]> input_17_cast_fp16 = add(x = input_15_cast_fp16, y = input_13_cast_fp16)[name = tensor<string, []>("input_17_cast_fp16")];
133
+ tensor<int32, [1]> x_25_axes_0 = const()[name = tensor<string, []>("x_25_axes_0"), val = tensor<int32, [1]>([-1])];
134
+ tensor<fp16, [2]> model_transformer_h_1_ln_2_weight_to_fp16 = const()[name = tensor<string, []>("model_transformer_h_1_ln_2_weight_to_fp16"), val = tensor<fp16, [2]>([0x1p+0, 0x1p+0])];
135
+ tensor<fp16, [2]> model_transformer_h_1_ln_2_bias_to_fp16 = const()[name = tensor<string, []>("model_transformer_h_1_ln_2_bias_to_fp16"), val = tensor<fp16, [2]>([0x0p+0, 0x0p+0])];
136
+ tensor<fp16, [1, 5, 2]> x_25_cast_fp16 = layer_norm(axes = x_25_axes_0, beta = model_transformer_h_1_ln_2_bias_to_fp16, epsilon = var_19_to_fp16, gamma = model_transformer_h_1_ln_2_weight_to_fp16, x = input_17_cast_fp16)[name = tensor<string, []>("x_25_cast_fp16")];
137
+ tensor<int32, [2]> var_254 = const()[name = tensor<string, []>("op_254"), val = tensor<int32, [2]>([-1, 2])];
138
+ tensor<fp16, [5, 2]> var_255_cast_fp16 = reshape(shape = var_254, x = x_25_cast_fp16)[name = tensor<string, []>("op_255_cast_fp16")];
139
+ tensor<bool, []> matmul_8_transpose_x_0 = const()[name = tensor<string, []>("matmul_8_transpose_x_0"), val = tensor<bool, []>(false)];
140
+ tensor<bool, []> matmul_8_transpose_y_0 = const()[name = tensor<string, []>("matmul_8_transpose_y_0"), val = tensor<bool, []>(false)];
141
+ tensor<fp16, [2, 8]> model_transformer_h_1_mlp_c_fc_weight_to_fp16 = const()[name = tensor<string, []>("model_transformer_h_1_mlp_c_fc_weight_to_fp16"), val = tensor<fp16, [2, 8]>(BLOBFILE(path = tensor<string, []>("@model_path/weights/weight.bin"), offset = tensor<uint64, []>(201984)))];
142
+ tensor<fp16, [5, 8]> matmul_8_cast_fp16 = matmul(transpose_x = matmul_8_transpose_x_0, transpose_y = matmul_8_transpose_y_0, x = var_255_cast_fp16, y = model_transformer_h_1_mlp_c_fc_weight_to_fp16)[name = tensor<string, []>("matmul_8_cast_fp16")];
143
+ tensor<int32, [3]> var_257 = const()[name = tensor<string, []>("op_257"), val = tensor<int32, [3]>([1, 5, 8])];
144
+ tensor<fp16, [1, 5, 8]> input_19_cast_fp16 = reshape(shape = var_257, x = matmul_8_cast_fp16)[name = tensor<string, []>("input_19_cast_fp16")];
145
+ tensor<string, []> x_29_mode_0 = const()[name = tensor<string, []>("x_29_mode_0"), val = tensor<string, []>("TANH_APPROXIMATION")];
146
+ tensor<fp16, [1, 5, 8]> x_29_cast_fp16 = gelu(mode = x_29_mode_0, x = input_19_cast_fp16)[name = tensor<string, []>("x_29_cast_fp16")];
147
+ tensor<int32, [2]> var_276 = const()[name = tensor<string, []>("op_276"), val = tensor<int32, [2]>([-1, 8])];
148
+ tensor<fp16, [5, 8]> var_277_cast_fp16 = reshape(shape = var_276, x = x_29_cast_fp16)[name = tensor<string, []>("op_277_cast_fp16")];
149
+ tensor<bool, []> matmul_9_transpose_x_0 = const()[name = tensor<string, []>("matmul_9_transpose_x_0"), val = tensor<bool, []>(false)];
150
+ tensor<bool, []> matmul_9_transpose_y_0 = const()[name = tensor<string, []>("matmul_9_transpose_y_0"), val = tensor<bool, []>(false)];
151
+ tensor<fp16, [8, 2]> model_transformer_h_1_mlp_c_proj_weight_to_fp16 = const()[name = tensor<string, []>("model_transformer_h_1_mlp_c_proj_weight_to_fp16"), val = tensor<fp16, [8, 2]>(BLOBFILE(path = tensor<string, []>("@model_path/weights/weight.bin"), offset = tensor<uint64, []>(202112)))];
152
+ tensor<fp16, [5, 2]> matmul_9_cast_fp16 = matmul(transpose_x = matmul_9_transpose_x_0, transpose_y = matmul_9_transpose_y_0, x = var_277_cast_fp16, y = model_transformer_h_1_mlp_c_proj_weight_to_fp16)[name = tensor<string, []>("matmul_9_cast_fp16")];
153
+ tensor<int32, [3]> var_279 = const()[name = tensor<string, []>("op_279"), val = tensor<int32, [3]>([1, 5, 2])];
154
+ tensor<fp16, [1, 5, 2]> input_21_cast_fp16 = reshape(shape = var_279, x = matmul_9_cast_fp16)[name = tensor<string, []>("input_21_cast_fp16")];
155
+ tensor<fp16, [1, 5, 2]> input_23_cast_fp16 = add(x = input_17_cast_fp16, y = input_21_cast_fp16)[name = tensor<string, []>("input_23_cast_fp16")];
156
+ tensor<int32, [1]> hidden_states_axes_0 = const()[name = tensor<string, []>("hidden_states_axes_0"), val = tensor<int32, [1]>([-1])];
157
+ tensor<fp16, [2]> model_transformer_ln_f_weight_to_fp16 = const()[name = tensor<string, []>("model_transformer_ln_f_weight_to_fp16"), val = tensor<fp16, [2]>([0x1p+0, 0x1p+0])];
158
+ tensor<fp16, [2]> model_transformer_ln_f_bias_to_fp16 = const()[name = tensor<string, []>("model_transformer_ln_f_bias_to_fp16"), val = tensor<fp16, [2]>([0x0p+0, 0x0p+0])];
159
+ tensor<fp16, [1, 5, 2]> hidden_states_cast_fp16 = layer_norm(axes = hidden_states_axes_0, beta = model_transformer_ln_f_bias_to_fp16, epsilon = var_19_to_fp16, gamma = model_transformer_ln_f_weight_to_fp16, x = input_23_cast_fp16)[name = tensor<string, []>("hidden_states_cast_fp16")];
160
+ tensor<fp16, [50257]> linear_0_bias_0_to_fp16 = const()[name = tensor<string, []>("linear_0_bias_0_to_fp16"), val = tensor<fp16, [50257]>(BLOBFILE(path = tensor<string, []>("@model_path/weights/weight.bin"), offset = tensor<uint64, []>(202240)))];
161
+ tensor<fp16, [1, 5, 50257]> var_289 = linear(bias = linear_0_bias_0_to_fp16, weight = model_transformer_wte_weight_to_fp16, x = hidden_states_cast_fp16)[name = tensor<string, []>("linear_0_cast_fp16")];
162
+ } -> (var_289);
163
+ }
CompiledModel/TinyGPT2.mlmodelc/weights/weight.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:600d58440df9bc1406c9ce36928c1c18ed13b8a7bc51fb2e1157fa0b8ff39b66
3
+ size 302818
TinyGPT2.mlmodelc.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a33d2b992f2c73cbadbe6cfdfbf400ebcc1e144bc5a13933b3200e300ab752b7
3
+ size 191261