Files
DS4Server/tests/fixtures/mtplx-compute_g-jit.json
T

2 lines
41 KiB
JSON

{"source_sha256": "34143a98046f8af5538767734fc169a5cab22a4920c26f9ba7ea45b8097152de", "kernels": "[[host_name(\"Ef4IAsTypeAFf4IExpEGf4INegativeFHV2IBroadcastBCIV2IBroadcastCBJV2IAddHIKV2IBroadcastJDLV2IBroadcastDJMV2ILogAddExpKLNf4IAsTypeMOf4IBroadcastGNPf4IBroadcastNGQf4IMultiplyOPRf4OExpQ_VVVC_V2V2V2_10408321403207385874_contiguous\")]]\n[[kernel]] void Ef4IAsTypeAFf4IExpEGf4INegativeFHV2IBroadcastBCIV2IBroadcastCBJV2IAddHIKV2IBroadcastJDLV2IBroadcastDJMV2ILogAddExpKLNf4IAsTypeMOf4IBroadcastGNPf4IBroadcastNGQf4IMultiplyOPRf4OExpQ_VVVC_V2V2V2_10408321403207385874_contiguous(\n device const bfloat16_t* A [[buffer(0)]],\n device const bfloat16_t* B [[buffer(1)]],\n device const bfloat16_t* C [[buffer(2)]],\n device float* D [[buffer(3)]],\n constant const uint& size [[buffer(4)]],\n uint3 pos [[thread_position_in_grid]],\n uint3 grid [[threads_per_grid]]) {\n constexpr int N_ = 1;\n uint index = N_ * pos.x;\n bfloat16_t tmp_A = A[index];\n bfloat16_t tmp_B = B[index];\n bfloat16_t tmp_C = C[index];\n auto tmp_E = static_cast<bfloat16_t>(0);\n float tmp_F = cast_to<float>(tmp_A);\n float tmp_G = Exp()(tmp_F);\n float tmp_H = Negative()(tmp_G);\n bfloat16_t tmp_I = cast_to<bfloat16_t>(tmp_B);\n bfloat16_t tmp_J = cast_to<bfloat16_t>(tmp_C);\n bfloat16_t tmp_K = Add()(tmp_I, tmp_J);\n bfloat16_t tmp_L = cast_to<bfloat16_t>(tmp_K);\n bfloat16_t tmp_M = cast_to<bfloat16_t>(tmp_E);\n bfloat16_t tmp_N = LogAddExp()(tmp_L, tmp_M);\n float tmp_O = cast_to<float>(tmp_N);\n float tmp_P = cast_to<float>(tmp_H);\n float tmp_Q = cast_to<float>(tmp_O);\n float tmp_R = Multiply()(tmp_P, tmp_Q);\n float tmp_D = Exp()(tmp_R);\n D[index] = tmp_D;\n}\n[[host_name(\"Ef4IAsTypeAFf4IExpEGf4INegativeFHV2IBroadcastBCIV2IBroadcastCBJV2IAddHIKV2IBroadcastJDLV2IBroadcastDJMV2ILogAddExpKLNf4IAsTypeMOf4IBroadcastGNPf4IBroadcastNGQf4IMultiplyOPRf4OExpQ_VVVC_V2V2V2_10408321403207385874_contiguous_n\")]]\n[[kernel]] void Ef4IAsTypeAFf4IExpEGf4INegativeFHV2IBroadcastBCIV2IBroadcastCBJV2IAddHIKV2IBroadcastJDLV2IBroadcastDJMV2ILogAddExpKLNf4IAsTypeMOf4IBroadcastGNPf4IBroadcastNGQf4IMultiplyOPRf4OExpQ_VVVC_V2V2V2_10408321403207385874_contiguous_n(\n device const bfloat16_t* A [[buffer(0)]],\n device const bfloat16_t* B [[buffer(1)]],\n device const bfloat16_t* C [[buffer(2)]],\n device float* D [[buffer(3)]],\n constant const uint& size [[buffer(4)]],\n uint3 pos [[thread_position_in_grid]],\n uint3 grid [[threads_per_grid]]) {\n constexpr int N_ = 2;\n uint index = N_ * pos.x;\n for (int i = 0; i < N_ && index < size; ++i) {\n bfloat16_t tmp_A = A[index];\n bfloat16_t tmp_B = B[index];\n bfloat16_t tmp_C = C[index];\n auto tmp_E = static_cast<bfloat16_t>(0);\n float tmp_F = cast_to<float>(tmp_A);\n float tmp_G = Exp()(tmp_F);\n float tmp_H = Negative()(tmp_G);\n bfloat16_t tmp_I = cast_to<bfloat16_t>(tmp_B);\n bfloat16_t tmp_J = cast_to<bfloat16_t>(tmp_C);\n bfloat16_t tmp_K = Add()(tmp_I, tmp_J);\n bfloat16_t tmp_L = cast_to<bfloat16_t>(tmp_K);\n bfloat16_t tmp_M = cast_to<bfloat16_t>(tmp_E);\n bfloat16_t tmp_N = LogAddExp()(tmp_L, tmp_M);\n float tmp_O = cast_to<float>(tmp_N);\n float tmp_P = cast_to<float>(tmp_H);\n float tmp_Q = cast_to<float>(tmp_O);\n float tmp_R = Multiply()(tmp_P, tmp_Q);\n float tmp_D = Exp()(tmp_R);\n D[index] = tmp_D;\n index++;\n }\n}\n[[host_name(\"Ef4IAsTypeAFf4IExpEGf4INegativeFHV2IBroadcastBCIV2IBroadcastCBJV2IAddHIKV2IBroadcastJDLV2IBroadcastDJMV2ILogAddExpKLNf4IAsTypeMOf4IBroadcastGNPf4IBroadcastNGQf4IMultiplyOPRf4OExpQ_VVVC_V2V2V2_10408321403207385874_contiguous_large\")]]\n[[kernel]] void Ef4IAsTypeAFf4IExpEGf4INegativeFHV2IBroadcastBCIV2IBroadcastCBJV2IAddHIKV2IBroadcastJDLV2IBroadcastDJMV2ILogAddExpKLNf4IAsTypeMOf4IBroadcastGNPf4IBroadcastNGQf4IMultiplyOPRf4OExpQ_VVVC_V2V2V2_10408321403207385874_contiguous_large(\n device const bfloat16_t* A [[buffer(0)]],\n device const bfloat16_t* B [[buffer(1)]],\n device const bfloat16_t* C [[buffer(2)]],\n device float* D [[buffer(3)]],\n constant const int64_t& size [[buffer(4)]],\n uint3 pos [[thread_position_in_grid]],\n uint3 grid [[threads_per_grid]]) {\n constexpr int N_ = 2;\n int64_t index = N_ * (pos.x + grid.x * int64_t(pos.y));\n for (int i = 0; i < N_ && index < size; ++i) {\n bfloat16_t tmp_A = A[index];\n bfloat16_t tmp_B = B[index];\n bfloat16_t tmp_C = C[index];\n auto tmp_E = static_cast<bfloat16_t>(0);\n float tmp_F = cast_to<float>(tmp_A);\n float tmp_G = Exp()(tmp_F);\n float tmp_H = Negative()(tmp_G);\n bfloat16_t tmp_I = cast_to<bfloat16_t>(tmp_B);\n bfloat16_t tmp_J = cast_to<bfloat16_t>(tmp_C);\n bfloat16_t tmp_K = Add()(tmp_I, tmp_J);\n bfloat16_t tmp_L = cast_to<bfloat16_t>(tmp_K);\n bfloat16_t tmp_M = cast_to<bfloat16_t>(tmp_E);\n bfloat16_t tmp_N = LogAddExp()(tmp_L, tmp_M);\n float tmp_O = cast_to<float>(tmp_N);\n float tmp_P = cast_to<float>(tmp_H);\n float tmp_Q = cast_to<float>(tmp_O);\n float tmp_R = Multiply()(tmp_P, tmp_Q);\n float tmp_D = Exp()(tmp_R);\n D[index] = tmp_D;\n index++;\n }\n}\n[[host_name(\"Ef4IAsTypeAFf4IExpEGf4INegativeFHV2IBroadcastBCIV2IBroadcastCBJV2IAddHIKV2IBroadcastJDLV2IBroadcastDJMV2ILogAddExpKLNf4IAsTypeMOf4IBroadcastGNPf4IBroadcastNGQf4IMultiplyOPRf4OExpQ_VVVC_V2V2V2_10408321403207385874_strided_1\")]]\n[[kernel]] void Ef4IAsTypeAFf4IExpEGf4INegativeFHV2IBroadcastBCIV2IBroadcastCBJV2IAddHIKV2IBroadcastJDLV2IBroadcastDJMV2ILogAddExpKLNf4IAsTypeMOf4IBroadcastGNPf4IBroadcastNGQf4IMultiplyOPRf4OExpQ_VVVC_V2V2V2_10408321403207385874_strided_1(\n device const bfloat16_t* A [[buffer(0)]],\n device const bfloat16_t* B [[buffer(1)]],\n device const bfloat16_t* C [[buffer(2)]],\n constant const int64_t* in_strides [[buffer(3)]],\n device float* D [[buffer(4)]],\n constant const int* output_shape [[buffer(5)]],\n uint3 pos [[thread_position_in_grid]],\n uint3 grid [[threads_per_grid]]) {\n constexpr int N_ = 1;\n uint index = pos.x + grid.x * (pos.y + uint(grid.y) * pos.z);\n auto tmp_E = static_cast<bfloat16_t>(0);\n uint index_A = elem_to_loc_1<uint>(pos.x, in_strides[0]);\n uint index_B = elem_to_loc_1<uint>(pos.x, in_strides[1]);\n uint index_C = elem_to_loc_1<uint>(pos.x, in_strides[2]);\n bfloat16_t tmp_A = A[index_A];\n bfloat16_t tmp_B = B[index_B];\n bfloat16_t tmp_C = C[index_C];\n float tmp_F = cast_to<float>(tmp_A);\n float tmp_G = Exp()(tmp_F);\n float tmp_H = Negative()(tmp_G);\n bfloat16_t tmp_I = cast_to<bfloat16_t>(tmp_B);\n bfloat16_t tmp_J = cast_to<bfloat16_t>(tmp_C);\n bfloat16_t tmp_K = Add()(tmp_I, tmp_J);\n bfloat16_t tmp_L = cast_to<bfloat16_t>(tmp_K);\n bfloat16_t tmp_M = cast_to<bfloat16_t>(tmp_E);\n bfloat16_t tmp_N = LogAddExp()(tmp_L, tmp_M);\n float tmp_O = cast_to<float>(tmp_N);\n float tmp_P = cast_to<float>(tmp_H);\n float tmp_Q = cast_to<float>(tmp_O);\n float tmp_R = Multiply()(tmp_P, tmp_Q);\n float tmp_D = Exp()(tmp_R);\n D[index] = tmp_D;\n}\n[[host_name(\"Ef4IAsTypeAFf4IExpEGf4INegativeFHV2IBroadcastBCIV2IBroadcastCBJV2IAddHIKV2IBroadcastJDLV2IBroadcastDJMV2ILogAddExpKLNf4IAsTypeMOf4IBroadcastGNPf4IBroadcastNGQf4IMultiplyOPRf4OExpQ_VVVC_V2V2V2_10408321403207385874_strided_1_large\")]]\n[[kernel]] void Ef4IAsTypeAFf4IExpEGf4INegativeFHV2IBroadcastBCIV2IBroadcastCBJV2IAddHIKV2IBroadcastJDLV2IBroadcastDJMV2ILogAddExpKLNf4IAsTypeMOf4IBroadcastGNPf4IBroadcastNGQf4IMultiplyOPRf4OExpQ_VVVC_V2V2V2_10408321403207385874_strided_1_large(\n device const bfloat16_t* A [[buffer(0)]],\n device const bfloat16_t* B [[buffer(1)]],\n device const bfloat16_t* C [[buffer(2)]],\n constant const int64_t* in_strides [[buffer(3)]],\n device float* D [[buffer(4)]],\n constant const int* output_shape [[buffer(5)]],\n uint3 pos [[thread_position_in_grid]],\n uint3 grid [[threads_per_grid]]) {\n constexpr int N_ = 1;\n int64_t index = pos.x + grid.x * (pos.y + int64_t(grid.y) * pos.z);\n auto tmp_E = static_cast<bfloat16_t>(0);\n int64_t index_A = elem_to_loc_1<int64_t>(pos.x, in_strides[0]);\n int64_t index_B = elem_to_loc_1<int64_t>(pos.x, in_strides[1]);\n int64_t index_C = elem_to_loc_1<int64_t>(pos.x, in_strides[2]);\n bfloat16_t tmp_A = A[index_A];\n bfloat16_t tmp_B = B[index_B];\n bfloat16_t tmp_C = C[index_C];\n float tmp_F = cast_to<float>(tmp_A);\n float tmp_G = Exp()(tmp_F);\n float tmp_H = Negative()(tmp_G);\n bfloat16_t tmp_I = cast_to<bfloat16_t>(tmp_B);\n bfloat16_t tmp_J = cast_to<bfloat16_t>(tmp_C);\n bfloat16_t tmp_K = Add()(tmp_I, tmp_J);\n bfloat16_t tmp_L = cast_to<bfloat16_t>(tmp_K);\n bfloat16_t tmp_M = cast_to<bfloat16_t>(tmp_E);\n bfloat16_t tmp_N = LogAddExp()(tmp_L, tmp_M);\n float tmp_O = cast_to<float>(tmp_N);\n float tmp_P = cast_to<float>(tmp_H);\n float tmp_Q = cast_to<float>(tmp_O);\n float tmp_R = Multiply()(tmp_P, tmp_Q);\n float tmp_D = Exp()(tmp_R);\n D[index] = tmp_D;\n}\n[[host_name(\"Ef4IAsTypeAFf4IExpEGf4INegativeFHV2IBroadcastBCIV2IBroadcastCBJV2IAddHIKV2IBroadcastJDLV2IBroadcastDJMV2ILogAddExpKLNf4IAsTypeMOf4IBroadcastGNPf4IBroadcastNGQf4IMultiplyOPRf4OExpQ_VVVC_V2V2V2_10408321403207385874_strided_2\")]]\n[[kernel]] void Ef4IAsTypeAFf4IExpEGf4INegativeFHV2IBroadcastBCIV2IBroadcastCBJV2IAddHIKV2IBroadcastJDLV2IBroadcastDJMV2ILogAddExpKLNf4IAsTypeMOf4IBroadcastGNPf4IBroadcastNGQf4IMultiplyOPRf4OExpQ_VVVC_V2V2V2_10408321403207385874_strided_2(\n device const bfloat16_t* A [[buffer(0)]],\n device const bfloat16_t* B [[buffer(1)]],\n device const bfloat16_t* C [[buffer(2)]],\n constant const int64_t* in_strides [[buffer(3)]],\n device float* D [[buffer(4)]],\n constant const int* output_shape [[buffer(5)]],\n uint3 pos [[thread_position_in_grid]],\n uint3 grid [[threads_per_grid]]) {\n constexpr int N_ = 1;\n uint index = pos.x + grid.x * (pos.y + uint(grid.y) * pos.z);\n auto tmp_E = static_cast<bfloat16_t>(0);\n uint index_A = elem_to_loc_2<uint>({pos.x, pos.y}, in_strides + 0);\n uint index_B = elem_to_loc_2<uint>({pos.x, pos.y}, in_strides + 2);\n uint index_C = elem_to_loc_2<uint>({pos.x, pos.y}, in_strides + 4);\n bfloat16_t tmp_A = A[index_A];\n bfloat16_t tmp_B = B[index_B];\n bfloat16_t tmp_C = C[index_C];\n float tmp_F = cast_to<float>(tmp_A);\n float tmp_G = Exp()(tmp_F);\n float tmp_H = Negative()(tmp_G);\n bfloat16_t tmp_I = cast_to<bfloat16_t>(tmp_B);\n bfloat16_t tmp_J = cast_to<bfloat16_t>(tmp_C);\n bfloat16_t tmp_K = Add()(tmp_I, tmp_J);\n bfloat16_t tmp_L = cast_to<bfloat16_t>(tmp_K);\n bfloat16_t tmp_M = cast_to<bfloat16_t>(tmp_E);\n bfloat16_t tmp_N = LogAddExp()(tmp_L, tmp_M);\n float tmp_O = cast_to<float>(tmp_N);\n float tmp_P = cast_to<float>(tmp_H);\n float tmp_Q = cast_to<float>(tmp_O);\n float tmp_R = Multiply()(tmp_P, tmp_Q);\n float tmp_D = Exp()(tmp_R);\n D[index] = tmp_D;\n}\n[[host_name(\"Ef4IAsTypeAFf4IExpEGf4INegativeFHV2IBroadcastBCIV2IBroadcastCBJV2IAddHIKV2IBroadcastJDLV2IBroadcastDJMV2ILogAddExpKLNf4IAsTypeMOf4IBroadcastGNPf4IBroadcastNGQf4IMultiplyOPRf4OExpQ_VVVC_V2V2V2_10408321403207385874_strided_2_large\")]]\n[[kernel]] void Ef4IAsTypeAFf4IExpEGf4INegativeFHV2IBroadcastBCIV2IBroadcastCBJV2IAddHIKV2IBroadcastJDLV2IBroadcastDJMV2ILogAddExpKLNf4IAsTypeMOf4IBroadcastGNPf4IBroadcastNGQf4IMultiplyOPRf4OExpQ_VVVC_V2V2V2_10408321403207385874_strided_2_large(\n device const bfloat16_t* A [[buffer(0)]],\n device const bfloat16_t* B [[buffer(1)]],\n device const bfloat16_t* C [[buffer(2)]],\n constant const int64_t* in_strides [[buffer(3)]],\n device float* D [[buffer(4)]],\n constant const int* output_shape [[buffer(5)]],\n uint3 pos [[thread_position_in_grid]],\n uint3 grid [[threads_per_grid]]) {\n constexpr int N_ = 1;\n int64_t index = pos.x + grid.x * (pos.y + int64_t(grid.y) * pos.z);\n auto tmp_E = static_cast<bfloat16_t>(0);\n int64_t index_A = elem_to_loc_2<int64_t>({pos.x, pos.y}, in_strides + 0);\n int64_t index_B = elem_to_loc_2<int64_t>({pos.x, pos.y}, in_strides + 2);\n int64_t index_C = elem_to_loc_2<int64_t>({pos.x, pos.y}, in_strides + 4);\n bfloat16_t tmp_A = A[index_A];\n bfloat16_t tmp_B = B[index_B];\n bfloat16_t tmp_C = C[index_C];\n float tmp_F = cast_to<float>(tmp_A);\n float tmp_G = Exp()(tmp_F);\n float tmp_H = Negative()(tmp_G);\n bfloat16_t tmp_I = cast_to<bfloat16_t>(tmp_B);\n bfloat16_t tmp_J = cast_to<bfloat16_t>(tmp_C);\n bfloat16_t tmp_K = Add()(tmp_I, tmp_J);\n bfloat16_t tmp_L = cast_to<bfloat16_t>(tmp_K);\n bfloat16_t tmp_M = cast_to<bfloat16_t>(tmp_E);\n bfloat16_t tmp_N = LogAddExp()(tmp_L, tmp_M);\n float tmp_O = cast_to<float>(tmp_N);\n float tmp_P = cast_to<float>(tmp_H);\n float tmp_Q = cast_to<float>(tmp_O);\n float tmp_R = Multiply()(tmp_P, tmp_Q);\n float tmp_D = Exp()(tmp_R);\n D[index] = tmp_D;\n}\n[[host_name(\"Ef4IAsTypeAFf4IExpEGf4INegativeFHV2IBroadcastBCIV2IBroadcastCBJV2IAddHIKV2IBroadcastJDLV2IBroadcastDJMV2ILogAddExpKLNf4IAsTypeMOf4IBroadcastGNPf4IBroadcastNGQf4IMultiplyOPRf4OExpQ_VVVC_V2V2V2_10408321403207385874_strided_3\")]]\n[[kernel]] void Ef4IAsTypeAFf4IExpEGf4INegativeFHV2IBroadcastBCIV2IBroadcastCBJV2IAddHIKV2IBroadcastJDLV2IBroadcastDJMV2ILogAddExpKLNf4IAsTypeMOf4IBroadcastGNPf4IBroadcastNGQf4IMultiplyOPRf4OExpQ_VVVC_V2V2V2_10408321403207385874_strided_3(\n device const bfloat16_t* A [[buffer(0)]],\n device const bfloat16_t* B [[buffer(1)]],\n device const bfloat16_t* C [[buffer(2)]],\n constant const int64_t* in_strides [[buffer(3)]],\n device float* D [[buffer(4)]],\n constant const int* output_shape [[buffer(5)]],\n uint3 pos [[thread_position_in_grid]],\n uint3 grid [[threads_per_grid]]) {\n constexpr int N_ = 1;\n uint index = pos.x + grid.x * (pos.y + uint(grid.y) * pos.z);\n auto tmp_E = static_cast<bfloat16_t>(0);\n uint index_A = elem_to_loc_3<uint>(pos, in_strides + 0);\n uint index_B = elem_to_loc_3<uint>(pos, in_strides + 3);\n uint index_C = elem_to_loc_3<uint>(pos, in_strides + 6);\n bfloat16_t tmp_A = A[index_A];\n bfloat16_t tmp_B = B[index_B];\n bfloat16_t tmp_C = C[index_C];\n float tmp_F = cast_to<float>(tmp_A);\n float tmp_G = Exp()(tmp_F);\n float tmp_H = Negative()(tmp_G);\n bfloat16_t tmp_I = cast_to<bfloat16_t>(tmp_B);\n bfloat16_t tmp_J = cast_to<bfloat16_t>(tmp_C);\n bfloat16_t tmp_K = Add()(tmp_I, tmp_J);\n bfloat16_t tmp_L = cast_to<bfloat16_t>(tmp_K);\n bfloat16_t tmp_M = cast_to<bfloat16_t>(tmp_E);\n bfloat16_t tmp_N = LogAddExp()(tmp_L, tmp_M);\n float tmp_O = cast_to<float>(tmp_N);\n float tmp_P = cast_to<float>(tmp_H);\n float tmp_Q = cast_to<float>(tmp_O);\n float tmp_R = Multiply()(tmp_P, tmp_Q);\n float tmp_D = Exp()(tmp_R);\n D[index] = tmp_D;\n}\n[[host_name(\"Ef4IAsTypeAFf4IExpEGf4INegativeFHV2IBroadcastBCIV2IBroadcastCBJV2IAddHIKV2IBroadcastJDLV2IBroadcastDJMV2ILogAddExpKLNf4IAsTypeMOf4IBroadcastGNPf4IBroadcastNGQf4IMultiplyOPRf4OExpQ_VVVC_V2V2V2_10408321403207385874_strided_3_large\")]]\n[[kernel]] void Ef4IAsTypeAFf4IExpEGf4INegativeFHV2IBroadcastBCIV2IBroadcastCBJV2IAddHIKV2IBroadcastJDLV2IBroadcastDJMV2ILogAddExpKLNf4IAsTypeMOf4IBroadcastGNPf4IBroadcastNGQf4IMultiplyOPRf4OExpQ_VVVC_V2V2V2_10408321403207385874_strided_3_large(\n device const bfloat16_t* A [[buffer(0)]],\n device const bfloat16_t* B [[buffer(1)]],\n device const bfloat16_t* C [[buffer(2)]],\n constant const int64_t* in_strides [[buffer(3)]],\n device float* D [[buffer(4)]],\n constant const int* output_shape [[buffer(5)]],\n uint3 pos [[thread_position_in_grid]],\n uint3 grid [[threads_per_grid]]) {\n constexpr int N_ = 1;\n int64_t index = pos.x + grid.x * (pos.y + int64_t(grid.y) * pos.z);\n auto tmp_E = static_cast<bfloat16_t>(0);\n int64_t index_A = elem_to_loc_3<int64_t>(pos, in_strides + 0);\n int64_t index_B = elem_to_loc_3<int64_t>(pos, in_strides + 3);\n int64_t index_C = elem_to_loc_3<int64_t>(pos, in_strides + 6);\n bfloat16_t tmp_A = A[index_A];\n bfloat16_t tmp_B = B[index_B];\n bfloat16_t tmp_C = C[index_C];\n float tmp_F = cast_to<float>(tmp_A);\n float tmp_G = Exp()(tmp_F);\n float tmp_H = Negative()(tmp_G);\n bfloat16_t tmp_I = cast_to<bfloat16_t>(tmp_B);\n bfloat16_t tmp_J = cast_to<bfloat16_t>(tmp_C);\n bfloat16_t tmp_K = Add()(tmp_I, tmp_J);\n bfloat16_t tmp_L = cast_to<bfloat16_t>(tmp_K);\n bfloat16_t tmp_M = cast_to<bfloat16_t>(tmp_E);\n bfloat16_t tmp_N = LogAddExp()(tmp_L, tmp_M);\n float tmp_O = cast_to<float>(tmp_N);\n float tmp_P = cast_to<float>(tmp_H);\n float tmp_Q = cast_to<float>(tmp_O);\n float tmp_R = Multiply()(tmp_P, tmp_Q);\n float tmp_D = Exp()(tmp_R);\n D[index] = tmp_D;\n}\n[[host_name(\"Ef4IAsTypeAFf4IExpEGf4INegativeFHV2IBroadcastBCIV2IBroadcastCBJV2IAddHIKV2IBroadcastJDLV2IBroadcastDJMV2ILogAddExpKLNf4IAsTypeMOf4IBroadcastGNPf4IBroadcastNGQf4IMultiplyOPRf4OExpQ_VVVC_V2V2V2_10408321403207385874_strided_4\")]]\n[[kernel]] void Ef4IAsTypeAFf4IExpEGf4INegativeFHV2IBroadcastBCIV2IBroadcastCBJV2IAddHIKV2IBroadcastJDLV2IBroadcastDJMV2ILogAddExpKLNf4IAsTypeMOf4IBroadcastGNPf4IBroadcastNGQf4IMultiplyOPRf4OExpQ_VVVC_V2V2V2_10408321403207385874_strided_4(\n device const bfloat16_t* A [[buffer(0)]],\n device const bfloat16_t* B [[buffer(1)]],\n device const bfloat16_t* C [[buffer(2)]],\n constant const int64_t* in_strides [[buffer(3)]],\n device float* D [[buffer(4)]],\n constant const int* output_shape [[buffer(5)]],\n uint3 pos [[thread_position_in_grid]],\n uint3 grid [[threads_per_grid]]) {\n constexpr int N_ = 2;\n int xshape = output_shape[3];\n uint index = N_ * pos.x + xshape * (pos.y + uint(grid.y) * pos.z);\n auto tmp_E = static_cast<bfloat16_t>(0);\n uint index_A = N_ * pos.x * uint(in_strides[3]) + pos.y * uint(in_strides[2]);\n uint index_B = N_ * pos.x * uint(in_strides[7]) + pos.y * uint(in_strides[6]);\n uint index_C = N_ * pos.x * uint(in_strides[11]) + pos.y * uint(in_strides[10]);\n uint zpos = pos.z;\n for (int d = 1; d >= 0; --d) {\n uint l = zpos % output_shape[d];\n index_A += l * uint(in_strides[0 + d]);\n index_B += l * uint(in_strides[4 + d]);\n index_C += l * uint(in_strides[8 + d]);\n zpos /= output_shape[d];\n }\n for (int i = 0; i < N_ && (int(N_ * pos.x) + i) < xshape; ++i) {\n bfloat16_t tmp_A = A[index_A];\n bfloat16_t tmp_B = B[index_B];\n bfloat16_t tmp_C = C[index_C];\n float tmp_F = cast_to<float>(tmp_A);\n float tmp_G = Exp()(tmp_F);\n float tmp_H = Negative()(tmp_G);\n bfloat16_t tmp_I = cast_to<bfloat16_t>(tmp_B);\n bfloat16_t tmp_J = cast_to<bfloat16_t>(tmp_C);\n bfloat16_t tmp_K = Add()(tmp_I, tmp_J);\n bfloat16_t tmp_L = cast_to<bfloat16_t>(tmp_K);\n bfloat16_t tmp_M = cast_to<bfloat16_t>(tmp_E);\n bfloat16_t tmp_N = LogAddExp()(tmp_L, tmp_M);\n float tmp_O = cast_to<float>(tmp_N);\n float tmp_P = cast_to<float>(tmp_H);\n float tmp_Q = cast_to<float>(tmp_O);\n float tmp_R = Multiply()(tmp_P, tmp_Q);\n float tmp_D = Exp()(tmp_R);\n D[index] = tmp_D;\n index_A += in_strides[3];\n index_B += in_strides[7];\n index_C += in_strides[11];\n index++;\n }\n}\n[[host_name(\"Ef4IAsTypeAFf4IExpEGf4INegativeFHV2IBroadcastBCIV2IBroadcastCBJV2IAddHIKV2IBroadcastJDLV2IBroadcastDJMV2ILogAddExpKLNf4IAsTypeMOf4IBroadcastGNPf4IBroadcastNGQf4IMultiplyOPRf4OExpQ_VVVC_V2V2V2_10408321403207385874_strided_4_large\")]]\n[[kernel]] void Ef4IAsTypeAFf4IExpEGf4INegativeFHV2IBroadcastBCIV2IBroadcastCBJV2IAddHIKV2IBroadcastJDLV2IBroadcastDJMV2ILogAddExpKLNf4IAsTypeMOf4IBroadcastGNPf4IBroadcastNGQf4IMultiplyOPRf4OExpQ_VVVC_V2V2V2_10408321403207385874_strided_4_large(\n device const bfloat16_t* A [[buffer(0)]],\n device const bfloat16_t* B [[buffer(1)]],\n device const bfloat16_t* C [[buffer(2)]],\n constant const int64_t* in_strides [[buffer(3)]],\n device float* D [[buffer(4)]],\n constant const int* output_shape [[buffer(5)]],\n uint3 pos [[thread_position_in_grid]],\n uint3 grid [[threads_per_grid]]) {\n constexpr int N_ = 4;\n int xshape = output_shape[3];\n int64_t index = N_ * pos.x + xshape * (pos.y + int64_t(grid.y) * pos.z);\n auto tmp_E = static_cast<bfloat16_t>(0);\n int64_t index_A = N_ * pos.x * int64_t(in_strides[3]) + pos.y * int64_t(in_strides[2]);\n int64_t index_B = N_ * pos.x * int64_t(in_strides[7]) + pos.y * int64_t(in_strides[6]);\n int64_t index_C = N_ * pos.x * int64_t(in_strides[11]) + pos.y * int64_t(in_strides[10]);\n uint zpos = pos.z;\n for (int d = 1; d >= 0; --d) {\n uint l = zpos % output_shape[d];\n index_A += l * int64_t(in_strides[0 + d]);\n index_B += l * int64_t(in_strides[4 + d]);\n index_C += l * int64_t(in_strides[8 + d]);\n zpos /= output_shape[d];\n }\n for (int i = 0; i < N_ && (int(N_ * pos.x) + i) < xshape; ++i) {\n bfloat16_t tmp_A = A[index_A];\n bfloat16_t tmp_B = B[index_B];\n bfloat16_t tmp_C = C[index_C];\n float tmp_F = cast_to<float>(tmp_A);\n float tmp_G = Exp()(tmp_F);\n float tmp_H = Negative()(tmp_G);\n bfloat16_t tmp_I = cast_to<bfloat16_t>(tmp_B);\n bfloat16_t tmp_J = cast_to<bfloat16_t>(tmp_C);\n bfloat16_t tmp_K = Add()(tmp_I, tmp_J);\n bfloat16_t tmp_L = cast_to<bfloat16_t>(tmp_K);\n bfloat16_t tmp_M = cast_to<bfloat16_t>(tmp_E);\n bfloat16_t tmp_N = LogAddExp()(tmp_L, tmp_M);\n float tmp_O = cast_to<float>(tmp_N);\n float tmp_P = cast_to<float>(tmp_H);\n float tmp_Q = cast_to<float>(tmp_O);\n float tmp_R = Multiply()(tmp_P, tmp_Q);\n float tmp_D = Exp()(tmp_R);\n D[index] = tmp_D;\n index_A += in_strides[3];\n index_B += in_strides[7];\n index_C += in_strides[11];\n index++;\n }\n}\n[[host_name(\"Ef4IAsTypeAFf4IExpEGf4INegativeFHV2IBroadcastBCIV2IBroadcastCBJV2IAddHIKV2IBroadcastJDLV2IBroadcastDJMV2ILogAddExpKLNf4IAsTypeMOf4IBroadcastGNPf4IBroadcastNGQf4IMultiplyOPRf4OExpQ_VVVC_V2V2V2_10408321403207385874_strided_5\")]]\n[[kernel]] void Ef4IAsTypeAFf4IExpEGf4INegativeFHV2IBroadcastBCIV2IBroadcastCBJV2IAddHIKV2IBroadcastJDLV2IBroadcastDJMV2ILogAddExpKLNf4IAsTypeMOf4IBroadcastGNPf4IBroadcastNGQf4IMultiplyOPRf4OExpQ_VVVC_V2V2V2_10408321403207385874_strided_5(\n device const bfloat16_t* A [[buffer(0)]],\n device const bfloat16_t* B [[buffer(1)]],\n device const bfloat16_t* C [[buffer(2)]],\n constant const int64_t* in_strides [[buffer(3)]],\n device float* D [[buffer(4)]],\n constant const int* output_shape [[buffer(5)]],\n uint3 pos [[thread_position_in_grid]],\n uint3 grid [[threads_per_grid]]) {\n constexpr int N_ = 2;\n int xshape = output_shape[4];\n uint index = N_ * pos.x + xshape * (pos.y + uint(grid.y) * pos.z);\n auto tmp_E = static_cast<bfloat16_t>(0);\n uint index_A = N_ * pos.x * uint(in_strides[4]) + pos.y * uint(in_strides[3]);\n uint index_B = N_ * pos.x * uint(in_strides[9]) + pos.y * uint(in_strides[8]);\n uint index_C = N_ * pos.x * uint(in_strides[14]) + pos.y * uint(in_strides[13]);\n uint zpos = pos.z;\n for (int d = 2; d >= 0; --d) {\n uint l = zpos % output_shape[d];\n index_A += l * uint(in_strides[0 + d]);\n index_B += l * uint(in_strides[5 + d]);\n index_C += l * uint(in_strides[10 + d]);\n zpos /= output_shape[d];\n }\n for (int i = 0; i < N_ && (int(N_ * pos.x) + i) < xshape; ++i) {\n bfloat16_t tmp_A = A[index_A];\n bfloat16_t tmp_B = B[index_B];\n bfloat16_t tmp_C = C[index_C];\n float tmp_F = cast_to<float>(tmp_A);\n float tmp_G = Exp()(tmp_F);\n float tmp_H = Negative()(tmp_G);\n bfloat16_t tmp_I = cast_to<bfloat16_t>(tmp_B);\n bfloat16_t tmp_J = cast_to<bfloat16_t>(tmp_C);\n bfloat16_t tmp_K = Add()(tmp_I, tmp_J);\n bfloat16_t tmp_L = cast_to<bfloat16_t>(tmp_K);\n bfloat16_t tmp_M = cast_to<bfloat16_t>(tmp_E);\n bfloat16_t tmp_N = LogAddExp()(tmp_L, tmp_M);\n float tmp_O = cast_to<float>(tmp_N);\n float tmp_P = cast_to<float>(tmp_H);\n float tmp_Q = cast_to<float>(tmp_O);\n float tmp_R = Multiply()(tmp_P, tmp_Q);\n float tmp_D = Exp()(tmp_R);\n D[index] = tmp_D;\n index_A += in_strides[4];\n index_B += in_strides[9];\n index_C += in_strides[14];\n index++;\n }\n}\n[[host_name(\"Ef4IAsTypeAFf4IExpEGf4INegativeFHV2IBroadcastBCIV2IBroadcastCBJV2IAddHIKV2IBroadcastJDLV2IBroadcastDJMV2ILogAddExpKLNf4IAsTypeMOf4IBroadcastGNPf4IBroadcastNGQf4IMultiplyOPRf4OExpQ_VVVC_V2V2V2_10408321403207385874_strided_5_large\")]]\n[[kernel]] void Ef4IAsTypeAFf4IExpEGf4INegativeFHV2IBroadcastBCIV2IBroadcastCBJV2IAddHIKV2IBroadcastJDLV2IBroadcastDJMV2ILogAddExpKLNf4IAsTypeMOf4IBroadcastGNPf4IBroadcastNGQf4IMultiplyOPRf4OExpQ_VVVC_V2V2V2_10408321403207385874_strided_5_large(\n device const bfloat16_t* A [[buffer(0)]],\n device const bfloat16_t* B [[buffer(1)]],\n device const bfloat16_t* C [[buffer(2)]],\n constant const int64_t* in_strides [[buffer(3)]],\n device float* D [[buffer(4)]],\n constant const int* output_shape [[buffer(5)]],\n uint3 pos [[thread_position_in_grid]],\n uint3 grid [[threads_per_grid]]) {\n constexpr int N_ = 4;\n int xshape = output_shape[4];\n int64_t index = N_ * pos.x + xshape * (pos.y + int64_t(grid.y) * pos.z);\n auto tmp_E = static_cast<bfloat16_t>(0);\n int64_t index_A = N_ * pos.x * int64_t(in_strides[4]) + pos.y * int64_t(in_strides[3]);\n int64_t index_B = N_ * pos.x * int64_t(in_strides[9]) + pos.y * int64_t(in_strides[8]);\n int64_t index_C = N_ * pos.x * int64_t(in_strides[14]) + pos.y * int64_t(in_strides[13]);\n uint zpos = pos.z;\n for (int d = 2; d >= 0; --d) {\n uint l = zpos % output_shape[d];\n index_A += l * int64_t(in_strides[0 + d]);\n index_B += l * int64_t(in_strides[5 + d]);\n index_C += l * int64_t(in_strides[10 + d]);\n zpos /= output_shape[d];\n }\n for (int i = 0; i < N_ && (int(N_ * pos.x) + i) < xshape; ++i) {\n bfloat16_t tmp_A = A[index_A];\n bfloat16_t tmp_B = B[index_B];\n bfloat16_t tmp_C = C[index_C];\n float tmp_F = cast_to<float>(tmp_A);\n float tmp_G = Exp()(tmp_F);\n float tmp_H = Negative()(tmp_G);\n bfloat16_t tmp_I = cast_to<bfloat16_t>(tmp_B);\n bfloat16_t tmp_J = cast_to<bfloat16_t>(tmp_C);\n bfloat16_t tmp_K = Add()(tmp_I, tmp_J);\n bfloat16_t tmp_L = cast_to<bfloat16_t>(tmp_K);\n bfloat16_t tmp_M = cast_to<bfloat16_t>(tmp_E);\n bfloat16_t tmp_N = LogAddExp()(tmp_L, tmp_M);\n float tmp_O = cast_to<float>(tmp_N);\n float tmp_P = cast_to<float>(tmp_H);\n float tmp_Q = cast_to<float>(tmp_O);\n float tmp_R = Multiply()(tmp_P, tmp_Q);\n float tmp_D = Exp()(tmp_R);\n D[index] = tmp_D;\n index_A += in_strides[4];\n index_B += in_strides[9];\n index_C += in_strides[14];\n index++;\n }\n}\n[[host_name(\"Ef4IAsTypeAFf4IExpEGf4INegativeFHV2IBroadcastBCIV2IBroadcastCBJV2IAddHIKV2IBroadcastJDLV2IBroadcastDJMV2ILogAddExpKLNf4IAsTypeMOf4IBroadcastGNPf4IBroadcastNGQf4IMultiplyOPRf4OExpQ_VVVC_V2V2V2_10408321403207385874_strided_6\")]]\n[[kernel]] void Ef4IAsTypeAFf4IExpEGf4INegativeFHV2IBroadcastBCIV2IBroadcastCBJV2IAddHIKV2IBroadcastJDLV2IBroadcastDJMV2ILogAddExpKLNf4IAsTypeMOf4IBroadcastGNPf4IBroadcastNGQf4IMultiplyOPRf4OExpQ_VVVC_V2V2V2_10408321403207385874_strided_6(\n device const bfloat16_t* A [[buffer(0)]],\n device const bfloat16_t* B [[buffer(1)]],\n device const bfloat16_t* C [[buffer(2)]],\n constant const int64_t* in_strides [[buffer(3)]],\n device float* D [[buffer(4)]],\n constant const int* output_shape [[buffer(5)]],\n uint3 pos [[thread_position_in_grid]],\n uint3 grid [[threads_per_grid]]) {\n constexpr int N_ = 2;\n int xshape = output_shape[5];\n uint index = N_ * pos.x + xshape * (pos.y + uint(grid.y) * pos.z);\n auto tmp_E = static_cast<bfloat16_t>(0);\n uint index_A = N_ * pos.x * uint(in_strides[5]) + pos.y * uint(in_strides[4]);\n uint index_B = N_ * pos.x * uint(in_strides[11]) + pos.y * uint(in_strides[10]);\n uint index_C = N_ * pos.x * uint(in_strides[17]) + pos.y * uint(in_strides[16]);\n uint zpos = pos.z;\n for (int d = 3; d >= 0; --d) {\n uint l = zpos % output_shape[d];\n index_A += l * uint(in_strides[0 + d]);\n index_B += l * uint(in_strides[6 + d]);\n index_C += l * uint(in_strides[12 + d]);\n zpos /= output_shape[d];\n }\n for (int i = 0; i < N_ && (int(N_ * pos.x) + i) < xshape; ++i) {\n bfloat16_t tmp_A = A[index_A];\n bfloat16_t tmp_B = B[index_B];\n bfloat16_t tmp_C = C[index_C];\n float tmp_F = cast_to<float>(tmp_A);\n float tmp_G = Exp()(tmp_F);\n float tmp_H = Negative()(tmp_G);\n bfloat16_t tmp_I = cast_to<bfloat16_t>(tmp_B);\n bfloat16_t tmp_J = cast_to<bfloat16_t>(tmp_C);\n bfloat16_t tmp_K = Add()(tmp_I, tmp_J);\n bfloat16_t tmp_L = cast_to<bfloat16_t>(tmp_K);\n bfloat16_t tmp_M = cast_to<bfloat16_t>(tmp_E);\n bfloat16_t tmp_N = LogAddExp()(tmp_L, tmp_M);\n float tmp_O = cast_to<float>(tmp_N);\n float tmp_P = cast_to<float>(tmp_H);\n float tmp_Q = cast_to<float>(tmp_O);\n float tmp_R = Multiply()(tmp_P, tmp_Q);\n float tmp_D = Exp()(tmp_R);\n D[index] = tmp_D;\n index_A += in_strides[5];\n index_B += in_strides[11];\n index_C += in_strides[17];\n index++;\n }\n}\n[[host_name(\"Ef4IAsTypeAFf4IExpEGf4INegativeFHV2IBroadcastBCIV2IBroadcastCBJV2IAddHIKV2IBroadcastJDLV2IBroadcastDJMV2ILogAddExpKLNf4IAsTypeMOf4IBroadcastGNPf4IBroadcastNGQf4IMultiplyOPRf4OExpQ_VVVC_V2V2V2_10408321403207385874_strided_6_large\")]]\n[[kernel]] void Ef4IAsTypeAFf4IExpEGf4INegativeFHV2IBroadcastBCIV2IBroadcastCBJV2IAddHIKV2IBroadcastJDLV2IBroadcastDJMV2ILogAddExpKLNf4IAsTypeMOf4IBroadcastGNPf4IBroadcastNGQf4IMultiplyOPRf4OExpQ_VVVC_V2V2V2_10408321403207385874_strided_6_large(\n device const bfloat16_t* A [[buffer(0)]],\n device const bfloat16_t* B [[buffer(1)]],\n device const bfloat16_t* C [[buffer(2)]],\n constant const int64_t* in_strides [[buffer(3)]],\n device float* D [[buffer(4)]],\n constant const int* output_shape [[buffer(5)]],\n uint3 pos [[thread_position_in_grid]],\n uint3 grid [[threads_per_grid]]) {\n constexpr int N_ = 4;\n int xshape = output_shape[5];\n int64_t index = N_ * pos.x + xshape * (pos.y + int64_t(grid.y) * pos.z);\n auto tmp_E = static_cast<bfloat16_t>(0);\n int64_t index_A = N_ * pos.x * int64_t(in_strides[5]) + pos.y * int64_t(in_strides[4]);\n int64_t index_B = N_ * pos.x * int64_t(in_strides[11]) + pos.y * int64_t(in_strides[10]);\n int64_t index_C = N_ * pos.x * int64_t(in_strides[17]) + pos.y * int64_t(in_strides[16]);\n uint zpos = pos.z;\n for (int d = 3; d >= 0; --d) {\n uint l = zpos % output_shape[d];\n index_A += l * int64_t(in_strides[0 + d]);\n index_B += l * int64_t(in_strides[6 + d]);\n index_C += l * int64_t(in_strides[12 + d]);\n zpos /= output_shape[d];\n }\n for (int i = 0; i < N_ && (int(N_ * pos.x) + i) < xshape; ++i) {\n bfloat16_t tmp_A = A[index_A];\n bfloat16_t tmp_B = B[index_B];\n bfloat16_t tmp_C = C[index_C];\n float tmp_F = cast_to<float>(tmp_A);\n float tmp_G = Exp()(tmp_F);\n float tmp_H = Negative()(tmp_G);\n bfloat16_t tmp_I = cast_to<bfloat16_t>(tmp_B);\n bfloat16_t tmp_J = cast_to<bfloat16_t>(tmp_C);\n bfloat16_t tmp_K = Add()(tmp_I, tmp_J);\n bfloat16_t tmp_L = cast_to<bfloat16_t>(tmp_K);\n bfloat16_t tmp_M = cast_to<bfloat16_t>(tmp_E);\n bfloat16_t tmp_N = LogAddExp()(tmp_L, tmp_M);\n float tmp_O = cast_to<float>(tmp_N);\n float tmp_P = cast_to<float>(tmp_H);\n float tmp_Q = cast_to<float>(tmp_O);\n float tmp_R = Multiply()(tmp_P, tmp_Q);\n float tmp_D = Exp()(tmp_R);\n D[index] = tmp_D;\n index_A += in_strides[5];\n index_B += in_strides[11];\n index_C += in_strides[17];\n index++;\n }\n}\n[[host_name(\"Ef4IAsTypeAFf4IExpEGf4INegativeFHV2IBroadcastBCIV2IBroadcastCBJV2IAddHIKV2IBroadcastJDLV2IBroadcastDJMV2ILogAddExpKLNf4IAsTypeMOf4IBroadcastGNPf4IBroadcastNGQf4IMultiplyOPRf4OExpQ_VVVC_V2V2V2_10408321403207385874_strided_7\")]]\n[[kernel]] void Ef4IAsTypeAFf4IExpEGf4INegativeFHV2IBroadcastBCIV2IBroadcastCBJV2IAddHIKV2IBroadcastJDLV2IBroadcastDJMV2ILogAddExpKLNf4IAsTypeMOf4IBroadcastGNPf4IBroadcastNGQf4IMultiplyOPRf4OExpQ_VVVC_V2V2V2_10408321403207385874_strided_7(\n device const bfloat16_t* A [[buffer(0)]],\n device const bfloat16_t* B [[buffer(1)]],\n device const bfloat16_t* C [[buffer(2)]],\n constant const int64_t* in_strides [[buffer(3)]],\n device float* D [[buffer(4)]],\n constant const int* output_shape [[buffer(5)]],\n uint3 pos [[thread_position_in_grid]],\n uint3 grid [[threads_per_grid]]) {\n constexpr int N_ = 2;\n int xshape = output_shape[6];\n uint index = N_ * pos.x + xshape * (pos.y + uint(grid.y) * pos.z);\n auto tmp_E = static_cast<bfloat16_t>(0);\n uint index_A = N_ * pos.x * uint(in_strides[6]) + pos.y * uint(in_strides[5]);\n uint index_B = N_ * pos.x * uint(in_strides[13]) + pos.y * uint(in_strides[12]);\n uint index_C = N_ * pos.x * uint(in_strides[20]) + pos.y * uint(in_strides[19]);\n uint zpos = pos.z;\n for (int d = 4; d >= 0; --d) {\n uint l = zpos % output_shape[d];\n index_A += l * uint(in_strides[0 + d]);\n index_B += l * uint(in_strides[7 + d]);\n index_C += l * uint(in_strides[14 + d]);\n zpos /= output_shape[d];\n }\n for (int i = 0; i < N_ && (int(N_ * pos.x) + i) < xshape; ++i) {\n bfloat16_t tmp_A = A[index_A];\n bfloat16_t tmp_B = B[index_B];\n bfloat16_t tmp_C = C[index_C];\n float tmp_F = cast_to<float>(tmp_A);\n float tmp_G = Exp()(tmp_F);\n float tmp_H = Negative()(tmp_G);\n bfloat16_t tmp_I = cast_to<bfloat16_t>(tmp_B);\n bfloat16_t tmp_J = cast_to<bfloat16_t>(tmp_C);\n bfloat16_t tmp_K = Add()(tmp_I, tmp_J);\n bfloat16_t tmp_L = cast_to<bfloat16_t>(tmp_K);\n bfloat16_t tmp_M = cast_to<bfloat16_t>(tmp_E);\n bfloat16_t tmp_N = LogAddExp()(tmp_L, tmp_M);\n float tmp_O = cast_to<float>(tmp_N);\n float tmp_P = cast_to<float>(tmp_H);\n float tmp_Q = cast_to<float>(tmp_O);\n float tmp_R = Multiply()(tmp_P, tmp_Q);\n float tmp_D = Exp()(tmp_R);\n D[index] = tmp_D;\n index_A += in_strides[6];\n index_B += in_strides[13];\n index_C += in_strides[20];\n index++;\n }\n}\n[[host_name(\"Ef4IAsTypeAFf4IExpEGf4INegativeFHV2IBroadcastBCIV2IBroadcastCBJV2IAddHIKV2IBroadcastJDLV2IBroadcastDJMV2ILogAddExpKLNf4IAsTypeMOf4IBroadcastGNPf4IBroadcastNGQf4IMultiplyOPRf4OExpQ_VVVC_V2V2V2_10408321403207385874_strided_7_large\")]]\n[[kernel]] void Ef4IAsTypeAFf4IExpEGf4INegativeFHV2IBroadcastBCIV2IBroadcastCBJV2IAddHIKV2IBroadcastJDLV2IBroadcastDJMV2ILogAddExpKLNf4IAsTypeMOf4IBroadcastGNPf4IBroadcastNGQf4IMultiplyOPRf4OExpQ_VVVC_V2V2V2_10408321403207385874_strided_7_large(\n device const bfloat16_t* A [[buffer(0)]],\n device const bfloat16_t* B [[buffer(1)]],\n device const bfloat16_t* C [[buffer(2)]],\n constant const int64_t* in_strides [[buffer(3)]],\n device float* D [[buffer(4)]],\n constant const int* output_shape [[buffer(5)]],\n uint3 pos [[thread_position_in_grid]],\n uint3 grid [[threads_per_grid]]) {\n constexpr int N_ = 4;\n int xshape = output_shape[6];\n int64_t index = N_ * pos.x + xshape * (pos.y + int64_t(grid.y) * pos.z);\n auto tmp_E = static_cast<bfloat16_t>(0);\n int64_t index_A = N_ * pos.x * int64_t(in_strides[6]) + pos.y * int64_t(in_strides[5]);\n int64_t index_B = N_ * pos.x * int64_t(in_strides[13]) + pos.y * int64_t(in_strides[12]);\n int64_t index_C = N_ * pos.x * int64_t(in_strides[20]) + pos.y * int64_t(in_strides[19]);\n uint zpos = pos.z;\n for (int d = 4; d >= 0; --d) {\n uint l = zpos % output_shape[d];\n index_A += l * int64_t(in_strides[0 + d]);\n index_B += l * int64_t(in_strides[7 + d]);\n index_C += l * int64_t(in_strides[14 + d]);\n zpos /= output_shape[d];\n }\n for (int i = 0; i < N_ && (int(N_ * pos.x) + i) < xshape; ++i) {\n bfloat16_t tmp_A = A[index_A];\n bfloat16_t tmp_B = B[index_B];\n bfloat16_t tmp_C = C[index_C];\n float tmp_F = cast_to<float>(tmp_A);\n float tmp_G = Exp()(tmp_F);\n float tmp_H = Negative()(tmp_G);\n bfloat16_t tmp_I = cast_to<bfloat16_t>(tmp_B);\n bfloat16_t tmp_J = cast_to<bfloat16_t>(tmp_C);\n bfloat16_t tmp_K = Add()(tmp_I, tmp_J);\n bfloat16_t tmp_L = cast_to<bfloat16_t>(tmp_K);\n bfloat16_t tmp_M = cast_to<bfloat16_t>(tmp_E);\n bfloat16_t tmp_N = LogAddExp()(tmp_L, tmp_M);\n float tmp_O = cast_to<float>(tmp_N);\n float tmp_P = cast_to<float>(tmp_H);\n float tmp_Q = cast_to<float>(tmp_O);\n float tmp_R = Multiply()(tmp_P, tmp_Q);\n float tmp_D = Exp()(tmp_R);\n D[index] = tmp_D;\n index_A += in_strides[6];\n index_B += in_strides[13];\n index_C += in_strides[20];\n index++;\n }\n}\n[[host_name(\"Ef4IAsTypeAFf4IExpEGf4INegativeFHV2IBroadcastBCIV2IBroadcastCBJV2IAddHIKV2IBroadcastJDLV2IBroadcastDJMV2ILogAddExpKLNf4IAsTypeMOf4IBroadcastGNPf4IBroadcastNGQf4IMultiplyOPRf4OExpQ_VVVC_V2V2V2_10408321403207385874_strided_dynamic\")]]\n[[kernel]] void Ef4IAsTypeAFf4IExpEGf4INegativeFHV2IBroadcastBCIV2IBroadcastCBJV2IAddHIKV2IBroadcastJDLV2IBroadcastDJMV2ILogAddExpKLNf4IAsTypeMOf4IBroadcastGNPf4IBroadcastNGQf4IMultiplyOPRf4OExpQ_VVVC_V2V2V2_10408321403207385874_strided_dynamic(\n device const bfloat16_t* A [[buffer(0)]],\n device const bfloat16_t* B [[buffer(1)]],\n device const bfloat16_t* C [[buffer(2)]],\n constant const int64_t* in_strides [[buffer(3)]],\n device float* D [[buffer(4)]],\n constant const int* output_shape [[buffer(5)]],\n constant const int& ndim [[buffer(6)]],\n uint3 pos [[thread_position_in_grid]],\n uint3 grid [[threads_per_grid]]) {\n constexpr int N_ = 2;\n int xshape = output_shape[ndim - 1];\n uint index = N_ * pos.x + xshape * (pos.y + uint(grid.y) * pos.z);\n auto tmp_E = static_cast<bfloat16_t>(0);\n uint index_A = N_ * pos.x * uint(in_strides[ndim * 0 + ndim - 1]) + pos.y * uint(in_strides[ndim * 0 + ndim - 2]);\n uint index_B = N_ * pos.x * uint(in_strides[ndim * 1 + ndim - 1]) + pos.y * uint(in_strides[ndim * 1 + ndim - 2]);\n uint index_C = N_ * pos.x * uint(in_strides[ndim * 2 + ndim - 1]) + pos.y * uint(in_strides[ndim * 2 + ndim - 2]);\n uint zpos = pos.z;\n for (int d = ndim - 3; d >= 0; --d) {\n uint l = zpos % output_shape[d];\n index_A += l * uint(in_strides[0 * ndim + d]);\n index_B += l * uint(in_strides[1 * ndim + d]);\n index_C += l * uint(in_strides[2 * ndim + d]);\n zpos /= output_shape[d];\n }\n for (int i = 0; i < N_ && (int(N_ * pos.x) + i) < xshape; ++i) {\n bfloat16_t tmp_A = A[index_A];\n bfloat16_t tmp_B = B[index_B];\n bfloat16_t tmp_C = C[index_C];\n float tmp_F = cast_to<float>(tmp_A);\n float tmp_G = Exp()(tmp_F);\n float tmp_H = Negative()(tmp_G);\n bfloat16_t tmp_I = cast_to<bfloat16_t>(tmp_B);\n bfloat16_t tmp_J = cast_to<bfloat16_t>(tmp_C);\n bfloat16_t tmp_K = Add()(tmp_I, tmp_J);\n bfloat16_t tmp_L = cast_to<bfloat16_t>(tmp_K);\n bfloat16_t tmp_M = cast_to<bfloat16_t>(tmp_E);\n bfloat16_t tmp_N = LogAddExp()(tmp_L, tmp_M);\n float tmp_O = cast_to<float>(tmp_N);\n float tmp_P = cast_to<float>(tmp_H);\n float tmp_Q = cast_to<float>(tmp_O);\n float tmp_R = Multiply()(tmp_P, tmp_Q);\n float tmp_D = Exp()(tmp_R);\n D[index] = tmp_D;\n index_A += in_strides[0 * ndim + ndim - 1];\n index_B += in_strides[1 * ndim + ndim - 1];\n index_C += in_strides[2 * ndim + ndim - 1];\n index++;\n }\n}\n[[host_name(\"Ef4IAsTypeAFf4IExpEGf4INegativeFHV2IBroadcastBCIV2IBroadcastCBJV2IAddHIKV2IBroadcastJDLV2IBroadcastDJMV2ILogAddExpKLNf4IAsTypeMOf4IBroadcastGNPf4IBroadcastNGQf4IMultiplyOPRf4OExpQ_VVVC_V2V2V2_10408321403207385874_strided_dynamic_large\")]]\n[[kernel]] void Ef4IAsTypeAFf4IExpEGf4INegativeFHV2IBroadcastBCIV2IBroadcastCBJV2IAddHIKV2IBroadcastJDLV2IBroadcastDJMV2ILogAddExpKLNf4IAsTypeMOf4IBroadcastGNPf4IBroadcastNGQf4IMultiplyOPRf4OExpQ_VVVC_V2V2V2_10408321403207385874_strided_dynamic_large(\n device const bfloat16_t* A [[buffer(0)]],\n device const bfloat16_t* B [[buffer(1)]],\n device const bfloat16_t* C [[buffer(2)]],\n constant const int64_t* in_strides [[buffer(3)]],\n device float* D [[buffer(4)]],\n constant const int* output_shape [[buffer(5)]],\n constant const int& ndim [[buffer(6)]],\n uint3 pos [[thread_position_in_grid]],\n uint3 grid [[threads_per_grid]]) {\n constexpr int N_ = 4;\n int xshape = output_shape[ndim - 1];\n int64_t index = N_ * pos.x + xshape * (pos.y + int64_t(grid.y) * pos.z);\n auto tmp_E = static_cast<bfloat16_t>(0);\n int64_t index_A = N_ * pos.x * int64_t(in_strides[ndim * 0 + ndim - 1]) + pos.y * int64_t(in_strides[ndim * 0 + ndim - 2]);\n int64_t index_B = N_ * pos.x * int64_t(in_strides[ndim * 1 + ndim - 1]) + pos.y * int64_t(in_strides[ndim * 1 + ndim - 2]);\n int64_t index_C = N_ * pos.x * int64_t(in_strides[ndim * 2 + ndim - 1]) + pos.y * int64_t(in_strides[ndim * 2 + ndim - 2]);\n uint zpos = pos.z;\n for (int d = ndim - 3; d >= 0; --d) {\n uint l = zpos % output_shape[d];\n index_A += l * int64_t(in_strides[0 * ndim + d]);\n index_B += l * int64_t(in_strides[1 * ndim + d]);\n index_C += l * int64_t(in_strides[2 * ndim + d]);\n zpos /= output_shape[d];\n }\n for (int i = 0; i < N_ && (int(N_ * pos.x) + i) < xshape; ++i) {\n bfloat16_t tmp_A = A[index_A];\n bfloat16_t tmp_B = B[index_B];\n bfloat16_t tmp_C = C[index_C];\n float tmp_F = cast_to<float>(tmp_A);\n float tmp_G = Exp()(tmp_F);\n float tmp_H = Negative()(tmp_G);\n bfloat16_t tmp_I = cast_to<bfloat16_t>(tmp_B);\n bfloat16_t tmp_J = cast_to<bfloat16_t>(tmp_C);\n bfloat16_t tmp_K = Add()(tmp_I, tmp_J);\n bfloat16_t tmp_L = cast_to<bfloat16_t>(tmp_K);\n bfloat16_t tmp_M = cast_to<bfloat16_t>(tmp_E);\n bfloat16_t tmp_N = LogAddExp()(tmp_L, tmp_M);\n float tmp_O = cast_to<float>(tmp_N);\n float tmp_P = cast_to<float>(tmp_H);\n float tmp_Q = cast_to<float>(tmp_O);\n float tmp_R = Multiply()(tmp_P, tmp_Q);\n float tmp_D = Exp()(tmp_R);\n D[index] = tmp_D;\n index_A += in_strides[0 * ndim + ndim - 1];\n index_B += in_strides[1 * ndim + ndim - 1];\n index_C += in_strides[2 * ndim + ndim - 1];\n index++;\n }\n}\n"}