{"format_version":1,"text":"program(1.3)\n[buildInfo = dict({{\"coremlc-component-MIL\", \"3510.2.1\"}, {\"coremlc-version\", \"3505.4.1\"}, {\"coremltools-component-milinternal\", \"\"}, {\"coremltools-version\", \"9.0\"}})]\n{\n func main(tensor hid_in, tensor k_cache, tensor v_cache, tensor cos_in, tensor sin_in, tensor mask_in) {\n tensor norm_w_1 = const()[name = string(\"norm_w_1\"), val = tensor(BLOBFILE(path = string(\"@model_path/weights/weight.bin\"), offset = uint64(64)))];\n tensor abs_2 = abs(x=hid_in)[name = string(\"abs_2\")];\n tensor iv_3 = const()[name = string(\"iv_3\"), val = tensor([1])];\n bool b_4 = const()[name = string(\"b_4\"), val = bool(true)];\n tensor reduce_max_5 = reduce_max(x=abs_2, axes=iv_3, keep_dims=b_4)[name = string(\"reduce_max_5\")];\n fp16 c_6 = const()[name = string(\"c_6\"), val = fp16(0.062500000000)];\n tensor maximum_7 = maximum(x=reduce_max_5, y=c_6)[name = string(\"maximum_7\")];\n fp16 c_8 = const()[name = string(\"c_8\"), val = fp16(1.000000000000)];\n tensor real_div_9 = real_div(x=c_8, y=maximum_7)[name = string(\"real_div_9\")];\n tensor mul_10 = mul(x=hid_in, y=real_div_9)[name = string(\"mul_10\")];\n fp16 c_11 = const()[name = string(\"c_11\"), val = fp16(2.000000000000)];\n tensor pow_12 = pow(x=mul_10, y=c_11)[name = string(\"pow_12\")];\n tensor reduce_sum_13 = reduce_sum(x=pow_12, axes=iv_3, keep_dims=b_4)[name = string(\"reduce_sum_13\")];\n fp16 c_14 = const()[name = string(\"c_14\"), val = fp16(0.000195312500)];\n tensor mul_15 = mul(x=reduce_sum_13, y=c_14)[name = string(\"mul_15\")];\n tensor pow_16 = pow(x=real_div_9, y=c_11)[name = string(\"pow_16\")];\n fp16 c_17 = const()[name = string(\"c_17\"), val = fp16(0.000001000000)];\n tensor mul_18 = mul(x=pow_16, y=c_17)[name = string(\"mul_18\")];\n tensor add_19 = add(x=mul_15, y=mul_18)[name = string(\"add_19\")];\n fp16 c_20 = const()[name = string(\"c_20\"), val = fp16(0.000000000000)];\n tensor rsqrt_21 = rsqrt(x=add_19, epsilon=c_20)[name = string(\"rsqrt_21\")];\n tensor mul_22 = mul(x=mul_10, y=rsqrt_21)[name = string(\"mul_22\")];\n tensor mul_23 = mul(x=mul_22, y=norm_w_1)[name = string(\"mul_23\")];\n tensor w_q_lut_24 = const()[name = string(\"w_q_lut_24\"), val = tensor(BLOBFILE(path = string(\"@model_path/weights/weight.bin\"), offset = uint64(47196352)))];\n tensor w_q_25 = constexpr_lut_to_dense(indices = tensor(BLOBFILE(path = string(\"@model_path/weights/weight.bin\"), offset = uint64(10368))), lut = w_q_lut_24)[name = string(\"w_q_25\")];\n tensor iv_26 = const()[name = string(\"iv_26\"), val = tensor([1, 1])];\n int32 i_27 = const()[name = string(\"i_27\"), val = int32(1)];\n tensor iv_28 = const()[name = string(\"iv_28\"), val = tensor([0, 0, 0, 0])];\n string str_29 = const()[name = string(\"str_29\"), val = string(\"valid\")];\n tensor conv_30 = conv(dilations=iv_26, groups=i_27, pad=iv_28, pad_type=str_29, strides=iv_26, weight=w_q_25, x=mul_23)[name = string(\"conv_30\")];\n tensor iv_31 = const()[name = string(\"iv_31\"), val = tensor([1, 6144, 1, 128])];\n tensor slice_by_size_32 = slice_by_size(x=conv_30, begin=iv_28, size=iv_31)[name = string(\"slice_by_size_32\")];\n tensor iv_33 = const()[name = string(\"iv_33\"), val = tensor([1, 24, 256, 128])];\n tensor reshape_34 = reshape(shape=iv_33, x=slice_by_size_32)[name = string(\"reshape_34\")];\n tensor iv_35 = const()[name = string(\"iv_35\"), val = tensor([0, 1, 3, 2])];\n tensor transpose_36 = transpose(perm=iv_35, x=reshape_34)[name = string(\"transpose_36\")];\n tensor iv_37 = const()[name = string(\"iv_37\"), val = tensor([0, 6144, 0, 0])];\n tensor slice_by_size_38 = slice_by_size(x=conv_30, begin=iv_37, size=iv_31)[name = string(\"slice_by_size_38\")];\n tensor reshape_39 = reshape(shape=iv_33, x=slice_by_size_38)[name = string(\"reshape_39\")];\n tensor transpose_40 = transpose(perm=iv_35, x=reshape_39)[name = string(\"transpose_40\")];\n tensor w_k_lut_41 = const()[name = string(\"w_k_lut_41\"), val = tensor(BLOBFILE(path = string(\"@model_path/weights/weight.bin\"), offset = uint64(51226944)))];\n tensor w_k_42 = constexpr_lut_to_dense(indices = tensor(BLOBFILE(path = string(\"@model_path/weights/weight.bin\"), offset = uint64(47294720))), lut = w_k_lut_41)[name = string(\"w_k_42\")];\n tensor conv_43 = conv(dilations=iv_26, groups=i_27, pad=iv_28, pad_type=str_29, strides=iv_26, weight=w_k_42, x=mul_23)[name = string(\"conv_43\")];\n tensor iv_44 = const()[name = string(\"iv_44\"), val = tensor([1, 4, 256, 128])];\n tensor reshape_45 = reshape(shape=iv_44, x=conv_43)[name = string(\"reshape_45\")];\n tensor transpose_46 = transpose(perm=iv_35, x=reshape_45)[name = string(\"transpose_46\")];\n tensor w_v_lut_47 = const()[name = string(\"w_v_lut_47\"), val = tensor(BLOBFILE(path = string(\"@model_path/weights/weight.bin\"), offset = uint64(55167424)))];\n tensor w_v_48 = constexpr_lut_to_dense(indices = tensor(BLOBFILE(path = string(\"@model_path/weights/weight.bin\"), offset = uint64(51235200))), lut = w_v_lut_47)[name = string(\"w_v_48\")];\n tensor conv_49 = conv(dilations=iv_26, groups=i_27, pad=iv_28, pad_type=str_29, strides=iv_26, weight=w_v_48, x=mul_23)[name = string(\"conv_49\")];\n tensor reshape_50 = reshape(shape=iv_44, x=conv_49)[name = string(\"reshape_50\")];\n tensor transpose_51 = transpose(perm=iv_35, x=reshape_50)[name = string(\"transpose_51\")];\n tensor q_norm_w_52 = const()[name = string(\"q_norm_w_52\"), val = tensor(BLOBFILE(path = string(\"@model_path/weights/weight.bin\"), offset = uint64(55175680)))];\n tensor k_norm_w_53 = const()[name = string(\"k_norm_w_53\"), val = tensor(BLOBFILE(path = string(\"@model_path/weights/weight.bin\"), offset = uint64(55176256)))];\n tensor abs_54 = abs(x=transpose_36)[name = string(\"abs_54\")];\n tensor iv_55 = const()[name = string(\"iv_55\"), val = tensor([3])];\n tensor reduce_max_56 = reduce_max(x=abs_54, axes=iv_55, keep_dims=b_4)[name = string(\"reduce_max_56\")];\n tensor maximum_57 = maximum(x=reduce_max_56, y=c_6)[name = string(\"maximum_57\")];\n tensor real_div_58 = real_div(x=c_8, y=maximum_57)[name = string(\"real_div_58\")];\n tensor mul_59 = mul(x=transpose_36, y=real_div_58)[name = string(\"mul_59\")];\n tensor pow_60 = pow(x=mul_59, y=c_11)[name = string(\"pow_60\")];\n tensor reduce_sum_61 = reduce_sum(x=pow_60, axes=iv_55, keep_dims=b_4)[name = string(\"reduce_sum_61\")];\n fp16 c_62 = const()[name = string(\"c_62\"), val = fp16(0.003906250000)];\n tensor mul_63 = mul(x=reduce_sum_61, y=c_62)[name = string(\"mul_63\")];\n tensor pow_64 = pow(x=real_div_58, y=c_11)[name = string(\"pow_64\")];\n tensor mul_65 = mul(x=pow_64, y=c_17)[name = string(\"mul_65\")];\n tensor add_66 = add(x=mul_63, y=mul_65)[name = string(\"add_66\")];\n tensor rsqrt_67 = rsqrt(x=add_66, epsilon=c_20)[name = string(\"rsqrt_67\")];\n tensor mul_68 = mul(x=mul_59, y=rsqrt_67)[name = string(\"mul_68\")];\n tensor mul_69 = mul(x=mul_68, y=q_norm_w_52)[name = string(\"mul_69\")];\n tensor iv_70 = const()[name = string(\"iv_70\"), val = tensor([1, 24, 128, 32])];\n tensor slice_by_size_71 = slice_by_size(x=mul_69, begin=iv_28, size=iv_70)[name = string(\"slice_by_size_71\")];\n tensor iv_72 = const()[name = string(\"iv_72\"), val = tensor([0, 0, 0, 32])];\n tensor slice_by_size_73 = slice_by_size(x=mul_69, begin=iv_72, size=iv_70)[name = string(\"slice_by_size_73\")];\n fp16 c_74 = const()[name = string(\"c_74\"), val = fp16(-1.000000000000)];\n tensor mul_75 = mul(x=slice_by_size_73, y=c_74)[name = string(\"mul_75\")];\n int32 i_76 = const()[name = string(\"i_76\"), val = int32(3)];\n bool b_77 = const()[name = string(\"b_77\"), val = bool(false)];\n tensor concat_78 = concat(axis=i_76, interleave=b_77, values=(mul_75, slice_by_size_71))[name = string(\"concat_78\")];\n tensor concat_79 = concat(axis=i_76, interleave=b_77, values=(slice_by_size_71, slice_by_size_73))[name = string(\"concat_79\")];\n tensor mul_80 = mul(x=concat_79, y=cos_in)[name = string(\"mul_80\")];\n tensor mul_81 = mul(x=concat_78, y=sin_in)[name = string(\"mul_81\")];\n tensor add_82 = add(x=mul_80, y=mul_81)[name = string(\"add_82\")];\n tensor iv_83 = const()[name = string(\"iv_83\"), val = tensor([0, 0, 0, 64])];\n tensor iv_84 = const()[name = string(\"iv_84\"), val = tensor([1, 24, 128, 192])];\n tensor slice_by_size_85 = slice_by_size(x=mul_69, begin=iv_83, size=iv_84)[name = string(\"slice_by_size_85\")];\n tensor concat_86 = concat(axis=i_76, interleave=b_77, values=(add_82, slice_by_size_85))[name = string(\"concat_86\")];\n tensor abs_87 = abs(x=transpose_46)[name = string(\"abs_87\")];\n tensor reduce_max_88 = reduce_max(x=abs_87, axes=iv_55, keep_dims=b_4)[name = string(\"reduce_max_88\")];\n tensor maximum_89 = maximum(x=reduce_max_88, y=c_6)[name = string(\"maximum_89\")];\n tensor real_div_90 = real_div(x=c_8, y=maximum_89)[name = string(\"real_div_90\")];\n tensor mul_91 = mul(x=transpose_46, y=real_div_90)[name = string(\"mul_91\")];\n tensor pow_92 = pow(x=mul_91, y=c_11)[name = string(\"pow_92\")];\n tensor reduce_sum_93 = reduce_sum(x=pow_92, axes=iv_55, keep_dims=b_4)[name = string(\"reduce_sum_93\")];\n tensor mul_94 = mul(x=reduce_sum_93, y=c_62)[name = string(\"mul_94\")];\n tensor pow_95 = pow(x=real_div_90, y=c_11)[name = string(\"pow_95\")];\n tensor mul_96 = mul(x=pow_95, y=c_17)[name = string(\"mul_96\")];\n tensor add_97 = add(x=mul_94, y=mul_96)[name = string(\"add_97\")];\n tensor rsqrt_98 = rsqrt(x=add_97, epsilon=c_20)[name = string(\"rsqrt_98\")];\n tensor mul_99 = mul(x=mul_91, y=rsqrt_98)[name = string(\"mul_99\")];\n tensor mul_100 = mul(x=mul_99, y=k_norm_w_53)[name = string(\"mul_100\")];\n tensor iv_101 = const()[name = string(\"iv_101\"), val = tensor([1, 4, 128, 32])];\n tensor slice_by_size_102 = slice_by_size(x=mul_100, begin=iv_28, size=iv_101)[name = string(\"slice_by_size_102\")];\n tensor slice_by_size_103 = slice_by_size(x=mul_100, begin=iv_72, size=iv_101)[name = string(\"slice_by_size_103\")];\n tensor mul_104 = mul(x=slice_by_size_103, y=c_74)[name = string(\"mul_104\")];\n tensor concat_105 = concat(axis=i_76, interleave=b_77, values=(mul_104, slice_by_size_102))[name = string(\"concat_105\")];\n tensor concat_106 = concat(axis=i_76, interleave=b_77, values=(slice_by_size_102, slice_by_size_103))[name = string(\"concat_106\")];\n tensor mul_107 = mul(x=concat_106, y=cos_in)[name = string(\"mul_107\")];\n tensor mul_108 = mul(x=concat_105, y=sin_in)[name = string(\"mul_108\")];\n tensor add_109 = add(x=mul_107, y=mul_108)[name = string(\"add_109\")];\n tensor iv_110 = const()[name = string(\"iv_110\"), val = tensor([1, 4, 128, 192])];\n tensor slice_by_size_111 = slice_by_size(x=mul_100, begin=iv_83, size=iv_110)[name = string(\"slice_by_size_111\")];\n tensor concat_112 = concat(axis=i_76, interleave=b_77, values=(add_109, slice_by_size_111))[name = string(\"concat_112\")];\n tensor iv_113 = const()[name = string(\"iv_113\"), val = tensor([1, 4, 768, 256])];\n tensor reshape_114 = reshape(shape=iv_113, x=concat_86)[name = string(\"reshape_114\")];\n tensor matmul_115 = matmul(transpose_x=b_77, transpose_y=b_4, x=reshape_114, y=k_cache)[name = string(\"matmul_115\")];\n tensor mul_116 = mul(x=matmul_115, y=c_6)[name = string(\"mul_116\")];\n tensor add_117 = add(x=mul_116, y=mask_in)[name = string(\"add_117\")];\n tensor matmul_118 = matmul(transpose_x=b_77, transpose_y=b_4, x=reshape_114, y=concat_112)[name = string(\"matmul_118\")];\n tensor mul_119 = mul(x=matmul_118, y=c_6)[name = string(\"mul_119\")];\n tensor own_mask_120 = const()[name = string(\"own_mask_120\"), val = tensor(BLOBFILE(path = string(\"@model_path/weights/weight.bin\"), offset = uint64(55176832)))];\n tensor add_121 = add(x=mul_119, y=own_mask_120)[name = string(\"add_121\")];\n tensor reduce_max_122 = reduce_max(x=add_117, axes=iv_55, keep_dims=b_4)[name = string(\"reduce_max_122\")];\n tensor reduce_max_123 = reduce_max(x=add_121, axes=iv_55, keep_dims=b_4)[name = string(\"reduce_max_123\")];\n tensor maximum_124 = maximum(x=reduce_max_122, y=reduce_max_123)[name = string(\"maximum_124\")];\n tensor sub_125 = sub(x=add_117, y=maximum_124)[name = string(\"sub_125\")];\n tensor exp_126 = exp(x=sub_125)[name = string(\"exp_126\")];\n tensor sub_127 = sub(x=add_121, y=maximum_124)[name = string(\"sub_127\")];\n tensor exp_128 = exp(x=sub_127)[name = string(\"exp_128\")];\n tensor reduce_sum_129 = reduce_sum(x=exp_126, axes=iv_55, keep_dims=b_4)[name = string(\"reduce_sum_129\")];\n tensor reduce_sum_130 = reduce_sum(x=exp_128, axes=iv_55, keep_dims=b_4)[name = string(\"reduce_sum_130\")];\n tensor add_131 = add(x=reduce_sum_129, y=reduce_sum_130)[name = string(\"add_131\")];\n tensor real_div_132 = real_div(x=c_8, y=add_131)[name = string(\"real_div_132\")];\n fp16 c_133 = const()[name = string(\"c_133\"), val = fp16(16.000000000000)];\n tensor mul_134 = mul(x=real_div_132, y=c_133)[name = string(\"mul_134\")];\n tensor mul_135 = mul(x=exp_126, y=mul_134)[name = string(\"mul_135\")];\n tensor matmul_136 = matmul(transpose_x=b_77, transpose_y=b_77, x=mul_135, y=v_cache)[name = string(\"matmul_136\")];\n tensor mul_137 = mul(x=exp_128, y=mul_134)[name = string(\"mul_137\")];\n tensor matmul_138 = matmul(transpose_x=b_77, transpose_y=b_77, x=mul_137, y=transpose_51)[name = string(\"matmul_138\")];\n tensor add_139 = add(x=matmul_136, y=matmul_138)[name = string(\"add_139\")];\n tensor mul_140 = mul(x=add_139, y=c_6)[name = string(\"mul_140\")];\n tensor iv_141 = const()[name = string(\"iv_141\"), val = tensor([1, 24, 128, 256])];\n tensor reshape_142 = reshape(shape=iv_141, x=mul_140)[name = string(\"reshape_142\")];\n tensor mul_143 = mul(x=transpose_40, y=c_74)[name = string(\"mul_143\")];\n tensor exp_144 = exp(x=mul_143)[name = string(\"exp_144\")];\n tensor add_145 = add(x=exp_144, y=c_8)[name = string(\"add_145\")];\n tensor real_div_146 = real_div(x=c_8, y=add_145)[name = string(\"real_div_146\")];\n tensor mul_147 = mul(x=reshape_142, y=real_div_146)[name = string(\"mul_147\")];\n tensor transpose_148 = transpose(perm=iv_35, x=mul_147)[name = string(\"transpose_148\")];\n tensor reshape_149 = reshape(shape=iv_31, x=transpose_148)[name = string(\"reshape_149\")];\n tensor w_o_lut_150 = const()[name = string(\"w_o_lut_150\"), val = tensor(BLOBFILE(path = string(\"@model_path/weights/weight.bin\"), offset = uint64(78966528)))];\n tensor w_o_151 = constexpr_lut_to_dense(indices = tensor(BLOBFILE(path = string(\"@model_path/weights/weight.bin\"), offset = uint64(55373504))), lut = w_o_lut_150)[name = string(\"w_o_151\")];\n tensor conv_152 = conv(dilations=iv_26, groups=i_27, pad=iv_28, pad_type=str_29, strides=iv_26, weight=w_o_151, x=reshape_149)[name = string(\"conv_152\")];\n tensor add_153 = add(x=hid_in, y=conv_152)[name = string(\"add_153\")];\n tensor hid_out = identity(x=add_153)[name = string(\"hid_out\")];\n tensor k_out = identity(x=concat_112)[name = string(\"k_out\")];\n tensor v_out = identity(x=transpose_51)[name = string(\"v_out\")];\n } -> (hid_out, k_out, v_out);\n}\n","weight_file":"programs/39/attention.bin","inputs":[{"name":"hid_in","shape":[1,5120,1,128],"dtype":"fp16"},{"name":"k_cache","shape":[1,4,4096,256],"dtype":"fp16"},{"name":"v_cache","shape":[1,4,4096,256],"dtype":"fp16"},{"name":"cos_in","shape":[1,1,128,64],"dtype":"fp16"},{"name":"sin_in","shape":[1,1,128,64],"dtype":"fp16"},{"name":"mask_in","shape":[1,1,1,4096],"dtype":"fp16"}],"outputs":[{"name":"hid_out","shape":[1,5120,1,128],"dtype":"fp16"},{"name":"k_out","shape":[1,4,128,256],"dtype":"fp16"},{"name":"v_out","shape":[1,4,128,256],"dtype":"fp16"}]}