File size: 5,447 Bytes
3b03423
fbad9e2
3b03423
 
 
 
fbad9e2
3b03423
 
 
 
 
fbad9e2
 
 
 
 
3b03423
fbad9e2
3b03423
 
fbad9e2
 
 
3b03423
fbad9e2
 
 
3b03423
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
program(1.3)
[buildInfo = dict<string, string>({{"coremlc-component-MIL", "3510.2.1"}, {"coremlc-version", "3500.32.1"}})]
{
    func main<ios18>(tensor<int32, [1]> input_ids) {
            int32 embed_batch_dims_0 = const()[name = string("embed_batch_dims_0"), val = int32(0)];
            bool embed_validate_indices_0 = const()[name = string("embed_validate_indices_0"), val = bool(false)];
            tensor<fp16, [151936, 2048]> text_embedding_weight_to_fp16_palettized = constexpr_lut_to_dense(indices = tensor<uint8, [151936, 2048]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(64))), lut = tensor<fp16, [1, 1, 256, 1]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(311165056))))[name = string("text_embedding_weight_to_fp16_palettized")];
            int32 greater_equal_0_y_0 = const()[name = string("greater_equal_0_y_0"), val = int32(0)];
            tensor<bool, [1]> greater_equal_0 = greater_equal(x = input_ids, y = greater_equal_0_y_0)[name = string("greater_equal_0")];
            int32 slice_by_index_0 = const()[name = string("slice_by_index_0"), val = int32(151936)];
            tensor<int32, [1]> add_0 = add(x = input_ids, y = slice_by_index_0)[name = string("add_0")];
            tensor<int32, [1]> select_0 = select(a = input_ids, b = add_0, cond = greater_equal_0)[name = string("select_0")];
            int32 greater_equal_0_y_0_1 = const()[name = string("greater_equal_0_y_0_1"), val = int32(0)];
            tensor<bool, [1]> greater_equal_0_1 = greater_equal(x = select_0, y = greater_equal_0_y_0_1)[name = string("greater_equal_0_1")];
            int32 slice_by_index_0_1 = const()[name = string("slice_by_index_0_1"), val = int32(151936)];
            tensor<int32, [1]> add_0_1 = add(x = select_0, y = slice_by_index_0_1)[name = string("add_0_1")];
            tensor<int32, [1]> select_0_1 = select(a = select_0, b = add_0_1, cond = greater_equal_0_1)[name = string("select_0_1")];
            int32 embed_cast_fp16_axis_0 = const()[name = string("embed_cast_fp16_axis_0"), val = int32(0)];
            tensor<fp16, [1, 2048]> embed_cast_fp16 = gather(axis = embed_cast_fp16_axis_0, batch_dims = embed_batch_dims_0, indices = select_0_1, validate_indices = embed_validate_indices_0, x = text_embedding_weight_to_fp16_palettized)[name = string("embed_cast_fp16")];
            tensor<int32, [1]> input_1_axes_0 = const()[name = string("input_1_axes_0"), val = tensor<int32, [1]>([0])];
            tensor<fp16, [1, 1, 2048]> input_1_cast_fp16 = expand_dims(axes = input_1_axes_0, x = embed_cast_fp16)[name = string("input_1_cast_fp16")];
            tensor<fp16, [2048, 2048]> text_projection_linear_fc1_weight_to_fp16_palettized = constexpr_lut_to_dense(indices = tensor<uint8, [2048, 2048]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(311165632))), lut = tensor<fp16, [1, 1, 256, 1]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(315360000))))[name = string("text_projection_linear_fc1_weight_to_fp16_palettized")];
            tensor<fp16, [2048]> text_projection_linear_fc1_bias_to_fp16 = const()[name = string("text_projection_linear_fc1_bias_to_fp16"), val = tensor<fp16, [2048]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(315360576)))];
            tensor<fp16, [1, 1, 2048]> linear_0_cast_fp16 = linear(bias = text_projection_linear_fc1_bias_to_fp16, weight = text_projection_linear_fc1_weight_to_fp16_palettized, x = input_1_cast_fp16)[name = string("linear_0_cast_fp16")];
            tensor<fp16, [1, 1, 2048]> input_cast_fp16 = silu(x = linear_0_cast_fp16)[name = string("input_cast_fp16")];
            tensor<fp16, [1024, 2048]> text_projection_linear_fc2_weight_to_fp16_palettized = constexpr_lut_to_dense(indices = tensor<uint8, [1024, 2048]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(315364736))), lut = tensor<fp16, [1, 1, 256, 1]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(317461952))))[name = string("text_projection_linear_fc2_weight_to_fp16_palettized")];
            tensor<fp16, [1024]> text_projection_linear_fc2_bias_to_fp16 = const()[name = string("text_projection_linear_fc2_bias_to_fp16"), val = tensor<fp16, [1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(317462528)))];
            tensor<fp16, [1, 1, 1024]> linear_1_cast_fp16 = linear(bias = text_projection_linear_fc2_bias_to_fp16, weight = text_projection_linear_fc2_weight_to_fp16_palettized, x = input_cast_fp16)[name = string("linear_1_cast_fp16")];
            tensor<int32, [1]> var_20_axes_0 = const()[name = string("op_20_axes_0"), val = tensor<int32, [1]>([1])];
            tensor<fp16, [1, 1024]> var_20_cast_fp16 = squeeze(axes = var_20_axes_0, x = linear_1_cast_fp16)[name = string("op_20_cast_fp16")];
            tensor<int32, [1]> var_22_axes_0 = const()[name = string("op_22_axes_0"), val = tensor<int32, [1]>([-1])];
            tensor<fp16, [1, 1024, 1]> var_22_cast_fp16 = expand_dims(axes = var_22_axes_0, x = var_20_cast_fp16)[name = string("op_22_cast_fp16")];
            tensor<int32, [1]> var_24_axes_0 = const()[name = string("op_24_axes_0"), val = tensor<int32, [1]>([-1])];
            tensor<fp16, [1, 1024, 1, 1]> input_embeds = expand_dims(axes = var_24_axes_0, x = var_22_cast_fp16)[name = string("op_24_cast_fp16")];
        } -> (input_embeds);
}