# AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _align as align
from torch import device, empty_strided
from torch._inductor.async_compile import AsyncCompile
from torch._inductor.select_algorithm import extern_kernels
from torch._inductor.codegen.multi_kernel import MultiKernelCall
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid, split_scan_grid, grid_combo_kernels, start_graph, end_graph
from torch._C import _cuda_getCurrentRawStream as get_raw_stream

aten = torch.ops.aten
inductor_ops = torch.ops.inductor
_quantized = torch.ops._quantized
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu
reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor
alloc_from_pool = torch.ops.inductor._alloc_from_pool
async_compile = AsyncCompile()


# kernel path: runs/run_shard_4/inductor_cache/rf/crf4dxzzztpnpsbe5tqyxtwblvnanasglxpd4kotnpzrxio4tyxt.py
# Topologically Sorted Source Nodes: [soft_assign_1], Original ATen: [aten._softmax]
# Source node to ATen node mapping:
#   soft_assign_1 => amax, exp, sub, sum_1
# Graph fragment:
#   %amax : [num_users=2] = call_function[target=torch.ops.aten.amax.default](args = (%view, [1], True), kwargs = {})
#   %sub : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%view, %amax), kwargs = {})
#   %exp : [num_users=2] = call_function[target=torch.ops.aten.exp.default](args = (%sub,), kwargs = {})
#   %sum_1 : [num_users=2] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%exp, [1], True), kwargs = {})
triton_per_fused__softmax_0 = async_compile.triton('triton_per_fused__softmax_0', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

from torch._inductor.runtime import triton_helpers, triton_heuristics
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, instance_descriptor, DeviceProperties

@triton_heuristics.persistent_reduction(
    size_hints=[64, 64],
    reduction_hint=ReductionHint.OUTER,
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: 'i32', 4: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 4), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_per_fused__softmax_0', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 1, 'num_reduction': 2, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False}
)
@triton.jit
def triton_per_fused__softmax_0(in_ptr0, out_ptr0, out_ptr1, xnumel, rnumel, XBLOCK : tl.constexpr):
    xnumel = 64
    rnumel = 64
    RBLOCK: tl.constexpr = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    rindex = tl.arange(0, RBLOCK)[None, :]
    roffset = 0
    rmask = tl.full([XBLOCK, RBLOCK], True, tl.int1)
    r2 = rindex
    x0 = xindex % 16
    x1 = (xindex // 16)
    x3 = xindex
    tmp0 = tl.load(in_ptr0 + (x0 + (16*r2) + (1024*x1)), xmask, other=0.0)
    tmp1 = tl.broadcast_to(tmp0, [XBLOCK, RBLOCK])
    tmp3 = tl.where(xmask, tmp1, float("-inf"))
    tmp4 = triton_helpers.max2(tmp3, 1)[:, None]
    tmp5 = tmp0 - tmp4
    tmp6 = tl_math.exp(tmp5)
    tmp7 = tl.broadcast_to(tmp6, [XBLOCK, RBLOCK])
    tmp9 = tl.where(xmask, tmp7, 0)
    tmp10 = tl.sum(tmp9, 1)[:, None]
    tl.store(out_ptr0 + (x3), tmp4, xmask)
    tl.store(out_ptr1 + (x3), tmp10, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/5d/c5d7kzlutdnexlvvxxhykl25ql7o3i5jbl47ltsdy3da45644hz6.py
# Topologically Sorted Source Nodes: [residual, residual_1, sum_1, residual_2, residual_3, sum_2, residual_4, residual_5, sum_3, residual_6, residual_7, sum_4, residual_8, residual_9, sum_5, residual_10, residual_11, sum_6, residual_12, residual_13, sum_7, residual_14, residual_15, sum_8, residual_16, residual_17, sum_9, residual_18, residual_19, sum_10, residual_20, residual_21, sum_11, residual_22, residual_23, sum_12, residual_24, residual_25, sum_13, residual_26, residual_27, sum_14, residual_28, residual_29, sum_15, residual_30, residual_31, sum_16, residual_32, residual_33, sum_17, residual_34, residual_35, sum_18, residual_36, residual_37, sum_19, residual_38, residual_39, sum_20, residual_40, residual_41, sum_21, residual_42, residual_43, sum_22, residual_44, residual_45, sum_23, residual_46, residual_47, sum_24, residual_48, residual_49, sum_25, residual_50, residual_51, sum_26, residual_52, residual_53, sum_27, residual_54, residual_55, sum_28, residual_56, residual_57, sum_29], Original ATen: [aten.sub, aten.mul, aten.sum]
# Source node to ATen node mapping:
#   residual => sub_1
#   residual_1 => mul
#   residual_10 => sub_6
#   residual_11 => mul_5
#   residual_12 => sub_7
#   residual_13 => mul_6
#   residual_14 => sub_8
#   residual_15 => mul_7
#   residual_16 => sub_9
#   residual_17 => mul_8
#   residual_18 => sub_10
#   residual_19 => mul_9
#   residual_2 => sub_2
#   residual_20 => sub_11
#   residual_21 => mul_10
#   residual_22 => sub_12
#   residual_23 => mul_11
#   residual_24 => sub_13
#   residual_25 => mul_12
#   residual_26 => sub_14
#   residual_27 => mul_13
#   residual_28 => sub_15
#   residual_29 => mul_14
#   residual_3 => mul_1
#   residual_30 => sub_16
#   residual_31 => mul_15
#   residual_32 => sub_17
#   residual_33 => mul_16
#   residual_34 => sub_18
#   residual_35 => mul_17
#   residual_36 => sub_19
#   residual_37 => mul_18
#   residual_38 => sub_20
#   residual_39 => mul_19
#   residual_4 => sub_3
#   residual_40 => sub_21
#   residual_41 => mul_20
#   residual_42 => sub_22
#   residual_43 => mul_21
#   residual_44 => sub_23
#   residual_45 => mul_22
#   residual_46 => sub_24
#   residual_47 => mul_23
#   residual_48 => sub_25
#   residual_49 => mul_24
#   residual_5 => mul_2
#   residual_50 => sub_26
#   residual_51 => mul_25
#   residual_52 => sub_27
#   residual_53 => mul_26
#   residual_54 => sub_28
#   residual_55 => mul_27
#   residual_56 => sub_29
#   residual_57 => mul_28
#   residual_6 => sub_4
#   residual_7 => mul_3
#   residual_8 => sub_5
#   residual_9 => mul_4
#   sum_1 => sum_2
#   sum_10 => sum_11
#   sum_11 => sum_12
#   sum_12 => sum_13
#   sum_13 => sum_14
#   sum_14 => sum_15
#   sum_15 => sum_16
#   sum_16 => sum_17
#   sum_17 => sum_18
#   sum_18 => sum_19
#   sum_19 => sum_20
#   sum_2 => sum_3
#   sum_20 => sum_21
#   sum_21 => sum_22
#   sum_22 => sum_23
#   sum_23 => sum_24
#   sum_24 => sum_25
#   sum_25 => sum_26
#   sum_26 => sum_27
#   sum_27 => sum_28
#   sum_28 => sum_29
#   sum_29 => sum_30
#   sum_3 => sum_4
#   sum_4 => sum_5
#   sum_5 => sum_6
#   sum_6 => sum_7
#   sum_7 => sum_8
#   sum_8 => sum_9
#   sum_9 => sum_10
# Graph fragment:
#   %sub_1 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_1), kwargs = {})
#   %mul : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_1, %unsqueeze_2), kwargs = {})
#   %sum_2 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul, [-1]), kwargs = {})
#   %sub_2 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_4), kwargs = {})
#   %mul_1 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_2, %unsqueeze_5), kwargs = {})
#   %sum_3 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_1, [-1]), kwargs = {})
#   %sub_3 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_7), kwargs = {})
#   %mul_2 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_3, %unsqueeze_8), kwargs = {})
#   %sum_4 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_2, [-1]), kwargs = {})
#   %sub_4 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_10), kwargs = {})
#   %mul_3 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_4, %unsqueeze_11), kwargs = {})
#   %sum_5 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_3, [-1]), kwargs = {})
#   %sub_5 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_13), kwargs = {})
#   %mul_4 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_5, %unsqueeze_14), kwargs = {})
#   %sum_6 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_4, [-1]), kwargs = {})
#   %sub_6 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_16), kwargs = {})
#   %mul_5 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_6, %unsqueeze_17), kwargs = {})
#   %sum_7 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_5, [-1]), kwargs = {})
#   %sub_7 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_19), kwargs = {})
#   %mul_6 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_7, %unsqueeze_20), kwargs = {})
#   %sum_8 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_6, [-1]), kwargs = {})
#   %sub_8 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_22), kwargs = {})
#   %mul_7 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_8, %unsqueeze_23), kwargs = {})
#   %sum_9 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_7, [-1]), kwargs = {})
#   %sub_9 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_25), kwargs = {})
#   %mul_8 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_9, %unsqueeze_26), kwargs = {})
#   %sum_10 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_8, [-1]), kwargs = {})
#   %sub_10 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_28), kwargs = {})
#   %mul_9 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_10, %unsqueeze_29), kwargs = {})
#   %sum_11 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_9, [-1]), kwargs = {})
#   %sub_11 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_31), kwargs = {})
#   %mul_10 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_11, %unsqueeze_32), kwargs = {})
#   %sum_12 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_10, [-1]), kwargs = {})
#   %sub_12 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_34), kwargs = {})
#   %mul_11 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_12, %unsqueeze_35), kwargs = {})
#   %sum_13 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_11, [-1]), kwargs = {})
#   %sub_13 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_37), kwargs = {})
#   %mul_12 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_13, %unsqueeze_38), kwargs = {})
#   %sum_14 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_12, [-1]), kwargs = {})
#   %sub_14 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_40), kwargs = {})
#   %mul_13 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_14, %unsqueeze_41), kwargs = {})
#   %sum_15 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_13, [-1]), kwargs = {})
#   %sub_15 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_43), kwargs = {})
#   %mul_14 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_15, %unsqueeze_44), kwargs = {})
#   %sum_16 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_14, [-1]), kwargs = {})
#   %sub_16 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_46), kwargs = {})
#   %mul_15 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_16, %unsqueeze_47), kwargs = {})
#   %sum_17 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_15, [-1]), kwargs = {})
#   %sub_17 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_49), kwargs = {})
#   %mul_16 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_17, %unsqueeze_50), kwargs = {})
#   %sum_18 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_16, [-1]), kwargs = {})
#   %sub_18 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_52), kwargs = {})
#   %mul_17 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_18, %unsqueeze_53), kwargs = {})
#   %sum_19 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_17, [-1]), kwargs = {})
#   %sub_19 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_55), kwargs = {})
#   %mul_18 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_19, %unsqueeze_56), kwargs = {})
#   %sum_20 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_18, [-1]), kwargs = {})
#   %sub_20 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_58), kwargs = {})
#   %mul_19 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_20, %unsqueeze_59), kwargs = {})
#   %sum_21 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_19, [-1]), kwargs = {})
#   %sub_21 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_61), kwargs = {})
#   %mul_20 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_21, %unsqueeze_62), kwargs = {})
#   %sum_22 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_20, [-1]), kwargs = {})
#   %sub_22 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_64), kwargs = {})
#   %mul_21 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_22, %unsqueeze_65), kwargs = {})
#   %sum_23 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_21, [-1]), kwargs = {})
#   %sub_23 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_67), kwargs = {})
#   %mul_22 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_23, %unsqueeze_68), kwargs = {})
#   %sum_24 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_22, [-1]), kwargs = {})
#   %sub_24 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_70), kwargs = {})
#   %mul_23 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_24, %unsqueeze_71), kwargs = {})
#   %sum_25 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_23, [-1]), kwargs = {})
#   %sub_25 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_73), kwargs = {})
#   %mul_24 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_25, %unsqueeze_74), kwargs = {})
#   %sum_26 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_24, [-1]), kwargs = {})
#   %sub_26 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_76), kwargs = {})
#   %mul_25 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_26, %unsqueeze_77), kwargs = {})
#   %sum_27 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_25, [-1]), kwargs = {})
#   %sub_27 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_79), kwargs = {})
#   %mul_26 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_27, %unsqueeze_80), kwargs = {})
#   %sum_28 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_26, [-1]), kwargs = {})
#   %sub_28 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_82), kwargs = {})
#   %mul_27 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_28, %unsqueeze_83), kwargs = {})
#   %sum_29 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_27, [-1]), kwargs = {})
#   %sub_29 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_85), kwargs = {})
#   %mul_28 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_29, %unsqueeze_86), kwargs = {})
#   %sum_30 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_28, [-1]), kwargs = {})
triton_per_fused_mul_sub_sum_1 = async_compile.triton('triton_per_fused_mul_sub_sum_1', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

from torch._inductor.runtime import triton_helpers, triton_heuristics
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, instance_descriptor, DeviceProperties

@triton_heuristics.persistent_reduction(
    size_hints=[16, 16],
    reduction_hint=ReductionHint.DEFAULT,
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: '*fp32', 5: '*fp32', 6: '*fp32', 7: '*fp32', 8: '*fp32', 9: '*fp32', 10: '*fp32', 11: '*fp32', 12: '*fp32', 13: '*fp32', 14: '*fp32', 15: '*fp32', 16: '*fp32', 17: '*fp32', 18: '*fp32', 19: '*fp32', 20: '*fp32', 21: '*fp32', 22: '*fp32', 23: '*fp32', 24: '*fp32', 25: '*fp32', 26: '*fp32', 27: '*fp32', 28: '*fp32', 29: '*fp32', 30: '*fp32', 31: '*fp32', 32: '*fp32', 33: '*fp32', 34: '*fp32', 35: '*fp32', 36: '*fp32', 37: '*fp32', 38: '*fp32', 39: '*fp32', 40: '*fp32', 41: '*fp32', 42: '*fp32', 43: '*fp32', 44: '*fp32', 45: '*fp32', 46: '*fp32', 47: '*fp32', 48: '*fp32', 49: '*fp32', 50: '*fp32', 51: '*fp32', 52: '*fp32', 53: '*fp32', 54: '*fp32', 55: '*fp32', 56: '*fp32', 57: '*fp32', 58: '*fp32', 59: '*fp32', 60: '*fp32', 61: '*fp32', 62: 'i32', 63: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 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, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_per_fused_mul_sub_sum_1', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 61, 'num_reduction': 29, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False}
)
@triton.jit
def triton_per_fused_mul_sub_sum_1(in_ptr0, in_ptr1, in_ptr2, in_ptr3, in_ptr4, out_ptr0, out_ptr1, out_ptr2, out_ptr3, out_ptr4, out_ptr5, out_ptr6, out_ptr7, out_ptr8, out_ptr9, out_ptr10, out_ptr11, out_ptr12, out_ptr13, out_ptr14, out_ptr15, out_ptr16, out_ptr17, out_ptr18, out_ptr19, out_ptr20, out_ptr21, out_ptr22, out_ptr23, out_ptr24, out_ptr25, out_ptr26, out_ptr27, out_ptr28, out_ptr29, out_ptr30, out_ptr31, out_ptr32, out_ptr33, out_ptr34, out_ptr35, out_ptr36, out_ptr37, out_ptr38, out_ptr39, out_ptr40, out_ptr41, out_ptr42, out_ptr43, out_ptr44, out_ptr45, out_ptr46, out_ptr47, out_ptr48, out_ptr49, out_ptr50, out_ptr51, out_ptr52, out_ptr53, out_ptr54, out_ptr55, out_ptr56, xnumel, rnumel, XBLOCK : tl.constexpr):
    xnumel = 16
    rnumel = 16
    RBLOCK: tl.constexpr = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    rindex = tl.arange(0, RBLOCK)[None, :]
    roffset = 0
    rmask = tl.full([XBLOCK, RBLOCK], True, tl.int1)
    r2 = rindex
    x3 = xindex
    x0 = xindex % 4
    x1 = (xindex // 4)
    tmp0 = tl.load(in_ptr0 + (r2 + (16*x3)), xmask, other=0.0)
    tmp1 = tl.load(in_ptr1 + (4 + x0), xmask, eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr1 + (8 + x0), xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr1 + (12 + x0), xmask, eviction_policy='evict_last')
    tmp7 = tl.load(in_ptr1 + (16 + x0), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr1 + (20 + x0), xmask, eviction_policy='evict_last')
    tmp11 = tl.load(in_ptr1 + (24 + x0), xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr1 + (28 + x0), xmask, eviction_policy='evict_last')
    tmp15 = tl.load(in_ptr1 + (32 + x0), xmask, eviction_policy='evict_last')
    tmp17 = tl.load(in_ptr1 + (36 + x0), xmask, eviction_policy='evict_last')
    tmp19 = tl.load(in_ptr1 + (40 + x0), xmask, eviction_policy='evict_last')
    tmp21 = tl.load(in_ptr1 + (44 + x0), xmask, eviction_policy='evict_last')
    tmp23 = tl.load(in_ptr1 + (48 + x0), xmask, eviction_policy='evict_last')
    tmp25 = tl.load(in_ptr1 + (52 + x0), xmask, eviction_policy='evict_last')
    tmp27 = tl.load(in_ptr1 + (56 + x0), xmask, eviction_policy='evict_last')
    tmp29 = tl.load(in_ptr1 + (60 + x0), xmask, eviction_policy='evict_last')
    tmp31 = tl.load(in_ptr1 + (64 + x0), xmask, eviction_policy='evict_last')
    tmp33 = tl.load(in_ptr1 + (68 + x0), xmask, eviction_policy='evict_last')
    tmp35 = tl.load(in_ptr1 + (72 + x0), xmask, eviction_policy='evict_last')
    tmp37 = tl.load(in_ptr1 + (76 + x0), xmask, eviction_policy='evict_last')
    tmp39 = tl.load(in_ptr1 + (80 + x0), xmask, eviction_policy='evict_last')
    tmp41 = tl.load(in_ptr1 + (84 + x0), xmask, eviction_policy='evict_last')
    tmp43 = tl.load(in_ptr1 + (88 + x0), xmask, eviction_policy='evict_last')
    tmp45 = tl.load(in_ptr1 + (92 + x0), xmask, eviction_policy='evict_last')
    tmp47 = tl.load(in_ptr1 + (96 + x0), xmask, eviction_policy='evict_last')
    tmp49 = tl.load(in_ptr1 + (100 + x0), xmask, eviction_policy='evict_last')
    tmp51 = tl.load(in_ptr1 + (104 + x0), xmask, eviction_policy='evict_last')
    tmp53 = tl.load(in_ptr1 + (108 + x0), xmask, eviction_policy='evict_last')
    tmp55 = tl.load(in_ptr1 + (112 + x0), xmask, eviction_policy='evict_last')
    tmp57 = tl.load(in_ptr1 + (x0), xmask, eviction_policy='evict_last')
    tmp59 = tl.load(in_ptr2 + (r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp60 = tl.load(in_ptr3 + (r2 + (16*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp63 = tl.load(in_ptr4 + (r2 + (16*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp70 = tl.load(in_ptr2 + (16 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp79 = tl.load(in_ptr2 + (32 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp88 = tl.load(in_ptr2 + (48 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp97 = tl.load(in_ptr2 + (64 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp106 = tl.load(in_ptr2 + (80 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp115 = tl.load(in_ptr2 + (96 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp124 = tl.load(in_ptr2 + (112 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp133 = tl.load(in_ptr2 + (128 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp142 = tl.load(in_ptr2 + (144 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp151 = tl.load(in_ptr2 + (160 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp160 = tl.load(in_ptr2 + (176 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp169 = tl.load(in_ptr2 + (192 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp178 = tl.load(in_ptr2 + (208 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp187 = tl.load(in_ptr2 + (224 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp196 = tl.load(in_ptr2 + (240 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp205 = tl.load(in_ptr2 + (256 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp214 = tl.load(in_ptr2 + (272 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp223 = tl.load(in_ptr2 + (288 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp232 = tl.load(in_ptr2 + (304 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp241 = tl.load(in_ptr2 + (320 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp250 = tl.load(in_ptr2 + (336 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp259 = tl.load(in_ptr2 + (352 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp268 = tl.load(in_ptr2 + (368 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp277 = tl.load(in_ptr2 + (384 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp286 = tl.load(in_ptr2 + (400 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp295 = tl.load(in_ptr2 + (416 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp304 = tl.load(in_ptr2 + (432 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp313 = tl.load(in_ptr2 + (448 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp2 = tmp0 - tmp1
    tmp4 = tmp0 - tmp3
    tmp6 = tmp0 - tmp5
    tmp8 = tmp0 - tmp7
    tmp10 = tmp0 - tmp9
    tmp12 = tmp0 - tmp11
    tmp14 = tmp0 - tmp13
    tmp16 = tmp0 - tmp15
    tmp18 = tmp0 - tmp17
    tmp20 = tmp0 - tmp19
    tmp22 = tmp0 - tmp21
    tmp24 = tmp0 - tmp23
    tmp26 = tmp0 - tmp25
    tmp28 = tmp0 - tmp27
    tmp30 = tmp0 - tmp29
    tmp32 = tmp0 - tmp31
    tmp34 = tmp0 - tmp33
    tmp36 = tmp0 - tmp35
    tmp38 = tmp0 - tmp37
    tmp40 = tmp0 - tmp39
    tmp42 = tmp0 - tmp41
    tmp44 = tmp0 - tmp43
    tmp46 = tmp0 - tmp45
    tmp48 = tmp0 - tmp47
    tmp50 = tmp0 - tmp49
    tmp52 = tmp0 - tmp51
    tmp54 = tmp0 - tmp53
    tmp56 = tmp0 - tmp55
    tmp58 = tmp0 - tmp57
    tmp61 = tmp59 - tmp60
    tmp62 = tl_math.exp(tmp61)
    tmp64 = tmp62 / tmp63
    tmp65 = tmp58 * tmp64
    tmp66 = tl.broadcast_to(tmp65, [XBLOCK, RBLOCK])
    tmp68 = tl.where(xmask, tmp66, 0)
    tmp69 = tl.sum(tmp68, 1)[:, None]
    tmp71 = tmp70 - tmp60
    tmp72 = tl_math.exp(tmp71)
    tmp73 = tmp72 / tmp63
    tmp74 = tmp2 * tmp73
    tmp75 = tl.broadcast_to(tmp74, [XBLOCK, RBLOCK])
    tmp77 = tl.where(xmask, tmp75, 0)
    tmp78 = tl.sum(tmp77, 1)[:, None]
    tmp80 = tmp79 - tmp60
    tmp81 = tl_math.exp(tmp80)
    tmp82 = tmp81 / tmp63
    tmp83 = tmp4 * tmp82
    tmp84 = tl.broadcast_to(tmp83, [XBLOCK, RBLOCK])
    tmp86 = tl.where(xmask, tmp84, 0)
    tmp87 = tl.sum(tmp86, 1)[:, None]
    tmp89 = tmp88 - tmp60
    tmp90 = tl_math.exp(tmp89)
    tmp91 = tmp90 / tmp63
    tmp92 = tmp6 * tmp91
    tmp93 = tl.broadcast_to(tmp92, [XBLOCK, RBLOCK])
    tmp95 = tl.where(xmask, tmp93, 0)
    tmp96 = tl.sum(tmp95, 1)[:, None]
    tmp98 = tmp97 - tmp60
    tmp99 = tl_math.exp(tmp98)
    tmp100 = tmp99 / tmp63
    tmp101 = tmp8 * tmp100
    tmp102 = tl.broadcast_to(tmp101, [XBLOCK, RBLOCK])
    tmp104 = tl.where(xmask, tmp102, 0)
    tmp105 = tl.sum(tmp104, 1)[:, None]
    tmp107 = tmp106 - tmp60
    tmp108 = tl_math.exp(tmp107)
    tmp109 = tmp108 / tmp63
    tmp110 = tmp10 * tmp109
    tmp111 = tl.broadcast_to(tmp110, [XBLOCK, RBLOCK])
    tmp113 = tl.where(xmask, tmp111, 0)
    tmp114 = tl.sum(tmp113, 1)[:, None]
    tmp116 = tmp115 - tmp60
    tmp117 = tl_math.exp(tmp116)
    tmp118 = tmp117 / tmp63
    tmp119 = tmp12 * tmp118
    tmp120 = tl.broadcast_to(tmp119, [XBLOCK, RBLOCK])
    tmp122 = tl.where(xmask, tmp120, 0)
    tmp123 = tl.sum(tmp122, 1)[:, None]
    tmp125 = tmp124 - tmp60
    tmp126 = tl_math.exp(tmp125)
    tmp127 = tmp126 / tmp63
    tmp128 = tmp14 * tmp127
    tmp129 = tl.broadcast_to(tmp128, [XBLOCK, RBLOCK])
    tmp131 = tl.where(xmask, tmp129, 0)
    tmp132 = tl.sum(tmp131, 1)[:, None]
    tmp134 = tmp133 - tmp60
    tmp135 = tl_math.exp(tmp134)
    tmp136 = tmp135 / tmp63
    tmp137 = tmp16 * tmp136
    tmp138 = tl.broadcast_to(tmp137, [XBLOCK, RBLOCK])
    tmp140 = tl.where(xmask, tmp138, 0)
    tmp141 = tl.sum(tmp140, 1)[:, None]
    tmp143 = tmp142 - tmp60
    tmp144 = tl_math.exp(tmp143)
    tmp145 = tmp144 / tmp63
    tmp146 = tmp18 * tmp145
    tmp147 = tl.broadcast_to(tmp146, [XBLOCK, RBLOCK])
    tmp149 = tl.where(xmask, tmp147, 0)
    tmp150 = tl.sum(tmp149, 1)[:, None]
    tmp152 = tmp151 - tmp60
    tmp153 = tl_math.exp(tmp152)
    tmp154 = tmp153 / tmp63
    tmp155 = tmp20 * tmp154
    tmp156 = tl.broadcast_to(tmp155, [XBLOCK, RBLOCK])
    tmp158 = tl.where(xmask, tmp156, 0)
    tmp159 = tl.sum(tmp158, 1)[:, None]
    tmp161 = tmp160 - tmp60
    tmp162 = tl_math.exp(tmp161)
    tmp163 = tmp162 / tmp63
    tmp164 = tmp22 * tmp163
    tmp165 = tl.broadcast_to(tmp164, [XBLOCK, RBLOCK])
    tmp167 = tl.where(xmask, tmp165, 0)
    tmp168 = tl.sum(tmp167, 1)[:, None]
    tmp170 = tmp169 - tmp60
    tmp171 = tl_math.exp(tmp170)
    tmp172 = tmp171 / tmp63
    tmp173 = tmp24 * tmp172
    tmp174 = tl.broadcast_to(tmp173, [XBLOCK, RBLOCK])
    tmp176 = tl.where(xmask, tmp174, 0)
    tmp177 = tl.sum(tmp176, 1)[:, None]
    tmp179 = tmp178 - tmp60
    tmp180 = tl_math.exp(tmp179)
    tmp181 = tmp180 / tmp63
    tmp182 = tmp26 * tmp181
    tmp183 = tl.broadcast_to(tmp182, [XBLOCK, RBLOCK])
    tmp185 = tl.where(xmask, tmp183, 0)
    tmp186 = tl.sum(tmp185, 1)[:, None]
    tmp188 = tmp187 - tmp60
    tmp189 = tl_math.exp(tmp188)
    tmp190 = tmp189 / tmp63
    tmp191 = tmp28 * tmp190
    tmp192 = tl.broadcast_to(tmp191, [XBLOCK, RBLOCK])
    tmp194 = tl.where(xmask, tmp192, 0)
    tmp195 = tl.sum(tmp194, 1)[:, None]
    tmp197 = tmp196 - tmp60
    tmp198 = tl_math.exp(tmp197)
    tmp199 = tmp198 / tmp63
    tmp200 = tmp30 * tmp199
    tmp201 = tl.broadcast_to(tmp200, [XBLOCK, RBLOCK])
    tmp203 = tl.where(xmask, tmp201, 0)
    tmp204 = tl.sum(tmp203, 1)[:, None]
    tmp206 = tmp205 - tmp60
    tmp207 = tl_math.exp(tmp206)
    tmp208 = tmp207 / tmp63
    tmp209 = tmp32 * tmp208
    tmp210 = tl.broadcast_to(tmp209, [XBLOCK, RBLOCK])
    tmp212 = tl.where(xmask, tmp210, 0)
    tmp213 = tl.sum(tmp212, 1)[:, None]
    tmp215 = tmp214 - tmp60
    tmp216 = tl_math.exp(tmp215)
    tmp217 = tmp216 / tmp63
    tmp218 = tmp34 * tmp217
    tmp219 = tl.broadcast_to(tmp218, [XBLOCK, RBLOCK])
    tmp221 = tl.where(xmask, tmp219, 0)
    tmp222 = tl.sum(tmp221, 1)[:, None]
    tmp224 = tmp223 - tmp60
    tmp225 = tl_math.exp(tmp224)
    tmp226 = tmp225 / tmp63
    tmp227 = tmp36 * tmp226
    tmp228 = tl.broadcast_to(tmp227, [XBLOCK, RBLOCK])
    tmp230 = tl.where(xmask, tmp228, 0)
    tmp231 = tl.sum(tmp230, 1)[:, None]
    tmp233 = tmp232 - tmp60
    tmp234 = tl_math.exp(tmp233)
    tmp235 = tmp234 / tmp63
    tmp236 = tmp38 * tmp235
    tmp237 = tl.broadcast_to(tmp236, [XBLOCK, RBLOCK])
    tmp239 = tl.where(xmask, tmp237, 0)
    tmp240 = tl.sum(tmp239, 1)[:, None]
    tmp242 = tmp241 - tmp60
    tmp243 = tl_math.exp(tmp242)
    tmp244 = tmp243 / tmp63
    tmp245 = tmp40 * tmp244
    tmp246 = tl.broadcast_to(tmp245, [XBLOCK, RBLOCK])
    tmp248 = tl.where(xmask, tmp246, 0)
    tmp249 = tl.sum(tmp248, 1)[:, None]
    tmp251 = tmp250 - tmp60
    tmp252 = tl_math.exp(tmp251)
    tmp253 = tmp252 / tmp63
    tmp254 = tmp42 * tmp253
    tmp255 = tl.broadcast_to(tmp254, [XBLOCK, RBLOCK])
    tmp257 = tl.where(xmask, tmp255, 0)
    tmp258 = tl.sum(tmp257, 1)[:, None]
    tmp260 = tmp259 - tmp60
    tmp261 = tl_math.exp(tmp260)
    tmp262 = tmp261 / tmp63
    tmp263 = tmp44 * tmp262
    tmp264 = tl.broadcast_to(tmp263, [XBLOCK, RBLOCK])
    tmp266 = tl.where(xmask, tmp264, 0)
    tmp267 = tl.sum(tmp266, 1)[:, None]
    tmp269 = tmp268 - tmp60
    tmp270 = tl_math.exp(tmp269)
    tmp271 = tmp270 / tmp63
    tmp272 = tmp46 * tmp271
    tmp273 = tl.broadcast_to(tmp272, [XBLOCK, RBLOCK])
    tmp275 = tl.where(xmask, tmp273, 0)
    tmp276 = tl.sum(tmp275, 1)[:, None]
    tmp278 = tmp277 - tmp60
    tmp279 = tl_math.exp(tmp278)
    tmp280 = tmp279 / tmp63
    tmp281 = tmp48 * tmp280
    tmp282 = tl.broadcast_to(tmp281, [XBLOCK, RBLOCK])
    tmp284 = tl.where(xmask, tmp282, 0)
    tmp285 = tl.sum(tmp284, 1)[:, None]
    tmp287 = tmp286 - tmp60
    tmp288 = tl_math.exp(tmp287)
    tmp289 = tmp288 / tmp63
    tmp290 = tmp50 * tmp289
    tmp291 = tl.broadcast_to(tmp290, [XBLOCK, RBLOCK])
    tmp293 = tl.where(xmask, tmp291, 0)
    tmp294 = tl.sum(tmp293, 1)[:, None]
    tmp296 = tmp295 - tmp60
    tmp297 = tl_math.exp(tmp296)
    tmp298 = tmp297 / tmp63
    tmp299 = tmp52 * tmp298
    tmp300 = tl.broadcast_to(tmp299, [XBLOCK, RBLOCK])
    tmp302 = tl.where(xmask, tmp300, 0)
    tmp303 = tl.sum(tmp302, 1)[:, None]
    tmp305 = tmp304 - tmp60
    tmp306 = tl_math.exp(tmp305)
    tmp307 = tmp306 / tmp63
    tmp308 = tmp54 * tmp307
    tmp309 = tl.broadcast_to(tmp308, [XBLOCK, RBLOCK])
    tmp311 = tl.where(xmask, tmp309, 0)
    tmp312 = tl.sum(tmp311, 1)[:, None]
    tmp314 = tmp313 - tmp60
    tmp315 = tl_math.exp(tmp314)
    tmp316 = tmp315 / tmp63
    tmp317 = tmp56 * tmp316
    tmp318 = tl.broadcast_to(tmp317, [XBLOCK, RBLOCK])
    tmp320 = tl.where(xmask, tmp318, 0)
    tmp321 = tl.sum(tmp320, 1)[:, None]
    tl.store(out_ptr0 + (r2 + (16*x3)), tmp2, xmask)
    tl.store(out_ptr1 + (r2 + (16*x3)), tmp4, xmask)
    tl.store(out_ptr2 + (r2 + (16*x3)), tmp6, xmask)
    tl.store(out_ptr3 + (r2 + (16*x3)), tmp8, xmask)
    tl.store(out_ptr4 + (r2 + (16*x3)), tmp10, xmask)
    tl.store(out_ptr5 + (r2 + (16*x3)), tmp12, xmask)
    tl.store(out_ptr6 + (r2 + (16*x3)), tmp14, xmask)
    tl.store(out_ptr7 + (r2 + (16*x3)), tmp16, xmask)
    tl.store(out_ptr8 + (r2 + (16*x3)), tmp18, xmask)
    tl.store(out_ptr9 + (r2 + (16*x3)), tmp20, xmask)
    tl.store(out_ptr10 + (r2 + (16*x3)), tmp22, xmask)
    tl.store(out_ptr11 + (r2 + (16*x3)), tmp24, xmask)
    tl.store(out_ptr12 + (r2 + (16*x3)), tmp26, xmask)
    tl.store(out_ptr13 + (r2 + (16*x3)), tmp28, xmask)
    tl.store(out_ptr14 + (r2 + (16*x3)), tmp30, xmask)
    tl.store(out_ptr15 + (r2 + (16*x3)), tmp32, xmask)
    tl.store(out_ptr16 + (r2 + (16*x3)), tmp34, xmask)
    tl.store(out_ptr17 + (r2 + (16*x3)), tmp36, xmask)
    tl.store(out_ptr18 + (r2 + (16*x3)), tmp38, xmask)
    tl.store(out_ptr19 + (r2 + (16*x3)), tmp40, xmask)
    tl.store(out_ptr20 + (r2 + (16*x3)), tmp42, xmask)
    tl.store(out_ptr21 + (r2 + (16*x3)), tmp44, xmask)
    tl.store(out_ptr22 + (r2 + (16*x3)), tmp46, xmask)
    tl.store(out_ptr23 + (r2 + (16*x3)), tmp48, xmask)
    tl.store(out_ptr24 + (r2 + (16*x3)), tmp50, xmask)
    tl.store(out_ptr25 + (r2 + (16*x3)), tmp52, xmask)
    tl.store(out_ptr26 + (r2 + (16*x3)), tmp54, xmask)
    tl.store(out_ptr27 + (r2 + (16*x3)), tmp56, xmask)
    tl.store(out_ptr28 + (x3), tmp69, xmask)
    tl.store(out_ptr29 + (x3), tmp78, xmask)
    tl.store(out_ptr30 + (x3), tmp87, xmask)
    tl.store(out_ptr31 + (x3), tmp96, xmask)
    tl.store(out_ptr32 + (x3), tmp105, xmask)
    tl.store(out_ptr33 + (x3), tmp114, xmask)
    tl.store(out_ptr34 + (x3), tmp123, xmask)
    tl.store(out_ptr35 + (x3), tmp132, xmask)
    tl.store(out_ptr36 + (x3), tmp141, xmask)
    tl.store(out_ptr37 + (x3), tmp150, xmask)
    tl.store(out_ptr38 + (x3), tmp159, xmask)
    tl.store(out_ptr39 + (x3), tmp168, xmask)
    tl.store(out_ptr40 + (x3), tmp177, xmask)
    tl.store(out_ptr41 + (x3), tmp186, xmask)
    tl.store(out_ptr42 + (x3), tmp195, xmask)
    tl.store(out_ptr43 + (x3), tmp204, xmask)
    tl.store(out_ptr44 + (x3), tmp213, xmask)
    tl.store(out_ptr45 + (x3), tmp222, xmask)
    tl.store(out_ptr46 + (x3), tmp231, xmask)
    tl.store(out_ptr47 + (x3), tmp240, xmask)
    tl.store(out_ptr48 + (x3), tmp249, xmask)
    tl.store(out_ptr49 + (x3), tmp258, xmask)
    tl.store(out_ptr50 + (x3), tmp267, xmask)
    tl.store(out_ptr51 + (x3), tmp276, xmask)
    tl.store(out_ptr52 + (x3), tmp285, xmask)
    tl.store(out_ptr53 + (x3), tmp294, xmask)
    tl.store(out_ptr54 + (x3), tmp303, xmask)
    tl.store(out_ptr55 + (x3), tmp312, xmask)
    tl.store(out_ptr56 + (x3), tmp321, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/pc/cpc4rilvtd5w4yagyevfs2h753octnb56qd5zek3pkk2r4jika3b.py
# Topologically Sorted Source Nodes: [residual_58, residual_59, sum_30, residual_60, residual_61, sum_31, residual_62, residual_63, sum_32, residual_64, residual_65, sum_33, residual_66, residual_67, sum_34, residual_68, residual_69, sum_35, residual_70, residual_71, sum_36, residual_72, residual_73, sum_37, residual_74, residual_75, sum_38, residual_76, residual_77, sum_39, residual_78, residual_79, sum_40, residual_80, residual_81, sum_41, residual_82, residual_83, sum_42, residual_84, residual_85, sum_43, residual_86, residual_87, sum_44, residual_88, residual_89, sum_45, residual_90, residual_91, sum_46, residual_92, residual_93, sum_47, residual_94, residual_95, sum_48, residual_96, residual_97, sum_49, residual_98, residual_99, sum_50, residual_100, residual_101, sum_51, residual_102, residual_103, sum_52, residual_104, residual_105, sum_53, residual_106, residual_107, sum_54, residual_108, residual_109, sum_55, residual_110, residual_111, sum_56, residual_112, residual_113, sum_57], Original ATen: [aten.sub, aten.mul, aten.sum]
# Source node to ATen node mapping:
#   residual_100 => sub_51
#   residual_101 => mul_50
#   residual_102 => sub_52
#   residual_103 => mul_51
#   residual_104 => sub_53
#   residual_105 => mul_52
#   residual_106 => sub_54
#   residual_107 => mul_53
#   residual_108 => sub_55
#   residual_109 => mul_54
#   residual_110 => sub_56
#   residual_111 => mul_55
#   residual_112 => sub_57
#   residual_113 => mul_56
#   residual_58 => sub_30
#   residual_59 => mul_29
#   residual_60 => sub_31
#   residual_61 => mul_30
#   residual_62 => sub_32
#   residual_63 => mul_31
#   residual_64 => sub_33
#   residual_65 => mul_32
#   residual_66 => sub_34
#   residual_67 => mul_33
#   residual_68 => sub_35
#   residual_69 => mul_34
#   residual_70 => sub_36
#   residual_71 => mul_35
#   residual_72 => sub_37
#   residual_73 => mul_36
#   residual_74 => sub_38
#   residual_75 => mul_37
#   residual_76 => sub_39
#   residual_77 => mul_38
#   residual_78 => sub_40
#   residual_79 => mul_39
#   residual_80 => sub_41
#   residual_81 => mul_40
#   residual_82 => sub_42
#   residual_83 => mul_41
#   residual_84 => sub_43
#   residual_85 => mul_42
#   residual_86 => sub_44
#   residual_87 => mul_43
#   residual_88 => sub_45
#   residual_89 => mul_44
#   residual_90 => sub_46
#   residual_91 => mul_45
#   residual_92 => sub_47
#   residual_93 => mul_46
#   residual_94 => sub_48
#   residual_95 => mul_47
#   residual_96 => sub_49
#   residual_97 => mul_48
#   residual_98 => sub_50
#   residual_99 => mul_49
#   sum_30 => sum_31
#   sum_31 => sum_32
#   sum_32 => sum_33
#   sum_33 => sum_34
#   sum_34 => sum_35
#   sum_35 => sum_36
#   sum_36 => sum_37
#   sum_37 => sum_38
#   sum_38 => sum_39
#   sum_39 => sum_40
#   sum_40 => sum_41
#   sum_41 => sum_42
#   sum_42 => sum_43
#   sum_43 => sum_44
#   sum_44 => sum_45
#   sum_45 => sum_46
#   sum_46 => sum_47
#   sum_47 => sum_48
#   sum_48 => sum_49
#   sum_49 => sum_50
#   sum_50 => sum_51
#   sum_51 => sum_52
#   sum_52 => sum_53
#   sum_53 => sum_54
#   sum_54 => sum_55
#   sum_55 => sum_56
#   sum_56 => sum_57
#   sum_57 => sum_58
# Graph fragment:
#   %sub_30 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_88), kwargs = {})
#   %mul_29 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_30, %unsqueeze_89), kwargs = {})
#   %sum_31 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_29, [-1]), kwargs = {})
#   %sub_31 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_91), kwargs = {})
#   %mul_30 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_31, %unsqueeze_92), kwargs = {})
#   %sum_32 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_30, [-1]), kwargs = {})
#   %sub_32 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_94), kwargs = {})
#   %mul_31 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_32, %unsqueeze_95), kwargs = {})
#   %sum_33 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_31, [-1]), kwargs = {})
#   %sub_33 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_97), kwargs = {})
#   %mul_32 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_33, %unsqueeze_98), kwargs = {})
#   %sum_34 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_32, [-1]), kwargs = {})
#   %sub_34 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_100), kwargs = {})
#   %mul_33 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_34, %unsqueeze_101), kwargs = {})
#   %sum_35 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_33, [-1]), kwargs = {})
#   %sub_35 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_103), kwargs = {})
#   %mul_34 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_35, %unsqueeze_104), kwargs = {})
#   %sum_36 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_34, [-1]), kwargs = {})
#   %sub_36 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_106), kwargs = {})
#   %mul_35 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_36, %unsqueeze_107), kwargs = {})
#   %sum_37 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_35, [-1]), kwargs = {})
#   %sub_37 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_109), kwargs = {})
#   %mul_36 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_37, %unsqueeze_110), kwargs = {})
#   %sum_38 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_36, [-1]), kwargs = {})
#   %sub_38 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_112), kwargs = {})
#   %mul_37 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_38, %unsqueeze_113), kwargs = {})
#   %sum_39 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_37, [-1]), kwargs = {})
#   %sub_39 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_115), kwargs = {})
#   %mul_38 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_39, %unsqueeze_116), kwargs = {})
#   %sum_40 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_38, [-1]), kwargs = {})
#   %sub_40 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_118), kwargs = {})
#   %mul_39 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_40, %unsqueeze_119), kwargs = {})
#   %sum_41 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_39, [-1]), kwargs = {})
#   %sub_41 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_121), kwargs = {})
#   %mul_40 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_41, %unsqueeze_122), kwargs = {})
#   %sum_42 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_40, [-1]), kwargs = {})
#   %sub_42 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_124), kwargs = {})
#   %mul_41 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_42, %unsqueeze_125), kwargs = {})
#   %sum_43 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_41, [-1]), kwargs = {})
#   %sub_43 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_127), kwargs = {})
#   %mul_42 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_43, %unsqueeze_128), kwargs = {})
#   %sum_44 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_42, [-1]), kwargs = {})
#   %sub_44 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_130), kwargs = {})
#   %mul_43 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_44, %unsqueeze_131), kwargs = {})
#   %sum_45 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_43, [-1]), kwargs = {})
#   %sub_45 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_133), kwargs = {})
#   %mul_44 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_45, %unsqueeze_134), kwargs = {})
#   %sum_46 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_44, [-1]), kwargs = {})
#   %sub_46 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_136), kwargs = {})
#   %mul_45 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_46, %unsqueeze_137), kwargs = {})
#   %sum_47 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_45, [-1]), kwargs = {})
#   %sub_47 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_139), kwargs = {})
#   %mul_46 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_47, %unsqueeze_140), kwargs = {})
#   %sum_48 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_46, [-1]), kwargs = {})
#   %sub_48 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_142), kwargs = {})
#   %mul_47 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_48, %unsqueeze_143), kwargs = {})
#   %sum_49 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_47, [-1]), kwargs = {})
#   %sub_49 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_145), kwargs = {})
#   %mul_48 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_49, %unsqueeze_146), kwargs = {})
#   %sum_50 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_48, [-1]), kwargs = {})
#   %sub_50 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_148), kwargs = {})
#   %mul_49 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_50, %unsqueeze_149), kwargs = {})
#   %sum_51 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_49, [-1]), kwargs = {})
#   %sub_51 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_151), kwargs = {})
#   %mul_50 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_51, %unsqueeze_152), kwargs = {})
#   %sum_52 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_50, [-1]), kwargs = {})
#   %sub_52 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_154), kwargs = {})
#   %mul_51 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_52, %unsqueeze_155), kwargs = {})
#   %sum_53 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_51, [-1]), kwargs = {})
#   %sub_53 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_157), kwargs = {})
#   %mul_52 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_53, %unsqueeze_158), kwargs = {})
#   %sum_54 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_52, [-1]), kwargs = {})
#   %sub_54 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_160), kwargs = {})
#   %mul_53 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_54, %unsqueeze_161), kwargs = {})
#   %sum_55 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_53, [-1]), kwargs = {})
#   %sub_55 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_163), kwargs = {})
#   %mul_54 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_55, %unsqueeze_164), kwargs = {})
#   %sum_56 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_54, [-1]), kwargs = {})
#   %sub_56 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_166), kwargs = {})
#   %mul_55 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_56, %unsqueeze_167), kwargs = {})
#   %sum_57 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_55, [-1]), kwargs = {})
#   %sub_57 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_169), kwargs = {})
#   %mul_56 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_57, %unsqueeze_170), kwargs = {})
#   %sum_58 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_56, [-1]), kwargs = {})
triton_per_fused_mul_sub_sum_2 = async_compile.triton('triton_per_fused_mul_sub_sum_2', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

from torch._inductor.runtime import triton_helpers, triton_heuristics
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, instance_descriptor, DeviceProperties

@triton_heuristics.persistent_reduction(
    size_hints=[16, 16],
    reduction_hint=ReductionHint.DEFAULT,
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: '*fp32', 5: '*fp32', 6: '*fp32', 7: '*fp32', 8: '*fp32', 9: '*fp32', 10: '*fp32', 11: '*fp32', 12: '*fp32', 13: '*fp32', 14: '*fp32', 15: '*fp32', 16: '*fp32', 17: '*fp32', 18: '*fp32', 19: '*fp32', 20: '*fp32', 21: '*fp32', 22: '*fp32', 23: '*fp32', 24: '*fp32', 25: '*fp32', 26: '*fp32', 27: '*fp32', 28: '*fp32', 29: '*fp32', 30: '*fp32', 31: '*fp32', 32: '*fp32', 33: '*fp32', 34: '*fp32', 35: '*fp32', 36: '*fp32', 37: '*fp32', 38: '*fp32', 39: '*fp32', 40: '*fp32', 41: '*fp32', 42: '*fp32', 43: '*fp32', 44: '*fp32', 45: '*fp32', 46: '*fp32', 47: '*fp32', 48: '*fp32', 49: '*fp32', 50: '*fp32', 51: '*fp32', 52: '*fp32', 53: '*fp32', 54: '*fp32', 55: '*fp32', 56: '*fp32', 57: '*fp32', 58: '*fp32', 59: '*fp32', 60: '*fp32', 61: 'i32', 62: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 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, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_per_fused_mul_sub_sum_2', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 59, 'num_reduction': 28, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False}
)
@triton.jit
def triton_per_fused_mul_sub_sum_2(in_ptr0, in_ptr1, in_ptr2, in_ptr3, in_ptr4, out_ptr0, out_ptr1, out_ptr2, out_ptr3, out_ptr4, out_ptr5, out_ptr6, out_ptr7, out_ptr8, out_ptr9, out_ptr10, out_ptr11, out_ptr12, out_ptr13, out_ptr14, out_ptr15, out_ptr16, out_ptr17, out_ptr18, out_ptr19, out_ptr20, out_ptr21, out_ptr22, out_ptr23, out_ptr24, out_ptr25, out_ptr26, out_ptr27, out_ptr28, out_ptr29, out_ptr30, out_ptr31, out_ptr32, out_ptr33, out_ptr34, out_ptr35, out_ptr36, out_ptr37, out_ptr38, out_ptr39, out_ptr40, out_ptr41, out_ptr42, out_ptr43, out_ptr44, out_ptr45, out_ptr46, out_ptr47, out_ptr48, out_ptr49, out_ptr50, out_ptr51, out_ptr52, out_ptr53, out_ptr54, out_ptr55, xnumel, rnumel, XBLOCK : tl.constexpr):
    xnumel = 16
    rnumel = 16
    RBLOCK: tl.constexpr = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    rindex = tl.arange(0, RBLOCK)[None, :]
    roffset = 0
    rmask = tl.full([XBLOCK, RBLOCK], True, tl.int1)
    r2 = rindex
    x3 = xindex
    x0 = xindex % 4
    x1 = (xindex // 4)
    tmp0 = tl.load(in_ptr0 + (r2 + (16*x3)), xmask, other=0.0)
    tmp1 = tl.load(in_ptr1 + (116 + x0), xmask, eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr1 + (120 + x0), xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr1 + (124 + x0), xmask, eviction_policy='evict_last')
    tmp7 = tl.load(in_ptr1 + (128 + x0), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr1 + (132 + x0), xmask, eviction_policy='evict_last')
    tmp11 = tl.load(in_ptr1 + (136 + x0), xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr1 + (140 + x0), xmask, eviction_policy='evict_last')
    tmp15 = tl.load(in_ptr1 + (144 + x0), xmask, eviction_policy='evict_last')
    tmp17 = tl.load(in_ptr1 + (148 + x0), xmask, eviction_policy='evict_last')
    tmp19 = tl.load(in_ptr1 + (152 + x0), xmask, eviction_policy='evict_last')
    tmp21 = tl.load(in_ptr1 + (156 + x0), xmask, eviction_policy='evict_last')
    tmp23 = tl.load(in_ptr1 + (160 + x0), xmask, eviction_policy='evict_last')
    tmp25 = tl.load(in_ptr1 + (164 + x0), xmask, eviction_policy='evict_last')
    tmp27 = tl.load(in_ptr1 + (168 + x0), xmask, eviction_policy='evict_last')
    tmp29 = tl.load(in_ptr1 + (172 + x0), xmask, eviction_policy='evict_last')
    tmp31 = tl.load(in_ptr1 + (176 + x0), xmask, eviction_policy='evict_last')
    tmp33 = tl.load(in_ptr1 + (180 + x0), xmask, eviction_policy='evict_last')
    tmp35 = tl.load(in_ptr1 + (184 + x0), xmask, eviction_policy='evict_last')
    tmp37 = tl.load(in_ptr1 + (188 + x0), xmask, eviction_policy='evict_last')
    tmp39 = tl.load(in_ptr1 + (192 + x0), xmask, eviction_policy='evict_last')
    tmp41 = tl.load(in_ptr1 + (196 + x0), xmask, eviction_policy='evict_last')
    tmp43 = tl.load(in_ptr1 + (200 + x0), xmask, eviction_policy='evict_last')
    tmp45 = tl.load(in_ptr1 + (204 + x0), xmask, eviction_policy='evict_last')
    tmp47 = tl.load(in_ptr1 + (208 + x0), xmask, eviction_policy='evict_last')
    tmp49 = tl.load(in_ptr1 + (212 + x0), xmask, eviction_policy='evict_last')
    tmp51 = tl.load(in_ptr1 + (216 + x0), xmask, eviction_policy='evict_last')
    tmp53 = tl.load(in_ptr1 + (220 + x0), xmask, eviction_policy='evict_last')
    tmp55 = tl.load(in_ptr1 + (224 + x0), xmask, eviction_policy='evict_last')
    tmp57 = tl.load(in_ptr2 + (464 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp58 = tl.load(in_ptr3 + (r2 + (16*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp61 = tl.load(in_ptr4 + (r2 + (16*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp68 = tl.load(in_ptr2 + (480 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp77 = tl.load(in_ptr2 + (496 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp86 = tl.load(in_ptr2 + (512 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp95 = tl.load(in_ptr2 + (528 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp104 = tl.load(in_ptr2 + (544 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp113 = tl.load(in_ptr2 + (560 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp122 = tl.load(in_ptr2 + (576 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp131 = tl.load(in_ptr2 + (592 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp140 = tl.load(in_ptr2 + (608 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp149 = tl.load(in_ptr2 + (624 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp158 = tl.load(in_ptr2 + (640 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp167 = tl.load(in_ptr2 + (656 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp176 = tl.load(in_ptr2 + (672 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp185 = tl.load(in_ptr2 + (688 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp194 = tl.load(in_ptr2 + (704 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp203 = tl.load(in_ptr2 + (720 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp212 = tl.load(in_ptr2 + (736 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp221 = tl.load(in_ptr2 + (752 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp230 = tl.load(in_ptr2 + (768 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp239 = tl.load(in_ptr2 + (784 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp248 = tl.load(in_ptr2 + (800 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp257 = tl.load(in_ptr2 + (816 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp266 = tl.load(in_ptr2 + (832 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp275 = tl.load(in_ptr2 + (848 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp284 = tl.load(in_ptr2 + (864 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp293 = tl.load(in_ptr2 + (880 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp302 = tl.load(in_ptr2 + (896 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp2 = tmp0 - tmp1
    tmp4 = tmp0 - tmp3
    tmp6 = tmp0 - tmp5
    tmp8 = tmp0 - tmp7
    tmp10 = tmp0 - tmp9
    tmp12 = tmp0 - tmp11
    tmp14 = tmp0 - tmp13
    tmp16 = tmp0 - tmp15
    tmp18 = tmp0 - tmp17
    tmp20 = tmp0 - tmp19
    tmp22 = tmp0 - tmp21
    tmp24 = tmp0 - tmp23
    tmp26 = tmp0 - tmp25
    tmp28 = tmp0 - tmp27
    tmp30 = tmp0 - tmp29
    tmp32 = tmp0 - tmp31
    tmp34 = tmp0 - tmp33
    tmp36 = tmp0 - tmp35
    tmp38 = tmp0 - tmp37
    tmp40 = tmp0 - tmp39
    tmp42 = tmp0 - tmp41
    tmp44 = tmp0 - tmp43
    tmp46 = tmp0 - tmp45
    tmp48 = tmp0 - tmp47
    tmp50 = tmp0 - tmp49
    tmp52 = tmp0 - tmp51
    tmp54 = tmp0 - tmp53
    tmp56 = tmp0 - tmp55
    tmp59 = tmp57 - tmp58
    tmp60 = tl_math.exp(tmp59)
    tmp62 = tmp60 / tmp61
    tmp63 = tmp2 * tmp62
    tmp64 = tl.broadcast_to(tmp63, [XBLOCK, RBLOCK])
    tmp66 = tl.where(xmask, tmp64, 0)
    tmp67 = tl.sum(tmp66, 1)[:, None]
    tmp69 = tmp68 - tmp58
    tmp70 = tl_math.exp(tmp69)
    tmp71 = tmp70 / tmp61
    tmp72 = tmp4 * tmp71
    tmp73 = tl.broadcast_to(tmp72, [XBLOCK, RBLOCK])
    tmp75 = tl.where(xmask, tmp73, 0)
    tmp76 = tl.sum(tmp75, 1)[:, None]
    tmp78 = tmp77 - tmp58
    tmp79 = tl_math.exp(tmp78)
    tmp80 = tmp79 / tmp61
    tmp81 = tmp6 * tmp80
    tmp82 = tl.broadcast_to(tmp81, [XBLOCK, RBLOCK])
    tmp84 = tl.where(xmask, tmp82, 0)
    tmp85 = tl.sum(tmp84, 1)[:, None]
    tmp87 = tmp86 - tmp58
    tmp88 = tl_math.exp(tmp87)
    tmp89 = tmp88 / tmp61
    tmp90 = tmp8 * tmp89
    tmp91 = tl.broadcast_to(tmp90, [XBLOCK, RBLOCK])
    tmp93 = tl.where(xmask, tmp91, 0)
    tmp94 = tl.sum(tmp93, 1)[:, None]
    tmp96 = tmp95 - tmp58
    tmp97 = tl_math.exp(tmp96)
    tmp98 = tmp97 / tmp61
    tmp99 = tmp10 * tmp98
    tmp100 = tl.broadcast_to(tmp99, [XBLOCK, RBLOCK])
    tmp102 = tl.where(xmask, tmp100, 0)
    tmp103 = tl.sum(tmp102, 1)[:, None]
    tmp105 = tmp104 - tmp58
    tmp106 = tl_math.exp(tmp105)
    tmp107 = tmp106 / tmp61
    tmp108 = tmp12 * tmp107
    tmp109 = tl.broadcast_to(tmp108, [XBLOCK, RBLOCK])
    tmp111 = tl.where(xmask, tmp109, 0)
    tmp112 = tl.sum(tmp111, 1)[:, None]
    tmp114 = tmp113 - tmp58
    tmp115 = tl_math.exp(tmp114)
    tmp116 = tmp115 / tmp61
    tmp117 = tmp14 * tmp116
    tmp118 = tl.broadcast_to(tmp117, [XBLOCK, RBLOCK])
    tmp120 = tl.where(xmask, tmp118, 0)
    tmp121 = tl.sum(tmp120, 1)[:, None]
    tmp123 = tmp122 - tmp58
    tmp124 = tl_math.exp(tmp123)
    tmp125 = tmp124 / tmp61
    tmp126 = tmp16 * tmp125
    tmp127 = tl.broadcast_to(tmp126, [XBLOCK, RBLOCK])
    tmp129 = tl.where(xmask, tmp127, 0)
    tmp130 = tl.sum(tmp129, 1)[:, None]
    tmp132 = tmp131 - tmp58
    tmp133 = tl_math.exp(tmp132)
    tmp134 = tmp133 / tmp61
    tmp135 = tmp18 * tmp134
    tmp136 = tl.broadcast_to(tmp135, [XBLOCK, RBLOCK])
    tmp138 = tl.where(xmask, tmp136, 0)
    tmp139 = tl.sum(tmp138, 1)[:, None]
    tmp141 = tmp140 - tmp58
    tmp142 = tl_math.exp(tmp141)
    tmp143 = tmp142 / tmp61
    tmp144 = tmp20 * tmp143
    tmp145 = tl.broadcast_to(tmp144, [XBLOCK, RBLOCK])
    tmp147 = tl.where(xmask, tmp145, 0)
    tmp148 = tl.sum(tmp147, 1)[:, None]
    tmp150 = tmp149 - tmp58
    tmp151 = tl_math.exp(tmp150)
    tmp152 = tmp151 / tmp61
    tmp153 = tmp22 * tmp152
    tmp154 = tl.broadcast_to(tmp153, [XBLOCK, RBLOCK])
    tmp156 = tl.where(xmask, tmp154, 0)
    tmp157 = tl.sum(tmp156, 1)[:, None]
    tmp159 = tmp158 - tmp58
    tmp160 = tl_math.exp(tmp159)
    tmp161 = tmp160 / tmp61
    tmp162 = tmp24 * tmp161
    tmp163 = tl.broadcast_to(tmp162, [XBLOCK, RBLOCK])
    tmp165 = tl.where(xmask, tmp163, 0)
    tmp166 = tl.sum(tmp165, 1)[:, None]
    tmp168 = tmp167 - tmp58
    tmp169 = tl_math.exp(tmp168)
    tmp170 = tmp169 / tmp61
    tmp171 = tmp26 * tmp170
    tmp172 = tl.broadcast_to(tmp171, [XBLOCK, RBLOCK])
    tmp174 = tl.where(xmask, tmp172, 0)
    tmp175 = tl.sum(tmp174, 1)[:, None]
    tmp177 = tmp176 - tmp58
    tmp178 = tl_math.exp(tmp177)
    tmp179 = tmp178 / tmp61
    tmp180 = tmp28 * tmp179
    tmp181 = tl.broadcast_to(tmp180, [XBLOCK, RBLOCK])
    tmp183 = tl.where(xmask, tmp181, 0)
    tmp184 = tl.sum(tmp183, 1)[:, None]
    tmp186 = tmp185 - tmp58
    tmp187 = tl_math.exp(tmp186)
    tmp188 = tmp187 / tmp61
    tmp189 = tmp30 * tmp188
    tmp190 = tl.broadcast_to(tmp189, [XBLOCK, RBLOCK])
    tmp192 = tl.where(xmask, tmp190, 0)
    tmp193 = tl.sum(tmp192, 1)[:, None]
    tmp195 = tmp194 - tmp58
    tmp196 = tl_math.exp(tmp195)
    tmp197 = tmp196 / tmp61
    tmp198 = tmp32 * tmp197
    tmp199 = tl.broadcast_to(tmp198, [XBLOCK, RBLOCK])
    tmp201 = tl.where(xmask, tmp199, 0)
    tmp202 = tl.sum(tmp201, 1)[:, None]
    tmp204 = tmp203 - tmp58
    tmp205 = tl_math.exp(tmp204)
    tmp206 = tmp205 / tmp61
    tmp207 = tmp34 * tmp206
    tmp208 = tl.broadcast_to(tmp207, [XBLOCK, RBLOCK])
    tmp210 = tl.where(xmask, tmp208, 0)
    tmp211 = tl.sum(tmp210, 1)[:, None]
    tmp213 = tmp212 - tmp58
    tmp214 = tl_math.exp(tmp213)
    tmp215 = tmp214 / tmp61
    tmp216 = tmp36 * tmp215
    tmp217 = tl.broadcast_to(tmp216, [XBLOCK, RBLOCK])
    tmp219 = tl.where(xmask, tmp217, 0)
    tmp220 = tl.sum(tmp219, 1)[:, None]
    tmp222 = tmp221 - tmp58
    tmp223 = tl_math.exp(tmp222)
    tmp224 = tmp223 / tmp61
    tmp225 = tmp38 * tmp224
    tmp226 = tl.broadcast_to(tmp225, [XBLOCK, RBLOCK])
    tmp228 = tl.where(xmask, tmp226, 0)
    tmp229 = tl.sum(tmp228, 1)[:, None]
    tmp231 = tmp230 - tmp58
    tmp232 = tl_math.exp(tmp231)
    tmp233 = tmp232 / tmp61
    tmp234 = tmp40 * tmp233
    tmp235 = tl.broadcast_to(tmp234, [XBLOCK, RBLOCK])
    tmp237 = tl.where(xmask, tmp235, 0)
    tmp238 = tl.sum(tmp237, 1)[:, None]
    tmp240 = tmp239 - tmp58
    tmp241 = tl_math.exp(tmp240)
    tmp242 = tmp241 / tmp61
    tmp243 = tmp42 * tmp242
    tmp244 = tl.broadcast_to(tmp243, [XBLOCK, RBLOCK])
    tmp246 = tl.where(xmask, tmp244, 0)
    tmp247 = tl.sum(tmp246, 1)[:, None]
    tmp249 = tmp248 - tmp58
    tmp250 = tl_math.exp(tmp249)
    tmp251 = tmp250 / tmp61
    tmp252 = tmp44 * tmp251
    tmp253 = tl.broadcast_to(tmp252, [XBLOCK, RBLOCK])
    tmp255 = tl.where(xmask, tmp253, 0)
    tmp256 = tl.sum(tmp255, 1)[:, None]
    tmp258 = tmp257 - tmp58
    tmp259 = tl_math.exp(tmp258)
    tmp260 = tmp259 / tmp61
    tmp261 = tmp46 * tmp260
    tmp262 = tl.broadcast_to(tmp261, [XBLOCK, RBLOCK])
    tmp264 = tl.where(xmask, tmp262, 0)
    tmp265 = tl.sum(tmp264, 1)[:, None]
    tmp267 = tmp266 - tmp58
    tmp268 = tl_math.exp(tmp267)
    tmp269 = tmp268 / tmp61
    tmp270 = tmp48 * tmp269
    tmp271 = tl.broadcast_to(tmp270, [XBLOCK, RBLOCK])
    tmp273 = tl.where(xmask, tmp271, 0)
    tmp274 = tl.sum(tmp273, 1)[:, None]
    tmp276 = tmp275 - tmp58
    tmp277 = tl_math.exp(tmp276)
    tmp278 = tmp277 / tmp61
    tmp279 = tmp50 * tmp278
    tmp280 = tl.broadcast_to(tmp279, [XBLOCK, RBLOCK])
    tmp282 = tl.where(xmask, tmp280, 0)
    tmp283 = tl.sum(tmp282, 1)[:, None]
    tmp285 = tmp284 - tmp58
    tmp286 = tl_math.exp(tmp285)
    tmp287 = tmp286 / tmp61
    tmp288 = tmp52 * tmp287
    tmp289 = tl.broadcast_to(tmp288, [XBLOCK, RBLOCK])
    tmp291 = tl.where(xmask, tmp289, 0)
    tmp292 = tl.sum(tmp291, 1)[:, None]
    tmp294 = tmp293 - tmp58
    tmp295 = tl_math.exp(tmp294)
    tmp296 = tmp295 / tmp61
    tmp297 = tmp54 * tmp296
    tmp298 = tl.broadcast_to(tmp297, [XBLOCK, RBLOCK])
    tmp300 = tl.where(xmask, tmp298, 0)
    tmp301 = tl.sum(tmp300, 1)[:, None]
    tmp303 = tmp302 - tmp58
    tmp304 = tl_math.exp(tmp303)
    tmp305 = tmp304 / tmp61
    tmp306 = tmp56 * tmp305
    tmp307 = tl.broadcast_to(tmp306, [XBLOCK, RBLOCK])
    tmp309 = tl.where(xmask, tmp307, 0)
    tmp310 = tl.sum(tmp309, 1)[:, None]
    tl.store(out_ptr0 + (r2 + (16*x3)), tmp2, xmask)
    tl.store(out_ptr1 + (r2 + (16*x3)), tmp4, xmask)
    tl.store(out_ptr2 + (r2 + (16*x3)), tmp6, xmask)
    tl.store(out_ptr3 + (r2 + (16*x3)), tmp8, xmask)
    tl.store(out_ptr4 + (r2 + (16*x3)), tmp10, xmask)
    tl.store(out_ptr5 + (r2 + (16*x3)), tmp12, xmask)
    tl.store(out_ptr6 + (r2 + (16*x3)), tmp14, xmask)
    tl.store(out_ptr7 + (r2 + (16*x3)), tmp16, xmask)
    tl.store(out_ptr8 + (r2 + (16*x3)), tmp18, xmask)
    tl.store(out_ptr9 + (r2 + (16*x3)), tmp20, xmask)
    tl.store(out_ptr10 + (r2 + (16*x3)), tmp22, xmask)
    tl.store(out_ptr11 + (r2 + (16*x3)), tmp24, xmask)
    tl.store(out_ptr12 + (r2 + (16*x3)), tmp26, xmask)
    tl.store(out_ptr13 + (r2 + (16*x3)), tmp28, xmask)
    tl.store(out_ptr14 + (r2 + (16*x3)), tmp30, xmask)
    tl.store(out_ptr15 + (r2 + (16*x3)), tmp32, xmask)
    tl.store(out_ptr16 + (r2 + (16*x3)), tmp34, xmask)
    tl.store(out_ptr17 + (r2 + (16*x3)), tmp36, xmask)
    tl.store(out_ptr18 + (r2 + (16*x3)), tmp38, xmask)
    tl.store(out_ptr19 + (r2 + (16*x3)), tmp40, xmask)
    tl.store(out_ptr20 + (r2 + (16*x3)), tmp42, xmask)
    tl.store(out_ptr21 + (r2 + (16*x3)), tmp44, xmask)
    tl.store(out_ptr22 + (r2 + (16*x3)), tmp46, xmask)
    tl.store(out_ptr23 + (r2 + (16*x3)), tmp48, xmask)
    tl.store(out_ptr24 + (r2 + (16*x3)), tmp50, xmask)
    tl.store(out_ptr25 + (r2 + (16*x3)), tmp52, xmask)
    tl.store(out_ptr26 + (r2 + (16*x3)), tmp54, xmask)
    tl.store(out_ptr27 + (r2 + (16*x3)), tmp56, xmask)
    tl.store(out_ptr28 + (x3), tmp67, xmask)
    tl.store(out_ptr29 + (x3), tmp76, xmask)
    tl.store(out_ptr30 + (x3), tmp85, xmask)
    tl.store(out_ptr31 + (x3), tmp94, xmask)
    tl.store(out_ptr32 + (x3), tmp103, xmask)
    tl.store(out_ptr33 + (x3), tmp112, xmask)
    tl.store(out_ptr34 + (x3), tmp121, xmask)
    tl.store(out_ptr35 + (x3), tmp130, xmask)
    tl.store(out_ptr36 + (x3), tmp139, xmask)
    tl.store(out_ptr37 + (x3), tmp148, xmask)
    tl.store(out_ptr38 + (x3), tmp157, xmask)
    tl.store(out_ptr39 + (x3), tmp166, xmask)
    tl.store(out_ptr40 + (x3), tmp175, xmask)
    tl.store(out_ptr41 + (x3), tmp184, xmask)
    tl.store(out_ptr42 + (x3), tmp193, xmask)
    tl.store(out_ptr43 + (x3), tmp202, xmask)
    tl.store(out_ptr44 + (x3), tmp211, xmask)
    tl.store(out_ptr45 + (x3), tmp220, xmask)
    tl.store(out_ptr46 + (x3), tmp229, xmask)
    tl.store(out_ptr47 + (x3), tmp238, xmask)
    tl.store(out_ptr48 + (x3), tmp247, xmask)
    tl.store(out_ptr49 + (x3), tmp256, xmask)
    tl.store(out_ptr50 + (x3), tmp265, xmask)
    tl.store(out_ptr51 + (x3), tmp274, xmask)
    tl.store(out_ptr52 + (x3), tmp283, xmask)
    tl.store(out_ptr53 + (x3), tmp292, xmask)
    tl.store(out_ptr54 + (x3), tmp301, xmask)
    tl.store(out_ptr55 + (x3), tmp310, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/st/cstxuovzesn23qbkbmy6v42shqz4pls6o6mkdxfmwjszj5mvqofd.py
# Topologically Sorted Source Nodes: [residual_114, residual_115, sum_58, residual_116, residual_117, sum_59, residual_118, residual_119, sum_60, residual_120, residual_121, sum_61, residual_122, residual_123, sum_62, residual_124, residual_125, sum_63, residual_126, residual_127, sum_64], Original ATen: [aten.sub, aten.mul, aten.sum]
# Source node to ATen node mapping:
#   residual_114 => sub_58
#   residual_115 => mul_57
#   residual_116 => sub_59
#   residual_117 => mul_58
#   residual_118 => sub_60
#   residual_119 => mul_59
#   residual_120 => sub_61
#   residual_121 => mul_60
#   residual_122 => sub_62
#   residual_123 => mul_61
#   residual_124 => sub_63
#   residual_125 => mul_62
#   residual_126 => sub_64
#   residual_127 => mul_63
#   sum_58 => sum_59
#   sum_59 => sum_60
#   sum_60 => sum_61
#   sum_61 => sum_62
#   sum_62 => sum_63
#   sum_63 => sum_64
#   sum_64 => sum_65
# Graph fragment:
#   %sub_58 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_172), kwargs = {})
#   %mul_57 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_58, %unsqueeze_173), kwargs = {})
#   %sum_59 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_57, [-1]), kwargs = {})
#   %sub_59 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_175), kwargs = {})
#   %mul_58 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_59, %unsqueeze_176), kwargs = {})
#   %sum_60 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_58, [-1]), kwargs = {})
#   %sub_60 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_178), kwargs = {})
#   %mul_59 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_60, %unsqueeze_179), kwargs = {})
#   %sum_61 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_59, [-1]), kwargs = {})
#   %sub_61 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_181), kwargs = {})
#   %mul_60 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_61, %unsqueeze_182), kwargs = {})
#   %sum_62 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_60, [-1]), kwargs = {})
#   %sub_62 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_184), kwargs = {})
#   %mul_61 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_62, %unsqueeze_185), kwargs = {})
#   %sum_63 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_61, [-1]), kwargs = {})
#   %sub_63 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_187), kwargs = {})
#   %mul_62 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_63, %unsqueeze_188), kwargs = {})
#   %sum_64 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_62, [-1]), kwargs = {})
#   %sub_64 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_190), kwargs = {})
#   %mul_63 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_64, %unsqueeze_191), kwargs = {})
#   %sum_65 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_63, [-1]), kwargs = {})
triton_per_fused_mul_sub_sum_3 = async_compile.triton('triton_per_fused_mul_sub_sum_3', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

from torch._inductor.runtime import triton_helpers, triton_heuristics
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, instance_descriptor, DeviceProperties

@triton_heuristics.persistent_reduction(
    size_hints=[16, 16],
    reduction_hint=ReductionHint.DEFAULT,
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: '*fp32', 5: '*fp32', 6: '*fp32', 7: '*fp32', 8: '*fp32', 9: '*fp32', 10: '*fp32', 11: '*fp32', 12: '*fp32', 13: '*fp32', 14: '*fp32', 15: '*fp32', 16: '*fp32', 17: '*fp32', 18: '*fp32', 19: 'i32', 20: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_per_fused_mul_sub_sum_3', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 17, 'num_reduction': 7, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False}
)
@triton.jit
def triton_per_fused_mul_sub_sum_3(in_ptr0, in_ptr1, in_ptr2, in_ptr3, in_ptr4, out_ptr0, out_ptr1, out_ptr2, out_ptr3, out_ptr4, out_ptr5, out_ptr6, out_ptr7, out_ptr8, out_ptr9, out_ptr10, out_ptr11, out_ptr12, out_ptr13, xnumel, rnumel, XBLOCK : tl.constexpr):
    xnumel = 16
    rnumel = 16
    RBLOCK: tl.constexpr = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    rindex = tl.arange(0, RBLOCK)[None, :]
    roffset = 0
    rmask = tl.full([XBLOCK, RBLOCK], True, tl.int1)
    r2 = rindex
    x3 = xindex
    x0 = xindex % 4
    x1 = (xindex // 4)
    tmp0 = tl.load(in_ptr0 + (r2 + (16*x3)), xmask, other=0.0)
    tmp1 = tl.load(in_ptr1 + (228 + x0), xmask, eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr1 + (232 + x0), xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr1 + (236 + x0), xmask, eviction_policy='evict_last')
    tmp7 = tl.load(in_ptr1 + (240 + x0), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr1 + (244 + x0), xmask, eviction_policy='evict_last')
    tmp11 = tl.load(in_ptr1 + (248 + x0), xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr1 + (252 + x0), xmask, eviction_policy='evict_last')
    tmp15 = tl.load(in_ptr2 + (912 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp16 = tl.load(in_ptr3 + (r2 + (16*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp19 = tl.load(in_ptr4 + (r2 + (16*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp26 = tl.load(in_ptr2 + (928 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp35 = tl.load(in_ptr2 + (944 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp44 = tl.load(in_ptr2 + (960 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp53 = tl.load(in_ptr2 + (976 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp62 = tl.load(in_ptr2 + (992 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp71 = tl.load(in_ptr2 + (1008 + r2 + (1024*x1)), xmask, eviction_policy='evict_last', other=0.0)
    tmp2 = tmp0 - tmp1
    tmp4 = tmp0 - tmp3
    tmp6 = tmp0 - tmp5
    tmp8 = tmp0 - tmp7
    tmp10 = tmp0 - tmp9
    tmp12 = tmp0 - tmp11
    tmp14 = tmp0 - tmp13
    tmp17 = tmp15 - tmp16
    tmp18 = tl_math.exp(tmp17)
    tmp20 = tmp18 / tmp19
    tmp21 = tmp2 * tmp20
    tmp22 = tl.broadcast_to(tmp21, [XBLOCK, RBLOCK])
    tmp24 = tl.where(xmask, tmp22, 0)
    tmp25 = tl.sum(tmp24, 1)[:, None]
    tmp27 = tmp26 - tmp16
    tmp28 = tl_math.exp(tmp27)
    tmp29 = tmp28 / tmp19
    tmp30 = tmp4 * tmp29
    tmp31 = tl.broadcast_to(tmp30, [XBLOCK, RBLOCK])
    tmp33 = tl.where(xmask, tmp31, 0)
    tmp34 = tl.sum(tmp33, 1)[:, None]
    tmp36 = tmp35 - tmp16
    tmp37 = tl_math.exp(tmp36)
    tmp38 = tmp37 / tmp19
    tmp39 = tmp6 * tmp38
    tmp40 = tl.broadcast_to(tmp39, [XBLOCK, RBLOCK])
    tmp42 = tl.where(xmask, tmp40, 0)
    tmp43 = tl.sum(tmp42, 1)[:, None]
    tmp45 = tmp44 - tmp16
    tmp46 = tl_math.exp(tmp45)
    tmp47 = tmp46 / tmp19
    tmp48 = tmp8 * tmp47
    tmp49 = tl.broadcast_to(tmp48, [XBLOCK, RBLOCK])
    tmp51 = tl.where(xmask, tmp49, 0)
    tmp52 = tl.sum(tmp51, 1)[:, None]
    tmp54 = tmp53 - tmp16
    tmp55 = tl_math.exp(tmp54)
    tmp56 = tmp55 / tmp19
    tmp57 = tmp10 * tmp56
    tmp58 = tl.broadcast_to(tmp57, [XBLOCK, RBLOCK])
    tmp60 = tl.where(xmask, tmp58, 0)
    tmp61 = tl.sum(tmp60, 1)[:, None]
    tmp63 = tmp62 - tmp16
    tmp64 = tl_math.exp(tmp63)
    tmp65 = tmp64 / tmp19
    tmp66 = tmp12 * tmp65
    tmp67 = tl.broadcast_to(tmp66, [XBLOCK, RBLOCK])
    tmp69 = tl.where(xmask, tmp67, 0)
    tmp70 = tl.sum(tmp69, 1)[:, None]
    tmp72 = tmp71 - tmp16
    tmp73 = tl_math.exp(tmp72)
    tmp74 = tmp73 / tmp19
    tmp75 = tmp14 * tmp74
    tmp76 = tl.broadcast_to(tmp75, [XBLOCK, RBLOCK])
    tmp78 = tl.where(xmask, tmp76, 0)
    tmp79 = tl.sum(tmp78, 1)[:, None]
    tl.store(out_ptr0 + (r2 + (16*x3)), tmp2, xmask)
    tl.store(out_ptr1 + (r2 + (16*x3)), tmp4, xmask)
    tl.store(out_ptr2 + (r2 + (16*x3)), tmp6, xmask)
    tl.store(out_ptr3 + (r2 + (16*x3)), tmp8, xmask)
    tl.store(out_ptr4 + (r2 + (16*x3)), tmp10, xmask)
    tl.store(out_ptr5 + (r2 + (16*x3)), tmp12, xmask)
    tl.store(out_ptr6 + (r2 + (16*x3)), tmp14, xmask)
    tl.store(out_ptr7 + (x3), tmp25, xmask)
    tl.store(out_ptr8 + (x3), tmp34, xmask)
    tl.store(out_ptr9 + (x3), tmp43, xmask)
    tl.store(out_ptr10 + (x3), tmp52, xmask)
    tl.store(out_ptr11 + (x3), tmp61, xmask)
    tl.store(out_ptr12 + (x3), tmp70, xmask)
    tl.store(out_ptr13 + (x3), tmp79, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/oc/coczrn6vl6mexwre2io3xtgstw7pjvmjymjanrr2pcnzp7gd7wea.py
# Topologically Sorted Source Nodes: [vlad, setitem, setitem_1, setitem_2, setitem_3, setitem_4, setitem_5, setitem_6, setitem_7, setitem_8, setitem_9, setitem_10, setitem_11, setitem_12, setitem_13, setitem_14, setitem_15, setitem_16, setitem_17, setitem_18, setitem_19, setitem_20, setitem_21, setitem_22, setitem_23, setitem_24, setitem_25, setitem_26, setitem_27, setitem_28, setitem_29, setitem_30, setitem_31, setitem_32, setitem_33, setitem_34, setitem_35, setitem_36, setitem_37, setitem_38, setitem_39, setitem_40, setitem_41, setitem_42, setitem_43, setitem_44, setitem_45, setitem_46, setitem_47, setitem_48, setitem_49, setitem_50, setitem_51, setitem_52, setitem_53, setitem_54, setitem_55, setitem_56, setitem_57, setitem_58, setitem_59, setitem_60, setitem_61, setitem_62, setitem_63], Original ATen: [aten.zeros, aten.copy]
# Source node to ATen node mapping:
#   setitem => copy
#   setitem_1 => copy_1
#   setitem_10 => copy_10
#   setitem_11 => copy_11
#   setitem_12 => copy_12
#   setitem_13 => copy_13
#   setitem_14 => copy_14
#   setitem_15 => copy_15
#   setitem_16 => copy_16
#   setitem_17 => copy_17
#   setitem_18 => copy_18
#   setitem_19 => copy_19
#   setitem_2 => copy_2
#   setitem_20 => copy_20
#   setitem_21 => copy_21
#   setitem_22 => copy_22
#   setitem_23 => copy_23
#   setitem_24 => copy_24
#   setitem_25 => copy_25
#   setitem_26 => copy_26
#   setitem_27 => copy_27
#   setitem_28 => copy_28
#   setitem_29 => copy_29
#   setitem_3 => copy_3
#   setitem_30 => copy_30
#   setitem_31 => copy_31
#   setitem_32 => copy_32
#   setitem_33 => copy_33
#   setitem_34 => copy_34
#   setitem_35 => copy_35
#   setitem_36 => copy_36
#   setitem_37 => copy_37
#   setitem_38 => copy_38
#   setitem_39 => copy_39
#   setitem_4 => copy_4
#   setitem_40 => copy_40
#   setitem_41 => copy_41
#   setitem_42 => copy_42
#   setitem_43 => copy_43
#   setitem_44 => copy_44
#   setitem_45 => copy_45
#   setitem_46 => copy_46
#   setitem_47 => copy_47
#   setitem_48 => copy_48
#   setitem_49 => copy_49
#   setitem_5 => copy_5
#   setitem_50 => copy_50
#   setitem_51 => copy_51
#   setitem_52 => copy_52
#   setitem_53 => copy_53
#   setitem_54 => copy_54
#   setitem_55 => copy_55
#   setitem_56 => copy_56
#   setitem_57 => copy_57
#   setitem_58 => copy_58
#   setitem_59 => copy_59
#   setitem_6 => copy_6
#   setitem_60 => copy_60
#   setitem_61 => copy_61
#   setitem_62 => copy_62
#   setitem_63 => copy_63
#   setitem_7 => copy_7
#   setitem_8 => copy_8
#   setitem_9 => copy_9
#   vlad => full
# Graph fragment:
#   %full : [num_users=2] = call_function[target=torch.ops.aten.full.default](args = ([4, 64, 4], 0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %copy : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_7, %sum_2), kwargs = {})
#   %slice_scatter_default : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%full, %copy, 1, 0, 1), kwargs = {})
#   %copy_1 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_26, %sum_3), kwargs = {})
#   %slice_scatter_default_1 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default, %copy_1, 1, 1, 2), kwargs = {})
#   %copy_2 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_45, %sum_4), kwargs = {})
#   %slice_scatter_default_2 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_1, %copy_2, 1, 2, 3), kwargs = {})
#   %copy_3 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_64, %sum_5), kwargs = {})
#   %slice_scatter_default_3 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_2, %copy_3, 1, 3, 4), kwargs = {})
#   %copy_4 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_83, %sum_6), kwargs = {})
#   %slice_scatter_default_4 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_3, %copy_4, 1, 4, 5), kwargs = {})
#   %copy_5 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_102, %sum_7), kwargs = {})
#   %slice_scatter_default_5 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_4, %copy_5, 1, 5, 6), kwargs = {})
#   %copy_6 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_121, %sum_8), kwargs = {})
#   %slice_scatter_default_6 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_5, %copy_6, 1, 6, 7), kwargs = {})
#   %copy_7 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_140, %sum_9), kwargs = {})
#   %slice_scatter_default_7 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_6, %copy_7, 1, 7, 8), kwargs = {})
#   %copy_8 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_159, %sum_10), kwargs = {})
#   %slice_scatter_default_8 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_7, %copy_8, 1, 8, 9), kwargs = {})
#   %copy_9 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_178, %sum_11), kwargs = {})
#   %slice_scatter_default_9 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_8, %copy_9, 1, 9, 10), kwargs = {})
#   %copy_10 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_197, %sum_12), kwargs = {})
#   %slice_scatter_default_10 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_9, %copy_10, 1, 10, 11), kwargs = {})
#   %copy_11 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_216, %sum_13), kwargs = {})
#   %slice_scatter_default_11 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_10, %copy_11, 1, 11, 12), kwargs = {})
#   %copy_12 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_235, %sum_14), kwargs = {})
#   %slice_scatter_default_12 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_11, %copy_12, 1, 12, 13), kwargs = {})
#   %copy_13 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_254, %sum_15), kwargs = {})
#   %slice_scatter_default_13 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_12, %copy_13, 1, 13, 14), kwargs = {})
#   %copy_14 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_273, %sum_16), kwargs = {})
#   %slice_scatter_default_14 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_13, %copy_14, 1, 14, 15), kwargs = {})
#   %copy_15 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_292, %sum_17), kwargs = {})
#   %slice_scatter_default_15 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_14, %copy_15, 1, 15, 16), kwargs = {})
#   %copy_16 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_311, %sum_18), kwargs = {})
#   %slice_scatter_default_16 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_15, %copy_16, 1, 16, 17), kwargs = {})
#   %copy_17 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_330, %sum_19), kwargs = {})
#   %slice_scatter_default_17 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_16, %copy_17, 1, 17, 18), kwargs = {})
#   %copy_18 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_349, %sum_20), kwargs = {})
#   %slice_scatter_default_18 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_17, %copy_18, 1, 18, 19), kwargs = {})
#   %copy_19 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_368, %sum_21), kwargs = {})
#   %slice_scatter_default_19 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_18, %copy_19, 1, 19, 20), kwargs = {})
#   %copy_20 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_387, %sum_22), kwargs = {})
#   %slice_scatter_default_20 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_19, %copy_20, 1, 20, 21), kwargs = {})
#   %copy_21 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_406, %sum_23), kwargs = {})
#   %slice_scatter_default_21 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_20, %copy_21, 1, 21, 22), kwargs = {})
#   %copy_22 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_425, %sum_24), kwargs = {})
#   %slice_scatter_default_22 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_21, %copy_22, 1, 22, 23), kwargs = {})
#   %copy_23 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_444, %sum_25), kwargs = {})
#   %slice_scatter_default_23 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_22, %copy_23, 1, 23, 24), kwargs = {})
#   %copy_24 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_463, %sum_26), kwargs = {})
#   %slice_scatter_default_24 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_23, %copy_24, 1, 24, 25), kwargs = {})
#   %copy_25 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_482, %sum_27), kwargs = {})
#   %slice_scatter_default_25 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_24, %copy_25, 1, 25, 26), kwargs = {})
#   %copy_26 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_501, %sum_28), kwargs = {})
#   %slice_scatter_default_26 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_25, %copy_26, 1, 26, 27), kwargs = {})
#   %copy_27 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_520, %sum_29), kwargs = {})
#   %slice_scatter_default_27 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_26, %copy_27, 1, 27, 28), kwargs = {})
#   %copy_28 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_539, %sum_30), kwargs = {})
#   %slice_scatter_default_28 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_27, %copy_28, 1, 28, 29), kwargs = {})
#   %copy_29 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_558, %sum_31), kwargs = {})
#   %slice_scatter_default_29 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_28, %copy_29, 1, 29, 30), kwargs = {})
#   %copy_30 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_577, %sum_32), kwargs = {})
#   %slice_scatter_default_30 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_29, %copy_30, 1, 30, 31), kwargs = {})
#   %copy_31 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_596, %sum_33), kwargs = {})
#   %slice_scatter_default_31 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_30, %copy_31, 1, 31, 32), kwargs = {})
#   %copy_32 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_615, %sum_34), kwargs = {})
#   %slice_scatter_default_32 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_31, %copy_32, 1, 32, 33), kwargs = {})
#   %copy_33 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_634, %sum_35), kwargs = {})
#   %slice_scatter_default_33 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_32, %copy_33, 1, 33, 34), kwargs = {})
#   %copy_34 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_653, %sum_36), kwargs = {})
#   %slice_scatter_default_34 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_33, %copy_34, 1, 34, 35), kwargs = {})
#   %copy_35 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_672, %sum_37), kwargs = {})
#   %slice_scatter_default_35 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_34, %copy_35, 1, 35, 36), kwargs = {})
#   %copy_36 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_691, %sum_38), kwargs = {})
#   %slice_scatter_default_36 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_35, %copy_36, 1, 36, 37), kwargs = {})
#   %copy_37 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_710, %sum_39), kwargs = {})
#   %slice_scatter_default_37 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_36, %copy_37, 1, 37, 38), kwargs = {})
#   %copy_38 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_729, %sum_40), kwargs = {})
#   %slice_scatter_default_38 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_37, %copy_38, 1, 38, 39), kwargs = {})
#   %copy_39 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_748, %sum_41), kwargs = {})
#   %slice_scatter_default_39 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_38, %copy_39, 1, 39, 40), kwargs = {})
#   %copy_40 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_767, %sum_42), kwargs = {})
#   %slice_scatter_default_40 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_39, %copy_40, 1, 40, 41), kwargs = {})
#   %copy_41 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_786, %sum_43), kwargs = {})
#   %slice_scatter_default_41 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_40, %copy_41, 1, 41, 42), kwargs = {})
#   %copy_42 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_805, %sum_44), kwargs = {})
#   %slice_scatter_default_42 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_41, %copy_42, 1, 42, 43), kwargs = {})
#   %copy_43 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_824, %sum_45), kwargs = {})
#   %slice_scatter_default_43 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_42, %copy_43, 1, 43, 44), kwargs = {})
#   %copy_44 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_843, %sum_46), kwargs = {})
#   %slice_scatter_default_44 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_43, %copy_44, 1, 44, 45), kwargs = {})
#   %copy_45 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_862, %sum_47), kwargs = {})
#   %slice_scatter_default_45 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_44, %copy_45, 1, 45, 46), kwargs = {})
#   %copy_46 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_881, %sum_48), kwargs = {})
#   %slice_scatter_default_46 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_45, %copy_46, 1, 46, 47), kwargs = {})
#   %copy_47 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_900, %sum_49), kwargs = {})
#   %slice_scatter_default_47 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_46, %copy_47, 1, 47, 48), kwargs = {})
#   %copy_48 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_919, %sum_50), kwargs = {})
#   %slice_scatter_default_48 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_47, %copy_48, 1, 48, 49), kwargs = {})
#   %copy_49 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_938, %sum_51), kwargs = {})
#   %slice_scatter_default_49 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_48, %copy_49, 1, 49, 50), kwargs = {})
#   %copy_50 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_957, %sum_52), kwargs = {})
#   %slice_scatter_default_50 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_49, %copy_50, 1, 50, 51), kwargs = {})
#   %copy_51 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_976, %sum_53), kwargs = {})
#   %slice_scatter_default_51 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_50, %copy_51, 1, 51, 52), kwargs = {})
#   %copy_52 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_995, %sum_54), kwargs = {})
#   %slice_scatter_default_52 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_51, %copy_52, 1, 52, 53), kwargs = {})
#   %copy_53 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_1014, %sum_55), kwargs = {})
#   %slice_scatter_default_53 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_52, %copy_53, 1, 53, 54), kwargs = {})
#   %copy_54 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_1033, %sum_56), kwargs = {})
#   %slice_scatter_default_54 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_53, %copy_54, 1, 54, 55), kwargs = {})
#   %copy_55 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_1052, %sum_57), kwargs = {})
#   %slice_scatter_default_55 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_54, %copy_55, 1, 55, 56), kwargs = {})
#   %copy_56 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_1071, %sum_58), kwargs = {})
#   %slice_scatter_default_56 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_55, %copy_56, 1, 56, 57), kwargs = {})
#   %copy_57 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_1090, %sum_59), kwargs = {})
#   %slice_scatter_default_57 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_56, %copy_57, 1, 57, 58), kwargs = {})
#   %copy_58 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_1109, %sum_60), kwargs = {})
#   %slice_scatter_default_58 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_57, %copy_58, 1, 58, 59), kwargs = {})
#   %copy_59 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_1128, %sum_61), kwargs = {})
#   %slice_scatter_default_59 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_58, %copy_59, 1, 59, 60), kwargs = {})
#   %copy_60 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_1147, %sum_62), kwargs = {})
#   %slice_scatter_default_60 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_59, %copy_60, 1, 60, 61), kwargs = {})
#   %copy_61 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_1166, %sum_63), kwargs = {})
#   %slice_scatter_default_61 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_60, %copy_61, 1, 61, 62), kwargs = {})
#   %copy_62 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_1185, %sum_64), kwargs = {})
#   %slice_scatter_default_62 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_61, %copy_62, 1, 62, 63), kwargs = {})
#   %copy_63 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_1204, %sum_65), kwargs = {})
#   %slice_scatter_default_63 : [num_users=3] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_62, %copy_63, 1, 63, 64), kwargs = {})
triton_poi_fused_copy_zeros_4 = async_compile.triton('triton_poi_fused_copy_zeros_4', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

from torch._inductor.runtime import triton_helpers, triton_heuristics
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, instance_descriptor, DeviceProperties

@triton_heuristics.pointwise(
    size_hints=[1024], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: '*fp32', 5: '*fp32', 6: '*fp32', 7: '*fp32', 8: '*fp32', 9: '*fp32', 10: '*fp32', 11: '*fp32', 12: '*fp32', 13: '*fp32', 14: '*fp32', 15: '*fp32', 16: '*fp32', 17: '*fp32', 18: '*fp32', 19: '*fp32', 20: '*fp32', 21: '*fp32', 22: '*fp32', 23: '*fp32', 24: '*fp32', 25: '*fp32', 26: '*fp32', 27: '*fp32', 28: '*fp32', 29: '*fp32', 30: '*fp32', 31: '*fp32', 32: '*fp32', 33: '*fp32', 34: '*fp32', 35: '*fp32', 36: '*fp32', 37: '*fp32', 38: '*fp32', 39: '*fp32', 40: '*fp32', 41: '*fp32', 42: '*fp32', 43: '*fp32', 44: '*fp32', 45: '*fp32', 46: '*fp32', 47: '*fp32', 48: '*fp32', 49: '*fp32', 50: '*fp32', 51: '*fp32', 52: '*fp32', 53: '*fp32', 54: '*fp32', 55: '*fp32', 56: '*fp32', 57: '*fp32', 58: '*fp32', 59: '*fp32', 60: '*fp32', 61: '*fp32', 62: '*fp32', 63: '*fp32', 64: '*fp32', 65: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 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, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_copy_zeros_4', 'mutated_arg_names': ['in_out_ptr0'], 'no_x_dim': False, 'num_load': 64, 'num_reduction': 0, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_copy_zeros_4(in_out_ptr0, in_ptr0, in_ptr1, in_ptr2, in_ptr3, in_ptr4, in_ptr5, in_ptr6, in_ptr7, in_ptr8, in_ptr9, in_ptr10, in_ptr11, in_ptr12, in_ptr13, in_ptr14, in_ptr15, in_ptr16, in_ptr17, in_ptr18, in_ptr19, in_ptr20, in_ptr21, in_ptr22, in_ptr23, in_ptr24, in_ptr25, in_ptr26, in_ptr27, in_ptr28, in_ptr29, in_ptr30, in_ptr31, in_ptr32, in_ptr33, in_ptr34, in_ptr35, in_ptr36, in_ptr37, in_ptr38, in_ptr39, in_ptr40, in_ptr41, in_ptr42, in_ptr43, in_ptr44, in_ptr45, in_ptr46, in_ptr47, in_ptr48, in_ptr49, in_ptr50, in_ptr51, in_ptr52, in_ptr53, in_ptr54, in_ptr55, in_ptr56, in_ptr57, in_ptr58, in_ptr59, in_ptr60, in_ptr61, in_ptr62, in_ptr63, xnumel, XBLOCK : tl.constexpr):
    xnumel = 1024
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x1 = (xindex // 4) % 64
    x0 = xindex % 4
    x2 = (xindex // 256)
    x3 = xindex
    tmp0 = x1
    tmp1 = tl.full([1], 4, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = tl.full([1], 5, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp5 = tmp2 & tmp4
    tmp6 = tl.load(in_ptr0 + (x0 + (4*x2)), tmp5 & xmask, eviction_policy='evict_last', other=0.0)
    tmp7 = tl.full([1], 3, tl.int64)
    tmp8 = tmp0 >= tmp7
    tmp9 = tmp0 < tmp1
    tmp10 = tmp8 & tmp9
    tmp11 = tl.load(in_ptr1 + (x0 + (4*x2)), tmp10 & xmask, eviction_policy='evict_last', other=0.0)
    tmp12 = tl.full([1], 2, tl.int64)
    tmp13 = tmp0 >= tmp12
    tmp14 = tmp0 < tmp7
    tmp15 = tmp13 & tmp14
    tmp16 = tl.load(in_ptr2 + (x0 + (4*x2)), tmp15 & xmask, eviction_policy='evict_last', other=0.0)
    tmp17 = tl.full([1], 1, tl.int64)
    tmp18 = tmp0 >= tmp17
    tmp19 = tmp0 < tmp12
    tmp20 = tmp18 & tmp19
    tmp21 = tl.load(in_ptr3 + (x0 + (4*x2)), tmp20 & xmask, eviction_policy='evict_last', other=0.0)
    tmp22 = tmp0 < tmp17
    tmp23 = tl.load(in_ptr4 + (x0 + (4*x2)), tmp22 & xmask, eviction_policy='evict_last', other=0.0)
    tmp24 = 0.0
    tmp25 = tl.where(tmp22, tmp23, tmp24)
    tmp26 = tl.where(tmp20, tmp21, tmp25)
    tmp27 = tl.where(tmp15, tmp16, tmp26)
    tmp28 = tl.where(tmp10, tmp11, tmp27)
    tmp29 = tl.where(tmp5, tmp6, tmp28)
    tmp30 = tl.full([1], 8, tl.int64)
    tmp31 = tmp0 >= tmp30
    tmp32 = tl.full([1], 9, tl.int64)
    tmp33 = tmp0 < tmp32
    tmp34 = tmp31 & tmp33
    tmp35 = tl.load(in_ptr5 + (x0 + (4*x2)), tmp34 & xmask, eviction_policy='evict_last', other=0.0)
    tmp36 = tl.full([1], 7, tl.int64)
    tmp37 = tmp0 >= tmp36
    tmp38 = tmp0 < tmp30
    tmp39 = tmp37 & tmp38
    tmp40 = tl.load(in_ptr6 + (x0 + (4*x2)), tmp39 & xmask, eviction_policy='evict_last', other=0.0)
    tmp41 = tl.full([1], 6, tl.int64)
    tmp42 = tmp0 >= tmp41
    tmp43 = tmp0 < tmp36
    tmp44 = tmp42 & tmp43
    tmp45 = tl.load(in_ptr7 + (x0 + (4*x2)), tmp44 & xmask, eviction_policy='evict_last', other=0.0)
    tmp46 = tmp0 >= tmp3
    tmp47 = tmp0 < tmp41
    tmp48 = tmp46 & tmp47
    tmp49 = tl.load(in_ptr8 + (x0 + (4*x2)), tmp48 & xmask, eviction_policy='evict_last', other=0.0)
    tmp50 = tl.where(tmp48, tmp49, tmp29)
    tmp51 = tl.where(tmp44, tmp45, tmp50)
    tmp52 = tl.where(tmp39, tmp40, tmp51)
    tmp53 = tl.where(tmp34, tmp35, tmp52)
    tmp54 = tl.full([1], 12, tl.int64)
    tmp55 = tmp0 >= tmp54
    tmp56 = tl.full([1], 13, tl.int64)
    tmp57 = tmp0 < tmp56
    tmp58 = tmp55 & tmp57
    tmp59 = tl.load(in_ptr9 + (x0 + (4*x2)), tmp58 & xmask, eviction_policy='evict_last', other=0.0)
    tmp60 = tl.full([1], 11, tl.int64)
    tmp61 = tmp0 >= tmp60
    tmp62 = tmp0 < tmp54
    tmp63 = tmp61 & tmp62
    tmp64 = tl.load(in_ptr10 + (x0 + (4*x2)), tmp63 & xmask, eviction_policy='evict_last', other=0.0)
    tmp65 = tl.full([1], 10, tl.int64)
    tmp66 = tmp0 >= tmp65
    tmp67 = tmp0 < tmp60
    tmp68 = tmp66 & tmp67
    tmp69 = tl.load(in_ptr11 + (x0 + (4*x2)), tmp68 & xmask, eviction_policy='evict_last', other=0.0)
    tmp70 = tmp0 >= tmp32
    tmp71 = tmp0 < tmp65
    tmp72 = tmp70 & tmp71
    tmp73 = tl.load(in_ptr12 + (x0 + (4*x2)), tmp72 & xmask, eviction_policy='evict_last', other=0.0)
    tmp74 = tl.where(tmp72, tmp73, tmp53)
    tmp75 = tl.where(tmp68, tmp69, tmp74)
    tmp76 = tl.where(tmp63, tmp64, tmp75)
    tmp77 = tl.where(tmp58, tmp59, tmp76)
    tmp78 = tl.full([1], 16, tl.int64)
    tmp79 = tmp0 >= tmp78
    tmp80 = tl.full([1], 17, tl.int64)
    tmp81 = tmp0 < tmp80
    tmp82 = tmp79 & tmp81
    tmp83 = tl.load(in_ptr13 + (x0 + (4*x2)), tmp82 & xmask, eviction_policy='evict_last', other=0.0)
    tmp84 = tl.full([1], 15, tl.int64)
    tmp85 = tmp0 >= tmp84
    tmp86 = tmp0 < tmp78
    tmp87 = tmp85 & tmp86
    tmp88 = tl.load(in_ptr14 + (x0 + (4*x2)), tmp87 & xmask, eviction_policy='evict_last', other=0.0)
    tmp89 = tl.full([1], 14, tl.int64)
    tmp90 = tmp0 >= tmp89
    tmp91 = tmp0 < tmp84
    tmp92 = tmp90 & tmp91
    tmp93 = tl.load(in_ptr15 + (x0 + (4*x2)), tmp92 & xmask, eviction_policy='evict_last', other=0.0)
    tmp94 = tmp0 >= tmp56
    tmp95 = tmp0 < tmp89
    tmp96 = tmp94 & tmp95
    tmp97 = tl.load(in_ptr16 + (x0 + (4*x2)), tmp96 & xmask, eviction_policy='evict_last', other=0.0)
    tmp98 = tl.where(tmp96, tmp97, tmp77)
    tmp99 = tl.where(tmp92, tmp93, tmp98)
    tmp100 = tl.where(tmp87, tmp88, tmp99)
    tmp101 = tl.where(tmp82, tmp83, tmp100)
    tmp102 = tl.full([1], 20, tl.int64)
    tmp103 = tmp0 >= tmp102
    tmp104 = tl.full([1], 21, tl.int64)
    tmp105 = tmp0 < tmp104
    tmp106 = tmp103 & tmp105
    tmp107 = tl.load(in_ptr17 + (x0 + (4*x2)), tmp106 & xmask, eviction_policy='evict_last', other=0.0)
    tmp108 = tl.full([1], 19, tl.int64)
    tmp109 = tmp0 >= tmp108
    tmp110 = tmp0 < tmp102
    tmp111 = tmp109 & tmp110
    tmp112 = tl.load(in_ptr18 + (x0 + (4*x2)), tmp111 & xmask, eviction_policy='evict_last', other=0.0)
    tmp113 = tl.full([1], 18, tl.int64)
    tmp114 = tmp0 >= tmp113
    tmp115 = tmp0 < tmp108
    tmp116 = tmp114 & tmp115
    tmp117 = tl.load(in_ptr19 + (x0 + (4*x2)), tmp116 & xmask, eviction_policy='evict_last', other=0.0)
    tmp118 = tmp0 >= tmp80
    tmp119 = tmp0 < tmp113
    tmp120 = tmp118 & tmp119
    tmp121 = tl.load(in_ptr20 + (x0 + (4*x2)), tmp120 & xmask, eviction_policy='evict_last', other=0.0)
    tmp122 = tl.where(tmp120, tmp121, tmp101)
    tmp123 = tl.where(tmp116, tmp117, tmp122)
    tmp124 = tl.where(tmp111, tmp112, tmp123)
    tmp125 = tl.where(tmp106, tmp107, tmp124)
    tmp126 = tl.full([1], 24, tl.int64)
    tmp127 = tmp0 >= tmp126
    tmp128 = tl.full([1], 25, tl.int64)
    tmp129 = tmp0 < tmp128
    tmp130 = tmp127 & tmp129
    tmp131 = tl.load(in_ptr21 + (x0 + (4*x2)), tmp130 & xmask, eviction_policy='evict_last', other=0.0)
    tmp132 = tl.full([1], 23, tl.int64)
    tmp133 = tmp0 >= tmp132
    tmp134 = tmp0 < tmp126
    tmp135 = tmp133 & tmp134
    tmp136 = tl.load(in_ptr22 + (x0 + (4*x2)), tmp135 & xmask, eviction_policy='evict_last', other=0.0)
    tmp137 = tl.full([1], 22, tl.int64)
    tmp138 = tmp0 >= tmp137
    tmp139 = tmp0 < tmp132
    tmp140 = tmp138 & tmp139
    tmp141 = tl.load(in_ptr23 + (x0 + (4*x2)), tmp140 & xmask, eviction_policy='evict_last', other=0.0)
    tmp142 = tmp0 >= tmp104
    tmp143 = tmp0 < tmp137
    tmp144 = tmp142 & tmp143
    tmp145 = tl.load(in_ptr24 + (x0 + (4*x2)), tmp144 & xmask, eviction_policy='evict_last', other=0.0)
    tmp146 = tl.where(tmp144, tmp145, tmp125)
    tmp147 = tl.where(tmp140, tmp141, tmp146)
    tmp148 = tl.where(tmp135, tmp136, tmp147)
    tmp149 = tl.where(tmp130, tmp131, tmp148)
    tmp150 = tl.full([1], 28, tl.int64)
    tmp151 = tmp0 >= tmp150
    tmp152 = tl.full([1], 29, tl.int64)
    tmp153 = tmp0 < tmp152
    tmp154 = tmp151 & tmp153
    tmp155 = tl.load(in_ptr25 + (x0 + (4*x2)), tmp154 & xmask, eviction_policy='evict_last', other=0.0)
    tmp156 = tl.full([1], 27, tl.int64)
    tmp157 = tmp0 >= tmp156
    tmp158 = tmp0 < tmp150
    tmp159 = tmp157 & tmp158
    tmp160 = tl.load(in_ptr26 + (x0 + (4*x2)), tmp159 & xmask, eviction_policy='evict_last', other=0.0)
    tmp161 = tl.full([1], 26, tl.int64)
    tmp162 = tmp0 >= tmp161
    tmp163 = tmp0 < tmp156
    tmp164 = tmp162 & tmp163
    tmp165 = tl.load(in_ptr27 + (x0 + (4*x2)), tmp164 & xmask, eviction_policy='evict_last', other=0.0)
    tmp166 = tmp0 >= tmp128
    tmp167 = tmp0 < tmp161
    tmp168 = tmp166 & tmp167
    tmp169 = tl.load(in_ptr28 + (x0 + (4*x2)), tmp168 & xmask, eviction_policy='evict_last', other=0.0)
    tmp170 = tl.where(tmp168, tmp169, tmp149)
    tmp171 = tl.where(tmp164, tmp165, tmp170)
    tmp172 = tl.where(tmp159, tmp160, tmp171)
    tmp173 = tl.where(tmp154, tmp155, tmp172)
    tmp174 = tl.full([1], 32, tl.int64)
    tmp175 = tmp0 >= tmp174
    tmp176 = tl.full([1], 33, tl.int64)
    tmp177 = tmp0 < tmp176
    tmp178 = tmp175 & tmp177
    tmp179 = tl.load(in_ptr29 + (x0 + (4*x2)), tmp178 & xmask, eviction_policy='evict_last', other=0.0)
    tmp180 = tl.full([1], 31, tl.int64)
    tmp181 = tmp0 >= tmp180
    tmp182 = tmp0 < tmp174
    tmp183 = tmp181 & tmp182
    tmp184 = tl.load(in_ptr30 + (x0 + (4*x2)), tmp183 & xmask, eviction_policy='evict_last', other=0.0)
    tmp185 = tl.full([1], 30, tl.int64)
    tmp186 = tmp0 >= tmp185
    tmp187 = tmp0 < tmp180
    tmp188 = tmp186 & tmp187
    tmp189 = tl.load(in_ptr31 + (x0 + (4*x2)), tmp188 & xmask, eviction_policy='evict_last', other=0.0)
    tmp190 = tmp0 >= tmp152
    tmp191 = tmp0 < tmp185
    tmp192 = tmp190 & tmp191
    tmp193 = tl.load(in_ptr32 + (x0 + (4*x2)), tmp192 & xmask, eviction_policy='evict_last', other=0.0)
    tmp194 = tl.where(tmp192, tmp193, tmp173)
    tmp195 = tl.where(tmp188, tmp189, tmp194)
    tmp196 = tl.where(tmp183, tmp184, tmp195)
    tmp197 = tl.where(tmp178, tmp179, tmp196)
    tmp198 = tl.full([1], 36, tl.int64)
    tmp199 = tmp0 >= tmp198
    tmp200 = tl.full([1], 37, tl.int64)
    tmp201 = tmp0 < tmp200
    tmp202 = tmp199 & tmp201
    tmp203 = tl.load(in_ptr33 + (x0 + (4*x2)), tmp202 & xmask, eviction_policy='evict_last', other=0.0)
    tmp204 = tl.full([1], 35, tl.int64)
    tmp205 = tmp0 >= tmp204
    tmp206 = tmp0 < tmp198
    tmp207 = tmp205 & tmp206
    tmp208 = tl.load(in_ptr34 + (x0 + (4*x2)), tmp207 & xmask, eviction_policy='evict_last', other=0.0)
    tmp209 = tl.full([1], 34, tl.int64)
    tmp210 = tmp0 >= tmp209
    tmp211 = tmp0 < tmp204
    tmp212 = tmp210 & tmp211
    tmp213 = tl.load(in_ptr35 + (x0 + (4*x2)), tmp212 & xmask, eviction_policy='evict_last', other=0.0)
    tmp214 = tmp0 >= tmp176
    tmp215 = tmp0 < tmp209
    tmp216 = tmp214 & tmp215
    tmp217 = tl.load(in_ptr36 + (x0 + (4*x2)), tmp216 & xmask, eviction_policy='evict_last', other=0.0)
    tmp218 = tl.where(tmp216, tmp217, tmp197)
    tmp219 = tl.where(tmp212, tmp213, tmp218)
    tmp220 = tl.where(tmp207, tmp208, tmp219)
    tmp221 = tl.where(tmp202, tmp203, tmp220)
    tmp222 = tl.full([1], 40, tl.int64)
    tmp223 = tmp0 >= tmp222
    tmp224 = tl.full([1], 41, tl.int64)
    tmp225 = tmp0 < tmp224
    tmp226 = tmp223 & tmp225
    tmp227 = tl.load(in_ptr37 + (x0 + (4*x2)), tmp226 & xmask, eviction_policy='evict_last', other=0.0)
    tmp228 = tl.full([1], 39, tl.int64)
    tmp229 = tmp0 >= tmp228
    tmp230 = tmp0 < tmp222
    tmp231 = tmp229 & tmp230
    tmp232 = tl.load(in_ptr38 + (x0 + (4*x2)), tmp231 & xmask, eviction_policy='evict_last', other=0.0)
    tmp233 = tl.full([1], 38, tl.int64)
    tmp234 = tmp0 >= tmp233
    tmp235 = tmp0 < tmp228
    tmp236 = tmp234 & tmp235
    tmp237 = tl.load(in_ptr39 + (x0 + (4*x2)), tmp236 & xmask, eviction_policy='evict_last', other=0.0)
    tmp238 = tmp0 >= tmp200
    tmp239 = tmp0 < tmp233
    tmp240 = tmp238 & tmp239
    tmp241 = tl.load(in_ptr40 + (x0 + (4*x2)), tmp240 & xmask, eviction_policy='evict_last', other=0.0)
    tmp242 = tl.where(tmp240, tmp241, tmp221)
    tmp243 = tl.where(tmp236, tmp237, tmp242)
    tmp244 = tl.where(tmp231, tmp232, tmp243)
    tmp245 = tl.where(tmp226, tmp227, tmp244)
    tmp246 = tl.full([1], 44, tl.int64)
    tmp247 = tmp0 >= tmp246
    tmp248 = tl.full([1], 45, tl.int64)
    tmp249 = tmp0 < tmp248
    tmp250 = tmp247 & tmp249
    tmp251 = tl.load(in_ptr41 + (x0 + (4*x2)), tmp250 & xmask, eviction_policy='evict_last', other=0.0)
    tmp252 = tl.full([1], 43, tl.int64)
    tmp253 = tmp0 >= tmp252
    tmp254 = tmp0 < tmp246
    tmp255 = tmp253 & tmp254
    tmp256 = tl.load(in_ptr42 + (x0 + (4*x2)), tmp255 & xmask, eviction_policy='evict_last', other=0.0)
    tmp257 = tl.full([1], 42, tl.int64)
    tmp258 = tmp0 >= tmp257
    tmp259 = tmp0 < tmp252
    tmp260 = tmp258 & tmp259
    tmp261 = tl.load(in_ptr43 + (x0 + (4*x2)), tmp260 & xmask, eviction_policy='evict_last', other=0.0)
    tmp262 = tmp0 >= tmp224
    tmp263 = tmp0 < tmp257
    tmp264 = tmp262 & tmp263
    tmp265 = tl.load(in_ptr44 + (x0 + (4*x2)), tmp264 & xmask, eviction_policy='evict_last', other=0.0)
    tmp266 = tl.where(tmp264, tmp265, tmp245)
    tmp267 = tl.where(tmp260, tmp261, tmp266)
    tmp268 = tl.where(tmp255, tmp256, tmp267)
    tmp269 = tl.where(tmp250, tmp251, tmp268)
    tmp270 = tl.full([1], 48, tl.int64)
    tmp271 = tmp0 >= tmp270
    tmp272 = tl.full([1], 49, tl.int64)
    tmp273 = tmp0 < tmp272
    tmp274 = tmp271 & tmp273
    tmp275 = tl.load(in_ptr45 + (x0 + (4*x2)), tmp274 & xmask, eviction_policy='evict_last', other=0.0)
    tmp276 = tl.full([1], 47, tl.int64)
    tmp277 = tmp0 >= tmp276
    tmp278 = tmp0 < tmp270
    tmp279 = tmp277 & tmp278
    tmp280 = tl.load(in_ptr46 + (x0 + (4*x2)), tmp279 & xmask, eviction_policy='evict_last', other=0.0)
    tmp281 = tl.full([1], 46, tl.int64)
    tmp282 = tmp0 >= tmp281
    tmp283 = tmp0 < tmp276
    tmp284 = tmp282 & tmp283
    tmp285 = tl.load(in_ptr47 + (x0 + (4*x2)), tmp284 & xmask, eviction_policy='evict_last', other=0.0)
    tmp286 = tmp0 >= tmp248
    tmp287 = tmp0 < tmp281
    tmp288 = tmp286 & tmp287
    tmp289 = tl.load(in_ptr48 + (x0 + (4*x2)), tmp288 & xmask, eviction_policy='evict_last', other=0.0)
    tmp290 = tl.where(tmp288, tmp289, tmp269)
    tmp291 = tl.where(tmp284, tmp285, tmp290)
    tmp292 = tl.where(tmp279, tmp280, tmp291)
    tmp293 = tl.where(tmp274, tmp275, tmp292)
    tmp294 = tl.full([1], 52, tl.int64)
    tmp295 = tmp0 >= tmp294
    tmp296 = tl.full([1], 53, tl.int64)
    tmp297 = tmp0 < tmp296
    tmp298 = tmp295 & tmp297
    tmp299 = tl.load(in_ptr49 + (x0 + (4*x2)), tmp298 & xmask, eviction_policy='evict_last', other=0.0)
    tmp300 = tl.full([1], 51, tl.int64)
    tmp301 = tmp0 >= tmp300
    tmp302 = tmp0 < tmp294
    tmp303 = tmp301 & tmp302
    tmp304 = tl.load(in_ptr50 + (x0 + (4*x2)), tmp303 & xmask, eviction_policy='evict_last', other=0.0)
    tmp305 = tl.full([1], 50, tl.int64)
    tmp306 = tmp0 >= tmp305
    tmp307 = tmp0 < tmp300
    tmp308 = tmp306 & tmp307
    tmp309 = tl.load(in_ptr51 + (x0 + (4*x2)), tmp308 & xmask, eviction_policy='evict_last', other=0.0)
    tmp310 = tmp0 >= tmp272
    tmp311 = tmp0 < tmp305
    tmp312 = tmp310 & tmp311
    tmp313 = tl.load(in_ptr52 + (x0 + (4*x2)), tmp312 & xmask, eviction_policy='evict_last', other=0.0)
    tmp314 = tl.where(tmp312, tmp313, tmp293)
    tmp315 = tl.where(tmp308, tmp309, tmp314)
    tmp316 = tl.where(tmp303, tmp304, tmp315)
    tmp317 = tl.where(tmp298, tmp299, tmp316)
    tmp318 = tl.full([1], 56, tl.int64)
    tmp319 = tmp0 >= tmp318
    tmp320 = tl.full([1], 57, tl.int64)
    tmp321 = tmp0 < tmp320
    tmp322 = tmp319 & tmp321
    tmp323 = tl.load(in_ptr53 + (x0 + (4*x2)), tmp322 & xmask, eviction_policy='evict_last', other=0.0)
    tmp324 = tl.full([1], 55, tl.int64)
    tmp325 = tmp0 >= tmp324
    tmp326 = tmp0 < tmp318
    tmp327 = tmp325 & tmp326
    tmp328 = tl.load(in_ptr54 + (x0 + (4*x2)), tmp327 & xmask, eviction_policy='evict_last', other=0.0)
    tmp329 = tl.full([1], 54, tl.int64)
    tmp330 = tmp0 >= tmp329
    tmp331 = tmp0 < tmp324
    tmp332 = tmp330 & tmp331
    tmp333 = tl.load(in_ptr55 + (x0 + (4*x2)), tmp332 & xmask, eviction_policy='evict_last', other=0.0)
    tmp334 = tmp0 >= tmp296
    tmp335 = tmp0 < tmp329
    tmp336 = tmp334 & tmp335
    tmp337 = tl.load(in_ptr56 + (x0 + (4*x2)), tmp336 & xmask, eviction_policy='evict_last', other=0.0)
    tmp338 = tl.where(tmp336, tmp337, tmp317)
    tmp339 = tl.where(tmp332, tmp333, tmp338)
    tmp340 = tl.where(tmp327, tmp328, tmp339)
    tmp341 = tl.where(tmp322, tmp323, tmp340)
    tmp342 = tl.full([1], 60, tl.int64)
    tmp343 = tmp0 >= tmp342
    tmp344 = tl.full([1], 61, tl.int64)
    tmp345 = tmp0 < tmp344
    tmp346 = tmp343 & tmp345
    tmp347 = tl.load(in_ptr57 + (x0 + (4*x2)), tmp346 & xmask, eviction_policy='evict_last', other=0.0)
    tmp348 = tl.full([1], 59, tl.int64)
    tmp349 = tmp0 >= tmp348
    tmp350 = tmp0 < tmp342
    tmp351 = tmp349 & tmp350
    tmp352 = tl.load(in_ptr58 + (x0 + (4*x2)), tmp351 & xmask, eviction_policy='evict_last', other=0.0)
    tmp353 = tl.full([1], 58, tl.int64)
    tmp354 = tmp0 >= tmp353
    tmp355 = tmp0 < tmp348
    tmp356 = tmp354 & tmp355
    tmp357 = tl.load(in_ptr59 + (x0 + (4*x2)), tmp356 & xmask, eviction_policy='evict_last', other=0.0)
    tmp358 = tmp0 >= tmp320
    tmp359 = tmp0 < tmp353
    tmp360 = tmp358 & tmp359
    tmp361 = tl.load(in_ptr60 + (x0 + (4*x2)), tmp360 & xmask, eviction_policy='evict_last', other=0.0)
    tmp362 = tl.where(tmp360, tmp361, tmp341)
    tmp363 = tl.where(tmp356, tmp357, tmp362)
    tmp364 = tl.where(tmp351, tmp352, tmp363)
    tmp365 = tl.where(tmp346, tmp347, tmp364)
    tmp366 = tl.full([1], 63, tl.int64)
    tmp367 = tmp0 >= tmp366
    tmp368 = tl.load(in_ptr61 + (x0 + (4*x2)), tmp367 & xmask, eviction_policy='evict_last', other=0.0)
    tmp369 = tl.full([1], 62, tl.int64)
    tmp370 = tmp0 >= tmp369
    tmp371 = tmp0 < tmp366
    tmp372 = tmp370 & tmp371
    tmp373 = tl.load(in_ptr62 + (x0 + (4*x2)), tmp372 & xmask, eviction_policy='evict_last', other=0.0)
    tmp374 = tmp0 >= tmp344
    tmp375 = tmp0 < tmp369
    tmp376 = tmp374 & tmp375
    tmp377 = tl.load(in_ptr63 + (x0 + (4*x2)), tmp376 & xmask, eviction_policy='evict_last', other=0.0)
    tmp378 = tl.where(tmp376, tmp377, tmp365)
    tmp379 = tl.where(tmp372, tmp373, tmp378)
    tmp380 = tl.where(tmp367, tmp368, tmp379)
    tl.store(in_out_ptr0 + (x3), tmp380, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/wo/cwoqglscqofsrwvjna2wblwxhomdjbzeemiddjzs3znbybhuucvg.py
# Topologically Sorted Source Nodes: [vlad_1, vlad_3], Original ATen: [aten.div, aten.linalg_vector_norm]
# Source node to ATen node mapping:
#   vlad_1 => div_1
#   vlad_3 => div_2, pow_3, pow_4, sum_67
# Graph fragment:
#   %div_1 : [num_users=1] = call_function[target=torch.ops.aten.div.Tensor](args = (%slice_scatter_default_63, %expand_64), kwargs = {})
#   %pow_3 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Scalar](args = (%view_2, 2), kwargs = {})
#   %sum_67 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_3, [1], True), kwargs = {})
#   %pow_4 : [num_users=2] = call_function[target=torch.ops.aten.pow.Tensor_Scalar](args = (%sum_67, 0.5), kwargs = {})
#   %div_2 : [num_users=1] = call_function[target=torch.ops.aten.div.Tensor](args = (%view_2, %expand_65), kwargs = {})
triton_red_fused_div_linalg_vector_norm_5 = async_compile.triton('triton_red_fused_div_linalg_vector_norm_5', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

from torch._inductor.runtime import triton_helpers, triton_heuristics
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, instance_descriptor, DeviceProperties

@triton_heuristics.reduction(
    size_hints=[4, 256],
    reduction_hint=ReductionHint.DEFAULT,
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: 'i32', 5: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 5), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_red_fused_div_linalg_vector_norm_5', 'mutated_arg_names': ['in_out_ptr0'], 'no_x_dim': False, 'num_load': 6, 'num_reduction': 1, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False}
)
@triton.jit
def triton_red_fused_div_linalg_vector_norm_5(in_out_ptr0, in_ptr0, out_ptr0, out_ptr1, xnumel, rnumel, XBLOCK : tl.constexpr, RBLOCK : tl.constexpr):
    xnumel = 4
    rnumel = 256
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    rbase = tl.arange(0, RBLOCK)[None, :]
    x0 = xindex
    _tmp18 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    for roffset in range(0, rnumel, RBLOCK):
        rindex = roffset + rbase
        rmask = rindex < rnumel
        r3 = rindex
        r2 = (rindex // 4)
        tmp0 = tl.load(in_ptr0 + (r3 + (256*x0)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp1 = tl.load(in_ptr0 + ((4*r2) + (256*x0)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp3 = tl.load(in_ptr0 + (1 + (4*r2) + (256*x0)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp6 = tl.load(in_ptr0 + (2 + (4*r2) + (256*x0)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp9 = tl.load(in_ptr0 + (3 + (4*r2) + (256*x0)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp2 = tmp1 * tmp1
        tmp4 = tmp3 * tmp3
        tmp5 = tmp2 + tmp4
        tmp7 = tmp6 * tmp6
        tmp8 = tmp5 + tmp7
        tmp10 = tmp9 * tmp9
        tmp11 = tmp8 + tmp10
        tmp12 = libdevice.sqrt(tmp11)
        tmp13 = 1e-12
        tmp14 = triton_helpers.maximum(tmp12, tmp13)
        tmp15 = tmp0 / tmp14
        tmp16 = tmp15 * tmp15
        tmp17 = tl.broadcast_to(tmp16, [XBLOCK, RBLOCK])
        tmp19 = _tmp18 + tmp17
        _tmp18 = tl.where(rmask & xmask, tmp19, _tmp18)
        tl.store(out_ptr0 + (r3 + (256*x0)), tmp15, rmask & xmask)
    tmp18 = tl.sum(_tmp18, 1)[:, None]
    tmp20 = libdevice.sqrt(tmp18)
    tl.debug_barrier()
    tl.store(in_out_ptr0 + (x0), tmp20, xmask)
    for roffset in range(0, rnumel, RBLOCK):
        rindex = roffset + rbase
        rmask = rindex < rnumel
        r3 = rindex
        tmp21 = tl.load(out_ptr0 + (r3 + (256*x0)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp22 = 1e-12
        tmp23 = triton_helpers.maximum(tmp20, tmp22)
        tmp24 = tmp21 / tmp23
        tl.store(out_ptr1 + (r3 + (256*x0)), tmp24, rmask & xmask)
''', device_str='cuda')


async_compile.wait(globals())
del async_compile

def call(args):
    primals_1, primals_2, primals_3 = args
    args.clear()
    assert_size_stride(primals_1, (4, 4, 4, 4), (64, 16, 4, 1))
    assert_size_stride(primals_2, (64, 4, 1, 1), (4, 1, 1, 1))
    assert_size_stride(primals_3, (64, 4), (4, 1))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        # Topologically Sorted Source Nodes: [conv2d], Original ATen: [aten.convolution]
        buf0 = extern_kernels.convolution(primals_1, primals_2, stride=(1, 1), padding=(0, 0), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf0, (4, 64, 4, 4), (1024, 16, 4, 1))
        buf1 = empty_strided_cuda((4, 1, 16), (16, 16, 1), torch.float32)
        buf2 = empty_strided_cuda((4, 1, 16), (16, 16, 1), torch.float32)
        # Topologically Sorted Source Nodes: [soft_assign_1], Original ATen: [aten._softmax]
        stream0 = get_raw_stream(0)
        triton_per_fused__softmax_0.run(buf0, buf1, buf2, 64, 64, grid=grid(64), stream=stream0)
        buf4 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf6 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf8 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf10 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf13 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf15 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf17 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf19 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf22 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf24 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf26 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf28 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf31 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf33 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf35 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf37 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf40 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf42 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf44 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf46 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf49 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf51 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf53 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf55 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf58 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf60 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf62 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf64 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf3 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf5 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf7 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf9 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf11 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf14 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf16 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf18 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf20 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf23 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf25 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf27 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf29 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf32 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf34 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf36 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf38 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf41 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf43 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf45 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf47 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf50 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf52 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf54 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf56 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf59 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf61 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf63 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf65 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        # Topologically Sorted Source Nodes: [residual, residual_1, sum_1, residual_2, residual_3, sum_2, residual_4, residual_5, sum_3, residual_6, residual_7, sum_4, residual_8, residual_9, sum_5, residual_10, residual_11, sum_6, residual_12, residual_13, sum_7, residual_14, residual_15, sum_8, residual_16, residual_17, sum_9, residual_18, residual_19, sum_10, residual_20, residual_21, sum_11, residual_22, residual_23, sum_12, residual_24, residual_25, sum_13, residual_26, residual_27, sum_14, residual_28, residual_29, sum_15, residual_30, residual_31, sum_16, residual_32, residual_33, sum_17, residual_34, residual_35, sum_18, residual_36, residual_37, sum_19, residual_38, residual_39, sum_20, residual_40, residual_41, sum_21, residual_42, residual_43, sum_22, residual_44, residual_45, sum_23, residual_46, residual_47, sum_24, residual_48, residual_49, sum_25, residual_50, residual_51, sum_26, residual_52, residual_53, sum_27, residual_54, residual_55, sum_28, residual_56, residual_57, sum_29], Original ATen: [aten.sub, aten.mul, aten.sum]
        triton_per_fused_mul_sub_sum_1.run(primals_1, primals_3, buf0, buf1, buf2, buf4, buf6, buf8, buf10, buf13, buf15, buf17, buf19, buf22, buf24, buf26, buf28, buf31, buf33, buf35, buf37, buf40, buf42, buf44, buf46, buf49, buf51, buf53, buf55, buf58, buf60, buf62, buf64, buf3, buf5, buf7, buf9, buf11, buf14, buf16, buf18, buf20, buf23, buf25, buf27, buf29, buf32, buf34, buf36, buf38, buf41, buf43, buf45, buf47, buf50, buf52, buf54, buf56, buf59, buf61, buf63, buf65, 16, 16, grid=grid(16), stream=stream0)
        buf67 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf69 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf71 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf73 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf76 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf78 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf80 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf82 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf85 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf87 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf89 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf91 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf94 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf96 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf98 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf100 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf103 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf105 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf107 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf109 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf112 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf114 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf116 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf118 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf121 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf123 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf125 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf127 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf68 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf70 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf72 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf74 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf77 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf79 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf81 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf83 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf86 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf88 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf90 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf92 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf95 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf97 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf99 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf101 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf104 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf106 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf108 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf110 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf113 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf115 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf117 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf119 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf122 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf124 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf126 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf128 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        # Topologically Sorted Source Nodes: [residual_58, residual_59, sum_30, residual_60, residual_61, sum_31, residual_62, residual_63, sum_32, residual_64, residual_65, sum_33, residual_66, residual_67, sum_34, residual_68, residual_69, sum_35, residual_70, residual_71, sum_36, residual_72, residual_73, sum_37, residual_74, residual_75, sum_38, residual_76, residual_77, sum_39, residual_78, residual_79, sum_40, residual_80, residual_81, sum_41, residual_82, residual_83, sum_42, residual_84, residual_85, sum_43, residual_86, residual_87, sum_44, residual_88, residual_89, sum_45, residual_90, residual_91, sum_46, residual_92, residual_93, sum_47, residual_94, residual_95, sum_48, residual_96, residual_97, sum_49, residual_98, residual_99, sum_50, residual_100, residual_101, sum_51, residual_102, residual_103, sum_52, residual_104, residual_105, sum_53, residual_106, residual_107, sum_54, residual_108, residual_109, sum_55, residual_110, residual_111, sum_56, residual_112, residual_113, sum_57], Original ATen: [aten.sub, aten.mul, aten.sum]
        triton_per_fused_mul_sub_sum_2.run(primals_1, primals_3, buf0, buf1, buf2, buf67, buf69, buf71, buf73, buf76, buf78, buf80, buf82, buf85, buf87, buf89, buf91, buf94, buf96, buf98, buf100, buf103, buf105, buf107, buf109, buf112, buf114, buf116, buf118, buf121, buf123, buf125, buf127, buf68, buf70, buf72, buf74, buf77, buf79, buf81, buf83, buf86, buf88, buf90, buf92, buf95, buf97, buf99, buf101, buf104, buf106, buf108, buf110, buf113, buf115, buf117, buf119, buf122, buf124, buf126, buf128, 16, 16, grid=grid(16), stream=stream0)
        buf130 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf132 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf134 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf136 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf139 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf141 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf143 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.float32)
        buf131 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf133 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf135 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf137 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf140 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf142 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf144 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        # Topologically Sorted Source Nodes: [residual_114, residual_115, sum_58, residual_116, residual_117, sum_59, residual_118, residual_119, sum_60, residual_120, residual_121, sum_61, residual_122, residual_123, sum_62, residual_124, residual_125, sum_63, residual_126, residual_127, sum_64], Original ATen: [aten.sub, aten.mul, aten.sum]
        triton_per_fused_mul_sub_sum_3.run(primals_1, primals_3, buf0, buf1, buf2, buf130, buf132, buf134, buf136, buf139, buf141, buf143, buf131, buf133, buf135, buf137, buf140, buf142, buf144, 16, 16, grid=grid(16), stream=stream0)
        buf12 = empty_strided_cuda((4, 64, 4), (256, 4, 1), torch.float32)
        buf21 = buf12; del buf12  # reuse
        buf30 = buf21; del buf21  # reuse
        buf39 = buf30; del buf30  # reuse
        buf48 = buf39; del buf39  # reuse
        buf57 = buf48; del buf48  # reuse
        buf66 = buf57; del buf57  # reuse
        buf75 = buf66; del buf66  # reuse
        buf84 = buf75; del buf75  # reuse
        buf93 = buf84; del buf84  # reuse
        buf102 = buf93; del buf93  # reuse
        buf111 = buf102; del buf102  # reuse
        buf120 = buf111; del buf111  # reuse
        buf129 = buf120; del buf120  # reuse
        buf138 = buf129; del buf129  # reuse
        buf145 = buf138; del buf138  # reuse
        # Topologically Sorted Source Nodes: [vlad, setitem, setitem_1, setitem_2, setitem_3, setitem_4, setitem_5, setitem_6, setitem_7, setitem_8, setitem_9, setitem_10, setitem_11, setitem_12, setitem_13, setitem_14, setitem_15, setitem_16, setitem_17, setitem_18, setitem_19, setitem_20, setitem_21, setitem_22, setitem_23, setitem_24, setitem_25, setitem_26, setitem_27, setitem_28, setitem_29, setitem_30, setitem_31, setitem_32, setitem_33, setitem_34, setitem_35, setitem_36, setitem_37, setitem_38, setitem_39, setitem_40, setitem_41, setitem_42, setitem_43, setitem_44, setitem_45, setitem_46, setitem_47, setitem_48, setitem_49, setitem_50, setitem_51, setitem_52, setitem_53, setitem_54, setitem_55, setitem_56, setitem_57, setitem_58, setitem_59, setitem_60, setitem_61, setitem_62, setitem_63], Original ATen: [aten.zeros, aten.copy]
        triton_poi_fused_copy_zeros_4.run(buf145, buf11, buf9, buf7, buf5, buf3, buf20, buf18, buf16, buf14, buf29, buf27, buf25, buf23, buf38, buf36, buf34, buf32, buf47, buf45, buf43, buf41, buf56, buf54, buf52, buf50, buf65, buf63, buf61, buf59, buf74, buf72, buf70, buf68, buf83, buf81, buf79, buf77, buf92, buf90, buf88, buf86, buf101, buf99, buf97, buf95, buf110, buf108, buf106, buf104, buf119, buf117, buf115, buf113, buf128, buf126, buf124, buf122, buf137, buf135, buf133, buf131, buf144, buf142, buf140, 1024, grid=grid(1024), stream=stream0)
        del buf101
        del buf104
        del buf106
        del buf108
        del buf11
        del buf110
        del buf113
        del buf115
        del buf117
        del buf119
        del buf122
        del buf124
        del buf126
        del buf128
        del buf131
        del buf133
        del buf135
        del buf137
        del buf14
        del buf140
        del buf142
        del buf144
        del buf16
        del buf18
        del buf20
        del buf23
        del buf25
        del buf27
        del buf29
        del buf3
        del buf32
        del buf34
        del buf36
        del buf38
        del buf41
        del buf43
        del buf45
        del buf47
        del buf5
        del buf50
        del buf52
        del buf54
        del buf56
        del buf59
        del buf61
        del buf63
        del buf65
        del buf68
        del buf7
        del buf70
        del buf72
        del buf74
        del buf77
        del buf79
        del buf81
        del buf83
        del buf86
        del buf88
        del buf9
        del buf90
        del buf92
        del buf95
        del buf97
        del buf99
        buf146 = empty_strided_cuda((4, 64, 4), (256, 4, 1), torch.float32)
        buf147 = empty_strided_cuda((4, 1), (1, 4), torch.float32)
        buf148 = reinterpret_tensor(buf147, (4, 1), (1, 1), 0); del buf147  # reuse
        buf149 = empty_strided_cuda((4, 256), (256, 1), torch.float32)
        # Topologically Sorted Source Nodes: [vlad_1, vlad_3], Original ATen: [aten.div, aten.linalg_vector_norm]
        triton_red_fused_div_linalg_vector_norm_5.run(buf148, buf145, buf146, buf149, 4, 256, grid=grid(4), stream=stream0)
        del buf146
    return (buf149, primals_1, primals_2, buf0, buf1, buf2, reinterpret_tensor(primals_3, (1, 4), (4, 1), 0), buf4, buf6, buf8, buf10, buf13, buf15, buf17, buf19, buf22, buf24, buf26, buf28, buf31, buf33, buf35, buf37, buf40, buf42, buf44, buf46, buf49, buf51, buf53, buf55, buf58, buf60, buf62, buf64, buf67, buf69, buf71, buf73, buf76, buf78, buf80, buf82, buf85, buf87, buf89, buf91, buf94, buf96, buf98, buf100, buf103, buf105, buf107, buf109, buf112, buf114, buf116, buf118, buf121, buf123, buf125, buf127, buf130, buf132, buf134, buf136, buf139, buf141, buf143, buf145, buf148, )


def benchmark_compiled_module(times=10, repeat=10):
    from torch._dynamo.testing import rand_strided
    from torch._inductor.utils import print_performance
    primals_1 = rand_strided((4, 4, 4, 4), (64, 16, 4, 1), device='cuda:0', dtype=torch.float32)
    primals_2 = rand_strided((64, 4, 1, 1), (4, 1, 1, 1), device='cuda:0', dtype=torch.float32)
    primals_3 = rand_strided((64, 4), (4, 1), device='cuda:0', dtype=torch.float32)
    fn = lambda: call([primals_1, primals_2, primals_3])
    return print_performance(fn, times=times, repeat=repeat)


if __name__ == "__main__":
    from torch._inductor.wrapper_benchmark import compiled_module_main
    compiled_module_main('None', benchmark_compiled_module)

import torch
import numpy as np
from torch import nn
import torch.nn.functional as F


class NetVLAD(nn.Module):
    """NetVLAD layer implementation"""

    def __init__(self, dim, num_clusters=64):
        """
        Args:
            dim : int
                Dimension of descriptors
            num_clusters : int
                The number of clusters
        """
        super(NetVLAD, self).__init__()
        self.num_clusters = num_clusters
        self.conv = nn.Conv2d(dim, num_clusters, kernel_size=(1, 1), bias=False
            )
        self.centroids = nn.Parameter(torch.rand(num_clusters, dim))

    def init_params(self, clsts, traindescs):
        clsts_assign = clsts / np.linalg.norm(clsts, axis=1, keepdims=True)
        dots = np.dot(clsts_assign, traindescs.T)
        dots.sort(0)
        dots = dots[::-1, :]
        alpha = (-np.log(0.01) / np.mean(dots[0, :] - dots[1, :])).item()
        self.centroids = nn.Parameter(torch.from_numpy(clsts))
        self.conv.weight = nn.Parameter(torch.from_numpy(alpha *
            clsts_assign).unsqueeze(2).unsqueeze(3))
        self.conv.bias = None

    def forward(self, x, crm=None):
        N, C = x.shape[:2]
        soft_assign = self.conv(x).view(N, self.num_clusters, -1)
        soft_assign = F.softmax(soft_assign, dim=1)
        if crm is not None:
            assert crm.shape[0] == N and crm.shape[1] == 1 and crm.shape[2:
                ] == x.shape[2:]
            soft_assign = torch.mul(soft_assign, crm.view(N, 1, -1))
        x_flatten = x.view(N, C, -1)
        vlad = torch.zeros((N, self.num_clusters, C), dtype=x.dtype, layout
            =x.layout, device=x.device)
        for c in range(self.num_clusters):
            residual = x_flatten.unsqueeze(0).permute(1, 0, 2, 3
                ) - self.centroids[c:c + 1, :].expand(x_flatten.size(-1), -
                1, -1).permute(1, 2, 0).unsqueeze(0)
            residual *= soft_assign[:, c:c + 1, :].unsqueeze(2)
            vlad[:, c:c + 1, :] = residual.sum(dim=-1)
        vlad = F.normalize(vlad, p=2, dim=2)
        vlad = vlad.view(N, -1)
        vlad = F.normalize(vlad, p=2, dim=1)
        return vlad


def get_inputs():
    return [torch.rand([4, 4, 4, 4])]


def get_init_inputs():
    return [[], {'dim': 4}]

import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
import numpy as np
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor


@triton.jit
def triton_per_fused__softmax_0(in_ptr0, out_ptr0, out_ptr1, xnumel, rnumel,
    XBLOCK: tl.constexpr):
    xnumel = 64
    RBLOCK: tl.constexpr = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    rindex = tl.arange(0, RBLOCK)[None, :]
    tl.full([XBLOCK, RBLOCK], True, tl.int1)
    r2 = rindex
    x0 = xindex % 16
    x1 = xindex // 16
    x3 = xindex
    tmp0 = tl.load(in_ptr0 + (x0 + 16 * r2 + 1024 * x1), xmask, other=0.0)
    tmp1 = tl.broadcast_to(tmp0, [XBLOCK, RBLOCK])
    tmp3 = tl.where(xmask, tmp1, float('-inf'))
    tmp4 = triton_helpers.max2(tmp3, 1)[:, None]
    tmp5 = tmp0 - tmp4
    tmp6 = tl_math.exp(tmp5)
    tmp7 = tl.broadcast_to(tmp6, [XBLOCK, RBLOCK])
    tmp9 = tl.where(xmask, tmp7, 0)
    tmp10 = tl.sum(tmp9, 1)[:, None]
    tl.store(out_ptr0 + x3, tmp4, xmask)
    tl.store(out_ptr1 + x3, tmp10, xmask)


@triton.jit
def triton_per_fused_mul_sub_sum_1(in_ptr0, in_ptr1, in_ptr2, in_ptr3,
    in_ptr4, out_ptr0, out_ptr1, out_ptr2, out_ptr3, out_ptr4, out_ptr5,
    out_ptr6, out_ptr7, out_ptr8, out_ptr9, out_ptr10, out_ptr11, out_ptr12,
    out_ptr13, out_ptr14, out_ptr15, out_ptr16, out_ptr17, out_ptr18,
    out_ptr19, out_ptr20, out_ptr21, out_ptr22, out_ptr23, out_ptr24,
    out_ptr25, out_ptr26, out_ptr27, out_ptr28, out_ptr29, out_ptr30,
    out_ptr31, out_ptr32, out_ptr33, out_ptr34, out_ptr35, out_ptr36,
    out_ptr37, out_ptr38, out_ptr39, out_ptr40, out_ptr41, out_ptr42,
    out_ptr43, out_ptr44, out_ptr45, out_ptr46, out_ptr47, out_ptr48,
    out_ptr49, out_ptr50, out_ptr51, out_ptr52, out_ptr53, out_ptr54,
    out_ptr55, out_ptr56, xnumel, rnumel, XBLOCK: tl.constexpr):
    xnumel = 16
    RBLOCK: tl.constexpr = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    rindex = tl.arange(0, RBLOCK)[None, :]
    tl.full([XBLOCK, RBLOCK], True, tl.int1)
    r2 = rindex
    x3 = xindex
    x0 = xindex % 4
    x1 = xindex // 4
    tmp0 = tl.load(in_ptr0 + (r2 + 16 * x3), xmask, other=0.0)
    tmp1 = tl.load(in_ptr1 + (4 + x0), xmask, eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr1 + (8 + x0), xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr1 + (12 + x0), xmask, eviction_policy='evict_last')
    tmp7 = tl.load(in_ptr1 + (16 + x0), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr1 + (20 + x0), xmask, eviction_policy='evict_last')
    tmp11 = tl.load(in_ptr1 + (24 + x0), xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr1 + (28 + x0), xmask, eviction_policy='evict_last')
    tmp15 = tl.load(in_ptr1 + (32 + x0), xmask, eviction_policy='evict_last')
    tmp17 = tl.load(in_ptr1 + (36 + x0), xmask, eviction_policy='evict_last')
    tmp19 = tl.load(in_ptr1 + (40 + x0), xmask, eviction_policy='evict_last')
    tmp21 = tl.load(in_ptr1 + (44 + x0), xmask, eviction_policy='evict_last')
    tmp23 = tl.load(in_ptr1 + (48 + x0), xmask, eviction_policy='evict_last')
    tmp25 = tl.load(in_ptr1 + (52 + x0), xmask, eviction_policy='evict_last')
    tmp27 = tl.load(in_ptr1 + (56 + x0), xmask, eviction_policy='evict_last')
    tmp29 = tl.load(in_ptr1 + (60 + x0), xmask, eviction_policy='evict_last')
    tmp31 = tl.load(in_ptr1 + (64 + x0), xmask, eviction_policy='evict_last')
    tmp33 = tl.load(in_ptr1 + (68 + x0), xmask, eviction_policy='evict_last')
    tmp35 = tl.load(in_ptr1 + (72 + x0), xmask, eviction_policy='evict_last')
    tmp37 = tl.load(in_ptr1 + (76 + x0), xmask, eviction_policy='evict_last')
    tmp39 = tl.load(in_ptr1 + (80 + x0), xmask, eviction_policy='evict_last')
    tmp41 = tl.load(in_ptr1 + (84 + x0), xmask, eviction_policy='evict_last')
    tmp43 = tl.load(in_ptr1 + (88 + x0), xmask, eviction_policy='evict_last')
    tmp45 = tl.load(in_ptr1 + (92 + x0), xmask, eviction_policy='evict_last')
    tmp47 = tl.load(in_ptr1 + (96 + x0), xmask, eviction_policy='evict_last')
    tmp49 = tl.load(in_ptr1 + (100 + x0), xmask, eviction_policy='evict_last')
    tmp51 = tl.load(in_ptr1 + (104 + x0), xmask, eviction_policy='evict_last')
    tmp53 = tl.load(in_ptr1 + (108 + x0), xmask, eviction_policy='evict_last')
    tmp55 = tl.load(in_ptr1 + (112 + x0), xmask, eviction_policy='evict_last')
    tmp57 = tl.load(in_ptr1 + x0, xmask, eviction_policy='evict_last')
    tmp59 = tl.load(in_ptr2 + (r2 + 1024 * x1), xmask, eviction_policy=
        'evict_last', other=0.0)
    tmp60 = tl.load(in_ptr3 + (r2 + 16 * x1), xmask, eviction_policy=
        'evict_last', other=0.0)
    tmp63 = tl.load(in_ptr4 + (r2 + 16 * x1), xmask, eviction_policy=
        'evict_last', other=0.0)
    tmp70 = tl.load(in_ptr2 + (16 + r2 + 1024 * x1), xmask, eviction_policy
        ='evict_last', other=0.0)
    tmp79 = tl.load(in_ptr2 + (32 + r2 + 1024 * x1), xmask, eviction_policy
        ='evict_last', other=0.0)
    tmp88 = tl.load(in_ptr2 + (48 + r2 + 1024 * x1), xmask, eviction_policy
        ='evict_last', other=0.0)
    tmp97 = tl.load(in_ptr2 + (64 + r2 + 1024 * x1), xmask, eviction_policy
        ='evict_last', other=0.0)
    tmp106 = tl.load(in_ptr2 + (80 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp115 = tl.load(in_ptr2 + (96 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp124 = tl.load(in_ptr2 + (112 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp133 = tl.load(in_ptr2 + (128 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp142 = tl.load(in_ptr2 + (144 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp151 = tl.load(in_ptr2 + (160 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp160 = tl.load(in_ptr2 + (176 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp169 = tl.load(in_ptr2 + (192 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp178 = tl.load(in_ptr2 + (208 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp187 = tl.load(in_ptr2 + (224 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp196 = tl.load(in_ptr2 + (240 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp205 = tl.load(in_ptr2 + (256 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp214 = tl.load(in_ptr2 + (272 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp223 = tl.load(in_ptr2 + (288 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp232 = tl.load(in_ptr2 + (304 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp241 = tl.load(in_ptr2 + (320 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp250 = tl.load(in_ptr2 + (336 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp259 = tl.load(in_ptr2 + (352 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp268 = tl.load(in_ptr2 + (368 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp277 = tl.load(in_ptr2 + (384 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp286 = tl.load(in_ptr2 + (400 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp295 = tl.load(in_ptr2 + (416 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp304 = tl.load(in_ptr2 + (432 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp313 = tl.load(in_ptr2 + (448 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp2 = tmp0 - tmp1
    tmp4 = tmp0 - tmp3
    tmp6 = tmp0 - tmp5
    tmp8 = tmp0 - tmp7
    tmp10 = tmp0 - tmp9
    tmp12 = tmp0 - tmp11
    tmp14 = tmp0 - tmp13
    tmp16 = tmp0 - tmp15
    tmp18 = tmp0 - tmp17
    tmp20 = tmp0 - tmp19
    tmp22 = tmp0 - tmp21
    tmp24 = tmp0 - tmp23
    tmp26 = tmp0 - tmp25
    tmp28 = tmp0 - tmp27
    tmp30 = tmp0 - tmp29
    tmp32 = tmp0 - tmp31
    tmp34 = tmp0 - tmp33
    tmp36 = tmp0 - tmp35
    tmp38 = tmp0 - tmp37
    tmp40 = tmp0 - tmp39
    tmp42 = tmp0 - tmp41
    tmp44 = tmp0 - tmp43
    tmp46 = tmp0 - tmp45
    tmp48 = tmp0 - tmp47
    tmp50 = tmp0 - tmp49
    tmp52 = tmp0 - tmp51
    tmp54 = tmp0 - tmp53
    tmp56 = tmp0 - tmp55
    tmp58 = tmp0 - tmp57
    tmp61 = tmp59 - tmp60
    tmp62 = tl_math.exp(tmp61)
    tmp64 = tmp62 / tmp63
    tmp65 = tmp58 * tmp64
    tmp66 = tl.broadcast_to(tmp65, [XBLOCK, RBLOCK])
    tmp68 = tl.where(xmask, tmp66, 0)
    tmp69 = tl.sum(tmp68, 1)[:, None]
    tmp71 = tmp70 - tmp60
    tmp72 = tl_math.exp(tmp71)
    tmp73 = tmp72 / tmp63
    tmp74 = tmp2 * tmp73
    tmp75 = tl.broadcast_to(tmp74, [XBLOCK, RBLOCK])
    tmp77 = tl.where(xmask, tmp75, 0)
    tmp78 = tl.sum(tmp77, 1)[:, None]
    tmp80 = tmp79 - tmp60
    tmp81 = tl_math.exp(tmp80)
    tmp82 = tmp81 / tmp63
    tmp83 = tmp4 * tmp82
    tmp84 = tl.broadcast_to(tmp83, [XBLOCK, RBLOCK])
    tmp86 = tl.where(xmask, tmp84, 0)
    tmp87 = tl.sum(tmp86, 1)[:, None]
    tmp89 = tmp88 - tmp60
    tmp90 = tl_math.exp(tmp89)
    tmp91 = tmp90 / tmp63
    tmp92 = tmp6 * tmp91
    tmp93 = tl.broadcast_to(tmp92, [XBLOCK, RBLOCK])
    tmp95 = tl.where(xmask, tmp93, 0)
    tmp96 = tl.sum(tmp95, 1)[:, None]
    tmp98 = tmp97 - tmp60
    tmp99 = tl_math.exp(tmp98)
    tmp100 = tmp99 / tmp63
    tmp101 = tmp8 * tmp100
    tmp102 = tl.broadcast_to(tmp101, [XBLOCK, RBLOCK])
    tmp104 = tl.where(xmask, tmp102, 0)
    tmp105 = tl.sum(tmp104, 1)[:, None]
    tmp107 = tmp106 - tmp60
    tmp108 = tl_math.exp(tmp107)
    tmp109 = tmp108 / tmp63
    tmp110 = tmp10 * tmp109
    tmp111 = tl.broadcast_to(tmp110, [XBLOCK, RBLOCK])
    tmp113 = tl.where(xmask, tmp111, 0)
    tmp114 = tl.sum(tmp113, 1)[:, None]
    tmp116 = tmp115 - tmp60
    tmp117 = tl_math.exp(tmp116)
    tmp118 = tmp117 / tmp63
    tmp119 = tmp12 * tmp118
    tmp120 = tl.broadcast_to(tmp119, [XBLOCK, RBLOCK])
    tmp122 = tl.where(xmask, tmp120, 0)
    tmp123 = tl.sum(tmp122, 1)[:, None]
    tmp125 = tmp124 - tmp60
    tmp126 = tl_math.exp(tmp125)
    tmp127 = tmp126 / tmp63
    tmp128 = tmp14 * tmp127
    tmp129 = tl.broadcast_to(tmp128, [XBLOCK, RBLOCK])
    tmp131 = tl.where(xmask, tmp129, 0)
    tmp132 = tl.sum(tmp131, 1)[:, None]
    tmp134 = tmp133 - tmp60
    tmp135 = tl_math.exp(tmp134)
    tmp136 = tmp135 / tmp63
    tmp137 = tmp16 * tmp136
    tmp138 = tl.broadcast_to(tmp137, [XBLOCK, RBLOCK])
    tmp140 = tl.where(xmask, tmp138, 0)
    tmp141 = tl.sum(tmp140, 1)[:, None]
    tmp143 = tmp142 - tmp60
    tmp144 = tl_math.exp(tmp143)
    tmp145 = tmp144 / tmp63
    tmp146 = tmp18 * tmp145
    tmp147 = tl.broadcast_to(tmp146, [XBLOCK, RBLOCK])
    tmp149 = tl.where(xmask, tmp147, 0)
    tmp150 = tl.sum(tmp149, 1)[:, None]
    tmp152 = tmp151 - tmp60
    tmp153 = tl_math.exp(tmp152)
    tmp154 = tmp153 / tmp63
    tmp155 = tmp20 * tmp154
    tmp156 = tl.broadcast_to(tmp155, [XBLOCK, RBLOCK])
    tmp158 = tl.where(xmask, tmp156, 0)
    tmp159 = tl.sum(tmp158, 1)[:, None]
    tmp161 = tmp160 - tmp60
    tmp162 = tl_math.exp(tmp161)
    tmp163 = tmp162 / tmp63
    tmp164 = tmp22 * tmp163
    tmp165 = tl.broadcast_to(tmp164, [XBLOCK, RBLOCK])
    tmp167 = tl.where(xmask, tmp165, 0)
    tmp168 = tl.sum(tmp167, 1)[:, None]
    tmp170 = tmp169 - tmp60
    tmp171 = tl_math.exp(tmp170)
    tmp172 = tmp171 / tmp63
    tmp173 = tmp24 * tmp172
    tmp174 = tl.broadcast_to(tmp173, [XBLOCK, RBLOCK])
    tmp176 = tl.where(xmask, tmp174, 0)
    tmp177 = tl.sum(tmp176, 1)[:, None]
    tmp179 = tmp178 - tmp60
    tmp180 = tl_math.exp(tmp179)
    tmp181 = tmp180 / tmp63
    tmp182 = tmp26 * tmp181
    tmp183 = tl.broadcast_to(tmp182, [XBLOCK, RBLOCK])
    tmp185 = tl.where(xmask, tmp183, 0)
    tmp186 = tl.sum(tmp185, 1)[:, None]
    tmp188 = tmp187 - tmp60
    tmp189 = tl_math.exp(tmp188)
    tmp190 = tmp189 / tmp63
    tmp191 = tmp28 * tmp190
    tmp192 = tl.broadcast_to(tmp191, [XBLOCK, RBLOCK])
    tmp194 = tl.where(xmask, tmp192, 0)
    tmp195 = tl.sum(tmp194, 1)[:, None]
    tmp197 = tmp196 - tmp60
    tmp198 = tl_math.exp(tmp197)
    tmp199 = tmp198 / tmp63
    tmp200 = tmp30 * tmp199
    tmp201 = tl.broadcast_to(tmp200, [XBLOCK, RBLOCK])
    tmp203 = tl.where(xmask, tmp201, 0)
    tmp204 = tl.sum(tmp203, 1)[:, None]
    tmp206 = tmp205 - tmp60
    tmp207 = tl_math.exp(tmp206)
    tmp208 = tmp207 / tmp63
    tmp209 = tmp32 * tmp208
    tmp210 = tl.broadcast_to(tmp209, [XBLOCK, RBLOCK])
    tmp212 = tl.where(xmask, tmp210, 0)
    tmp213 = tl.sum(tmp212, 1)[:, None]
    tmp215 = tmp214 - tmp60
    tmp216 = tl_math.exp(tmp215)
    tmp217 = tmp216 / tmp63
    tmp218 = tmp34 * tmp217
    tmp219 = tl.broadcast_to(tmp218, [XBLOCK, RBLOCK])
    tmp221 = tl.where(xmask, tmp219, 0)
    tmp222 = tl.sum(tmp221, 1)[:, None]
    tmp224 = tmp223 - tmp60
    tmp225 = tl_math.exp(tmp224)
    tmp226 = tmp225 / tmp63
    tmp227 = tmp36 * tmp226
    tmp228 = tl.broadcast_to(tmp227, [XBLOCK, RBLOCK])
    tmp230 = tl.where(xmask, tmp228, 0)
    tmp231 = tl.sum(tmp230, 1)[:, None]
    tmp233 = tmp232 - tmp60
    tmp234 = tl_math.exp(tmp233)
    tmp235 = tmp234 / tmp63
    tmp236 = tmp38 * tmp235
    tmp237 = tl.broadcast_to(tmp236, [XBLOCK, RBLOCK])
    tmp239 = tl.where(xmask, tmp237, 0)
    tmp240 = tl.sum(tmp239, 1)[:, None]
    tmp242 = tmp241 - tmp60
    tmp243 = tl_math.exp(tmp242)
    tmp244 = tmp243 / tmp63
    tmp245 = tmp40 * tmp244
    tmp246 = tl.broadcast_to(tmp245, [XBLOCK, RBLOCK])
    tmp248 = tl.where(xmask, tmp246, 0)
    tmp249 = tl.sum(tmp248, 1)[:, None]
    tmp251 = tmp250 - tmp60
    tmp252 = tl_math.exp(tmp251)
    tmp253 = tmp252 / tmp63
    tmp254 = tmp42 * tmp253
    tmp255 = tl.broadcast_to(tmp254, [XBLOCK, RBLOCK])
    tmp257 = tl.where(xmask, tmp255, 0)
    tmp258 = tl.sum(tmp257, 1)[:, None]
    tmp260 = tmp259 - tmp60
    tmp261 = tl_math.exp(tmp260)
    tmp262 = tmp261 / tmp63
    tmp263 = tmp44 * tmp262
    tmp264 = tl.broadcast_to(tmp263, [XBLOCK, RBLOCK])
    tmp266 = tl.where(xmask, tmp264, 0)
    tmp267 = tl.sum(tmp266, 1)[:, None]
    tmp269 = tmp268 - tmp60
    tmp270 = tl_math.exp(tmp269)
    tmp271 = tmp270 / tmp63
    tmp272 = tmp46 * tmp271
    tmp273 = tl.broadcast_to(tmp272, [XBLOCK, RBLOCK])
    tmp275 = tl.where(xmask, tmp273, 0)
    tmp276 = tl.sum(tmp275, 1)[:, None]
    tmp278 = tmp277 - tmp60
    tmp279 = tl_math.exp(tmp278)
    tmp280 = tmp279 / tmp63
    tmp281 = tmp48 * tmp280
    tmp282 = tl.broadcast_to(tmp281, [XBLOCK, RBLOCK])
    tmp284 = tl.where(xmask, tmp282, 0)
    tmp285 = tl.sum(tmp284, 1)[:, None]
    tmp287 = tmp286 - tmp60
    tmp288 = tl_math.exp(tmp287)
    tmp289 = tmp288 / tmp63
    tmp290 = tmp50 * tmp289
    tmp291 = tl.broadcast_to(tmp290, [XBLOCK, RBLOCK])
    tmp293 = tl.where(xmask, tmp291, 0)
    tmp294 = tl.sum(tmp293, 1)[:, None]
    tmp296 = tmp295 - tmp60
    tmp297 = tl_math.exp(tmp296)
    tmp298 = tmp297 / tmp63
    tmp299 = tmp52 * tmp298
    tmp300 = tl.broadcast_to(tmp299, [XBLOCK, RBLOCK])
    tmp302 = tl.where(xmask, tmp300, 0)
    tmp303 = tl.sum(tmp302, 1)[:, None]
    tmp305 = tmp304 - tmp60
    tmp306 = tl_math.exp(tmp305)
    tmp307 = tmp306 / tmp63
    tmp308 = tmp54 * tmp307
    tmp309 = tl.broadcast_to(tmp308, [XBLOCK, RBLOCK])
    tmp311 = tl.where(xmask, tmp309, 0)
    tmp312 = tl.sum(tmp311, 1)[:, None]
    tmp314 = tmp313 - tmp60
    tmp315 = tl_math.exp(tmp314)
    tmp316 = tmp315 / tmp63
    tmp317 = tmp56 * tmp316
    tmp318 = tl.broadcast_to(tmp317, [XBLOCK, RBLOCK])
    tmp320 = tl.where(xmask, tmp318, 0)
    tmp321 = tl.sum(tmp320, 1)[:, None]
    tl.store(out_ptr0 + (r2 + 16 * x3), tmp2, xmask)
    tl.store(out_ptr1 + (r2 + 16 * x3), tmp4, xmask)
    tl.store(out_ptr2 + (r2 + 16 * x3), tmp6, xmask)
    tl.store(out_ptr3 + (r2 + 16 * x3), tmp8, xmask)
    tl.store(out_ptr4 + (r2 + 16 * x3), tmp10, xmask)
    tl.store(out_ptr5 + (r2 + 16 * x3), tmp12, xmask)
    tl.store(out_ptr6 + (r2 + 16 * x3), tmp14, xmask)
    tl.store(out_ptr7 + (r2 + 16 * x3), tmp16, xmask)
    tl.store(out_ptr8 + (r2 + 16 * x3), tmp18, xmask)
    tl.store(out_ptr9 + (r2 + 16 * x3), tmp20, xmask)
    tl.store(out_ptr10 + (r2 + 16 * x3), tmp22, xmask)
    tl.store(out_ptr11 + (r2 + 16 * x3), tmp24, xmask)
    tl.store(out_ptr12 + (r2 + 16 * x3), tmp26, xmask)
    tl.store(out_ptr13 + (r2 + 16 * x3), tmp28, xmask)
    tl.store(out_ptr14 + (r2 + 16 * x3), tmp30, xmask)
    tl.store(out_ptr15 + (r2 + 16 * x3), tmp32, xmask)
    tl.store(out_ptr16 + (r2 + 16 * x3), tmp34, xmask)
    tl.store(out_ptr17 + (r2 + 16 * x3), tmp36, xmask)
    tl.store(out_ptr18 + (r2 + 16 * x3), tmp38, xmask)
    tl.store(out_ptr19 + (r2 + 16 * x3), tmp40, xmask)
    tl.store(out_ptr20 + (r2 + 16 * x3), tmp42, xmask)
    tl.store(out_ptr21 + (r2 + 16 * x3), tmp44, xmask)
    tl.store(out_ptr22 + (r2 + 16 * x3), tmp46, xmask)
    tl.store(out_ptr23 + (r2 + 16 * x3), tmp48, xmask)
    tl.store(out_ptr24 + (r2 + 16 * x3), tmp50, xmask)
    tl.store(out_ptr25 + (r2 + 16 * x3), tmp52, xmask)
    tl.store(out_ptr26 + (r2 + 16 * x3), tmp54, xmask)
    tl.store(out_ptr27 + (r2 + 16 * x3), tmp56, xmask)
    tl.store(out_ptr28 + x3, tmp69, xmask)
    tl.store(out_ptr29 + x3, tmp78, xmask)
    tl.store(out_ptr30 + x3, tmp87, xmask)
    tl.store(out_ptr31 + x3, tmp96, xmask)
    tl.store(out_ptr32 + x3, tmp105, xmask)
    tl.store(out_ptr33 + x3, tmp114, xmask)
    tl.store(out_ptr34 + x3, tmp123, xmask)
    tl.store(out_ptr35 + x3, tmp132, xmask)
    tl.store(out_ptr36 + x3, tmp141, xmask)
    tl.store(out_ptr37 + x3, tmp150, xmask)
    tl.store(out_ptr38 + x3, tmp159, xmask)
    tl.store(out_ptr39 + x3, tmp168, xmask)
    tl.store(out_ptr40 + x3, tmp177, xmask)
    tl.store(out_ptr41 + x3, tmp186, xmask)
    tl.store(out_ptr42 + x3, tmp195, xmask)
    tl.store(out_ptr43 + x3, tmp204, xmask)
    tl.store(out_ptr44 + x3, tmp213, xmask)
    tl.store(out_ptr45 + x3, tmp222, xmask)
    tl.store(out_ptr46 + x3, tmp231, xmask)
    tl.store(out_ptr47 + x3, tmp240, xmask)
    tl.store(out_ptr48 + x3, tmp249, xmask)
    tl.store(out_ptr49 + x3, tmp258, xmask)
    tl.store(out_ptr50 + x3, tmp267, xmask)
    tl.store(out_ptr51 + x3, tmp276, xmask)
    tl.store(out_ptr52 + x3, tmp285, xmask)
    tl.store(out_ptr53 + x3, tmp294, xmask)
    tl.store(out_ptr54 + x3, tmp303, xmask)
    tl.store(out_ptr55 + x3, tmp312, xmask)
    tl.store(out_ptr56 + x3, tmp321, xmask)


@triton.jit
def triton_per_fused_mul_sub_sum_2(in_ptr0, in_ptr1, in_ptr2, in_ptr3,
    in_ptr4, out_ptr0, out_ptr1, out_ptr2, out_ptr3, out_ptr4, out_ptr5,
    out_ptr6, out_ptr7, out_ptr8, out_ptr9, out_ptr10, out_ptr11, out_ptr12,
    out_ptr13, out_ptr14, out_ptr15, out_ptr16, out_ptr17, out_ptr18,
    out_ptr19, out_ptr20, out_ptr21, out_ptr22, out_ptr23, out_ptr24,
    out_ptr25, out_ptr26, out_ptr27, out_ptr28, out_ptr29, out_ptr30,
    out_ptr31, out_ptr32, out_ptr33, out_ptr34, out_ptr35, out_ptr36,
    out_ptr37, out_ptr38, out_ptr39, out_ptr40, out_ptr41, out_ptr42,
    out_ptr43, out_ptr44, out_ptr45, out_ptr46, out_ptr47, out_ptr48,
    out_ptr49, out_ptr50, out_ptr51, out_ptr52, out_ptr53, out_ptr54,
    out_ptr55, xnumel, rnumel, XBLOCK: tl.constexpr):
    xnumel = 16
    RBLOCK: tl.constexpr = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    rindex = tl.arange(0, RBLOCK)[None, :]
    tl.full([XBLOCK, RBLOCK], True, tl.int1)
    r2 = rindex
    x3 = xindex
    x0 = xindex % 4
    x1 = xindex // 4
    tmp0 = tl.load(in_ptr0 + (r2 + 16 * x3), xmask, other=0.0)
    tmp1 = tl.load(in_ptr1 + (116 + x0), xmask, eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr1 + (120 + x0), xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr1 + (124 + x0), xmask, eviction_policy='evict_last')
    tmp7 = tl.load(in_ptr1 + (128 + x0), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr1 + (132 + x0), xmask, eviction_policy='evict_last')
    tmp11 = tl.load(in_ptr1 + (136 + x0), xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr1 + (140 + x0), xmask, eviction_policy='evict_last')
    tmp15 = tl.load(in_ptr1 + (144 + x0), xmask, eviction_policy='evict_last')
    tmp17 = tl.load(in_ptr1 + (148 + x0), xmask, eviction_policy='evict_last')
    tmp19 = tl.load(in_ptr1 + (152 + x0), xmask, eviction_policy='evict_last')
    tmp21 = tl.load(in_ptr1 + (156 + x0), xmask, eviction_policy='evict_last')
    tmp23 = tl.load(in_ptr1 + (160 + x0), xmask, eviction_policy='evict_last')
    tmp25 = tl.load(in_ptr1 + (164 + x0), xmask, eviction_policy='evict_last')
    tmp27 = tl.load(in_ptr1 + (168 + x0), xmask, eviction_policy='evict_last')
    tmp29 = tl.load(in_ptr1 + (172 + x0), xmask, eviction_policy='evict_last')
    tmp31 = tl.load(in_ptr1 + (176 + x0), xmask, eviction_policy='evict_last')
    tmp33 = tl.load(in_ptr1 + (180 + x0), xmask, eviction_policy='evict_last')
    tmp35 = tl.load(in_ptr1 + (184 + x0), xmask, eviction_policy='evict_last')
    tmp37 = tl.load(in_ptr1 + (188 + x0), xmask, eviction_policy='evict_last')
    tmp39 = tl.load(in_ptr1 + (192 + x0), xmask, eviction_policy='evict_last')
    tmp41 = tl.load(in_ptr1 + (196 + x0), xmask, eviction_policy='evict_last')
    tmp43 = tl.load(in_ptr1 + (200 + x0), xmask, eviction_policy='evict_last')
    tmp45 = tl.load(in_ptr1 + (204 + x0), xmask, eviction_policy='evict_last')
    tmp47 = tl.load(in_ptr1 + (208 + x0), xmask, eviction_policy='evict_last')
    tmp49 = tl.load(in_ptr1 + (212 + x0), xmask, eviction_policy='evict_last')
    tmp51 = tl.load(in_ptr1 + (216 + x0), xmask, eviction_policy='evict_last')
    tmp53 = tl.load(in_ptr1 + (220 + x0), xmask, eviction_policy='evict_last')
    tmp55 = tl.load(in_ptr1 + (224 + x0), xmask, eviction_policy='evict_last')
    tmp57 = tl.load(in_ptr2 + (464 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp58 = tl.load(in_ptr3 + (r2 + 16 * x1), xmask, eviction_policy=
        'evict_last', other=0.0)
    tmp61 = tl.load(in_ptr4 + (r2 + 16 * x1), xmask, eviction_policy=
        'evict_last', other=0.0)
    tmp68 = tl.load(in_ptr2 + (480 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp77 = tl.load(in_ptr2 + (496 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp86 = tl.load(in_ptr2 + (512 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp95 = tl.load(in_ptr2 + (528 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp104 = tl.load(in_ptr2 + (544 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp113 = tl.load(in_ptr2 + (560 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp122 = tl.load(in_ptr2 + (576 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp131 = tl.load(in_ptr2 + (592 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp140 = tl.load(in_ptr2 + (608 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp149 = tl.load(in_ptr2 + (624 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp158 = tl.load(in_ptr2 + (640 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp167 = tl.load(in_ptr2 + (656 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp176 = tl.load(in_ptr2 + (672 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp185 = tl.load(in_ptr2 + (688 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp194 = tl.load(in_ptr2 + (704 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp203 = tl.load(in_ptr2 + (720 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp212 = tl.load(in_ptr2 + (736 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp221 = tl.load(in_ptr2 + (752 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp230 = tl.load(in_ptr2 + (768 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp239 = tl.load(in_ptr2 + (784 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp248 = tl.load(in_ptr2 + (800 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp257 = tl.load(in_ptr2 + (816 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp266 = tl.load(in_ptr2 + (832 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp275 = tl.load(in_ptr2 + (848 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp284 = tl.load(in_ptr2 + (864 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp293 = tl.load(in_ptr2 + (880 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp302 = tl.load(in_ptr2 + (896 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp2 = tmp0 - tmp1
    tmp4 = tmp0 - tmp3
    tmp6 = tmp0 - tmp5
    tmp8 = tmp0 - tmp7
    tmp10 = tmp0 - tmp9
    tmp12 = tmp0 - tmp11
    tmp14 = tmp0 - tmp13
    tmp16 = tmp0 - tmp15
    tmp18 = tmp0 - tmp17
    tmp20 = tmp0 - tmp19
    tmp22 = tmp0 - tmp21
    tmp24 = tmp0 - tmp23
    tmp26 = tmp0 - tmp25
    tmp28 = tmp0 - tmp27
    tmp30 = tmp0 - tmp29
    tmp32 = tmp0 - tmp31
    tmp34 = tmp0 - tmp33
    tmp36 = tmp0 - tmp35
    tmp38 = tmp0 - tmp37
    tmp40 = tmp0 - tmp39
    tmp42 = tmp0 - tmp41
    tmp44 = tmp0 - tmp43
    tmp46 = tmp0 - tmp45
    tmp48 = tmp0 - tmp47
    tmp50 = tmp0 - tmp49
    tmp52 = tmp0 - tmp51
    tmp54 = tmp0 - tmp53
    tmp56 = tmp0 - tmp55
    tmp59 = tmp57 - tmp58
    tmp60 = tl_math.exp(tmp59)
    tmp62 = tmp60 / tmp61
    tmp63 = tmp2 * tmp62
    tmp64 = tl.broadcast_to(tmp63, [XBLOCK, RBLOCK])
    tmp66 = tl.where(xmask, tmp64, 0)
    tmp67 = tl.sum(tmp66, 1)[:, None]
    tmp69 = tmp68 - tmp58
    tmp70 = tl_math.exp(tmp69)
    tmp71 = tmp70 / tmp61
    tmp72 = tmp4 * tmp71
    tmp73 = tl.broadcast_to(tmp72, [XBLOCK, RBLOCK])
    tmp75 = tl.where(xmask, tmp73, 0)
    tmp76 = tl.sum(tmp75, 1)[:, None]
    tmp78 = tmp77 - tmp58
    tmp79 = tl_math.exp(tmp78)
    tmp80 = tmp79 / tmp61
    tmp81 = tmp6 * tmp80
    tmp82 = tl.broadcast_to(tmp81, [XBLOCK, RBLOCK])
    tmp84 = tl.where(xmask, tmp82, 0)
    tmp85 = tl.sum(tmp84, 1)[:, None]
    tmp87 = tmp86 - tmp58
    tmp88 = tl_math.exp(tmp87)
    tmp89 = tmp88 / tmp61
    tmp90 = tmp8 * tmp89
    tmp91 = tl.broadcast_to(tmp90, [XBLOCK, RBLOCK])
    tmp93 = tl.where(xmask, tmp91, 0)
    tmp94 = tl.sum(tmp93, 1)[:, None]
    tmp96 = tmp95 - tmp58
    tmp97 = tl_math.exp(tmp96)
    tmp98 = tmp97 / tmp61
    tmp99 = tmp10 * tmp98
    tmp100 = tl.broadcast_to(tmp99, [XBLOCK, RBLOCK])
    tmp102 = tl.where(xmask, tmp100, 0)
    tmp103 = tl.sum(tmp102, 1)[:, None]
    tmp105 = tmp104 - tmp58
    tmp106 = tl_math.exp(tmp105)
    tmp107 = tmp106 / tmp61
    tmp108 = tmp12 * tmp107
    tmp109 = tl.broadcast_to(tmp108, [XBLOCK, RBLOCK])
    tmp111 = tl.where(xmask, tmp109, 0)
    tmp112 = tl.sum(tmp111, 1)[:, None]
    tmp114 = tmp113 - tmp58
    tmp115 = tl_math.exp(tmp114)
    tmp116 = tmp115 / tmp61
    tmp117 = tmp14 * tmp116
    tmp118 = tl.broadcast_to(tmp117, [XBLOCK, RBLOCK])
    tmp120 = tl.where(xmask, tmp118, 0)
    tmp121 = tl.sum(tmp120, 1)[:, None]
    tmp123 = tmp122 - tmp58
    tmp124 = tl_math.exp(tmp123)
    tmp125 = tmp124 / tmp61
    tmp126 = tmp16 * tmp125
    tmp127 = tl.broadcast_to(tmp126, [XBLOCK, RBLOCK])
    tmp129 = tl.where(xmask, tmp127, 0)
    tmp130 = tl.sum(tmp129, 1)[:, None]
    tmp132 = tmp131 - tmp58
    tmp133 = tl_math.exp(tmp132)
    tmp134 = tmp133 / tmp61
    tmp135 = tmp18 * tmp134
    tmp136 = tl.broadcast_to(tmp135, [XBLOCK, RBLOCK])
    tmp138 = tl.where(xmask, tmp136, 0)
    tmp139 = tl.sum(tmp138, 1)[:, None]
    tmp141 = tmp140 - tmp58
    tmp142 = tl_math.exp(tmp141)
    tmp143 = tmp142 / tmp61
    tmp144 = tmp20 * tmp143
    tmp145 = tl.broadcast_to(tmp144, [XBLOCK, RBLOCK])
    tmp147 = tl.where(xmask, tmp145, 0)
    tmp148 = tl.sum(tmp147, 1)[:, None]
    tmp150 = tmp149 - tmp58
    tmp151 = tl_math.exp(tmp150)
    tmp152 = tmp151 / tmp61
    tmp153 = tmp22 * tmp152
    tmp154 = tl.broadcast_to(tmp153, [XBLOCK, RBLOCK])
    tmp156 = tl.where(xmask, tmp154, 0)
    tmp157 = tl.sum(tmp156, 1)[:, None]
    tmp159 = tmp158 - tmp58
    tmp160 = tl_math.exp(tmp159)
    tmp161 = tmp160 / tmp61
    tmp162 = tmp24 * tmp161
    tmp163 = tl.broadcast_to(tmp162, [XBLOCK, RBLOCK])
    tmp165 = tl.where(xmask, tmp163, 0)
    tmp166 = tl.sum(tmp165, 1)[:, None]
    tmp168 = tmp167 - tmp58
    tmp169 = tl_math.exp(tmp168)
    tmp170 = tmp169 / tmp61
    tmp171 = tmp26 * tmp170
    tmp172 = tl.broadcast_to(tmp171, [XBLOCK, RBLOCK])
    tmp174 = tl.where(xmask, tmp172, 0)
    tmp175 = tl.sum(tmp174, 1)[:, None]
    tmp177 = tmp176 - tmp58
    tmp178 = tl_math.exp(tmp177)
    tmp179 = tmp178 / tmp61
    tmp180 = tmp28 * tmp179
    tmp181 = tl.broadcast_to(tmp180, [XBLOCK, RBLOCK])
    tmp183 = tl.where(xmask, tmp181, 0)
    tmp184 = tl.sum(tmp183, 1)[:, None]
    tmp186 = tmp185 - tmp58
    tmp187 = tl_math.exp(tmp186)
    tmp188 = tmp187 / tmp61
    tmp189 = tmp30 * tmp188
    tmp190 = tl.broadcast_to(tmp189, [XBLOCK, RBLOCK])
    tmp192 = tl.where(xmask, tmp190, 0)
    tmp193 = tl.sum(tmp192, 1)[:, None]
    tmp195 = tmp194 - tmp58
    tmp196 = tl_math.exp(tmp195)
    tmp197 = tmp196 / tmp61
    tmp198 = tmp32 * tmp197
    tmp199 = tl.broadcast_to(tmp198, [XBLOCK, RBLOCK])
    tmp201 = tl.where(xmask, tmp199, 0)
    tmp202 = tl.sum(tmp201, 1)[:, None]
    tmp204 = tmp203 - tmp58
    tmp205 = tl_math.exp(tmp204)
    tmp206 = tmp205 / tmp61
    tmp207 = tmp34 * tmp206
    tmp208 = tl.broadcast_to(tmp207, [XBLOCK, RBLOCK])
    tmp210 = tl.where(xmask, tmp208, 0)
    tmp211 = tl.sum(tmp210, 1)[:, None]
    tmp213 = tmp212 - tmp58
    tmp214 = tl_math.exp(tmp213)
    tmp215 = tmp214 / tmp61
    tmp216 = tmp36 * tmp215
    tmp217 = tl.broadcast_to(tmp216, [XBLOCK, RBLOCK])
    tmp219 = tl.where(xmask, tmp217, 0)
    tmp220 = tl.sum(tmp219, 1)[:, None]
    tmp222 = tmp221 - tmp58
    tmp223 = tl_math.exp(tmp222)
    tmp224 = tmp223 / tmp61
    tmp225 = tmp38 * tmp224
    tmp226 = tl.broadcast_to(tmp225, [XBLOCK, RBLOCK])
    tmp228 = tl.where(xmask, tmp226, 0)
    tmp229 = tl.sum(tmp228, 1)[:, None]
    tmp231 = tmp230 - tmp58
    tmp232 = tl_math.exp(tmp231)
    tmp233 = tmp232 / tmp61
    tmp234 = tmp40 * tmp233
    tmp235 = tl.broadcast_to(tmp234, [XBLOCK, RBLOCK])
    tmp237 = tl.where(xmask, tmp235, 0)
    tmp238 = tl.sum(tmp237, 1)[:, None]
    tmp240 = tmp239 - tmp58
    tmp241 = tl_math.exp(tmp240)
    tmp242 = tmp241 / tmp61
    tmp243 = tmp42 * tmp242
    tmp244 = tl.broadcast_to(tmp243, [XBLOCK, RBLOCK])
    tmp246 = tl.where(xmask, tmp244, 0)
    tmp247 = tl.sum(tmp246, 1)[:, None]
    tmp249 = tmp248 - tmp58
    tmp250 = tl_math.exp(tmp249)
    tmp251 = tmp250 / tmp61
    tmp252 = tmp44 * tmp251
    tmp253 = tl.broadcast_to(tmp252, [XBLOCK, RBLOCK])
    tmp255 = tl.where(xmask, tmp253, 0)
    tmp256 = tl.sum(tmp255, 1)[:, None]
    tmp258 = tmp257 - tmp58
    tmp259 = tl_math.exp(tmp258)
    tmp260 = tmp259 / tmp61
    tmp261 = tmp46 * tmp260
    tmp262 = tl.broadcast_to(tmp261, [XBLOCK, RBLOCK])
    tmp264 = tl.where(xmask, tmp262, 0)
    tmp265 = tl.sum(tmp264, 1)[:, None]
    tmp267 = tmp266 - tmp58
    tmp268 = tl_math.exp(tmp267)
    tmp269 = tmp268 / tmp61
    tmp270 = tmp48 * tmp269
    tmp271 = tl.broadcast_to(tmp270, [XBLOCK, RBLOCK])
    tmp273 = tl.where(xmask, tmp271, 0)
    tmp274 = tl.sum(tmp273, 1)[:, None]
    tmp276 = tmp275 - tmp58
    tmp277 = tl_math.exp(tmp276)
    tmp278 = tmp277 / tmp61
    tmp279 = tmp50 * tmp278
    tmp280 = tl.broadcast_to(tmp279, [XBLOCK, RBLOCK])
    tmp282 = tl.where(xmask, tmp280, 0)
    tmp283 = tl.sum(tmp282, 1)[:, None]
    tmp285 = tmp284 - tmp58
    tmp286 = tl_math.exp(tmp285)
    tmp287 = tmp286 / tmp61
    tmp288 = tmp52 * tmp287
    tmp289 = tl.broadcast_to(tmp288, [XBLOCK, RBLOCK])
    tmp291 = tl.where(xmask, tmp289, 0)
    tmp292 = tl.sum(tmp291, 1)[:, None]
    tmp294 = tmp293 - tmp58
    tmp295 = tl_math.exp(tmp294)
    tmp296 = tmp295 / tmp61
    tmp297 = tmp54 * tmp296
    tmp298 = tl.broadcast_to(tmp297, [XBLOCK, RBLOCK])
    tmp300 = tl.where(xmask, tmp298, 0)
    tmp301 = tl.sum(tmp300, 1)[:, None]
    tmp303 = tmp302 - tmp58
    tmp304 = tl_math.exp(tmp303)
    tmp305 = tmp304 / tmp61
    tmp306 = tmp56 * tmp305
    tmp307 = tl.broadcast_to(tmp306, [XBLOCK, RBLOCK])
    tmp309 = tl.where(xmask, tmp307, 0)
    tmp310 = tl.sum(tmp309, 1)[:, None]
    tl.store(out_ptr0 + (r2 + 16 * x3), tmp2, xmask)
    tl.store(out_ptr1 + (r2 + 16 * x3), tmp4, xmask)
    tl.store(out_ptr2 + (r2 + 16 * x3), tmp6, xmask)
    tl.store(out_ptr3 + (r2 + 16 * x3), tmp8, xmask)
    tl.store(out_ptr4 + (r2 + 16 * x3), tmp10, xmask)
    tl.store(out_ptr5 + (r2 + 16 * x3), tmp12, xmask)
    tl.store(out_ptr6 + (r2 + 16 * x3), tmp14, xmask)
    tl.store(out_ptr7 + (r2 + 16 * x3), tmp16, xmask)
    tl.store(out_ptr8 + (r2 + 16 * x3), tmp18, xmask)
    tl.store(out_ptr9 + (r2 + 16 * x3), tmp20, xmask)
    tl.store(out_ptr10 + (r2 + 16 * x3), tmp22, xmask)
    tl.store(out_ptr11 + (r2 + 16 * x3), tmp24, xmask)
    tl.store(out_ptr12 + (r2 + 16 * x3), tmp26, xmask)
    tl.store(out_ptr13 + (r2 + 16 * x3), tmp28, xmask)
    tl.store(out_ptr14 + (r2 + 16 * x3), tmp30, xmask)
    tl.store(out_ptr15 + (r2 + 16 * x3), tmp32, xmask)
    tl.store(out_ptr16 + (r2 + 16 * x3), tmp34, xmask)
    tl.store(out_ptr17 + (r2 + 16 * x3), tmp36, xmask)
    tl.store(out_ptr18 + (r2 + 16 * x3), tmp38, xmask)
    tl.store(out_ptr19 + (r2 + 16 * x3), tmp40, xmask)
    tl.store(out_ptr20 + (r2 + 16 * x3), tmp42, xmask)
    tl.store(out_ptr21 + (r2 + 16 * x3), tmp44, xmask)
    tl.store(out_ptr22 + (r2 + 16 * x3), tmp46, xmask)
    tl.store(out_ptr23 + (r2 + 16 * x3), tmp48, xmask)
    tl.store(out_ptr24 + (r2 + 16 * x3), tmp50, xmask)
    tl.store(out_ptr25 + (r2 + 16 * x3), tmp52, xmask)
    tl.store(out_ptr26 + (r2 + 16 * x3), tmp54, xmask)
    tl.store(out_ptr27 + (r2 + 16 * x3), tmp56, xmask)
    tl.store(out_ptr28 + x3, tmp67, xmask)
    tl.store(out_ptr29 + x3, tmp76, xmask)
    tl.store(out_ptr30 + x3, tmp85, xmask)
    tl.store(out_ptr31 + x3, tmp94, xmask)
    tl.store(out_ptr32 + x3, tmp103, xmask)
    tl.store(out_ptr33 + x3, tmp112, xmask)
    tl.store(out_ptr34 + x3, tmp121, xmask)
    tl.store(out_ptr35 + x3, tmp130, xmask)
    tl.store(out_ptr36 + x3, tmp139, xmask)
    tl.store(out_ptr37 + x3, tmp148, xmask)
    tl.store(out_ptr38 + x3, tmp157, xmask)
    tl.store(out_ptr39 + x3, tmp166, xmask)
    tl.store(out_ptr40 + x3, tmp175, xmask)
    tl.store(out_ptr41 + x3, tmp184, xmask)
    tl.store(out_ptr42 + x3, tmp193, xmask)
    tl.store(out_ptr43 + x3, tmp202, xmask)
    tl.store(out_ptr44 + x3, tmp211, xmask)
    tl.store(out_ptr45 + x3, tmp220, xmask)
    tl.store(out_ptr46 + x3, tmp229, xmask)
    tl.store(out_ptr47 + x3, tmp238, xmask)
    tl.store(out_ptr48 + x3, tmp247, xmask)
    tl.store(out_ptr49 + x3, tmp256, xmask)
    tl.store(out_ptr50 + x3, tmp265, xmask)
    tl.store(out_ptr51 + x3, tmp274, xmask)
    tl.store(out_ptr52 + x3, tmp283, xmask)
    tl.store(out_ptr53 + x3, tmp292, xmask)
    tl.store(out_ptr54 + x3, tmp301, xmask)
    tl.store(out_ptr55 + x3, tmp310, xmask)


@triton.jit
def triton_per_fused_mul_sub_sum_3(in_ptr0, in_ptr1, in_ptr2, in_ptr3,
    in_ptr4, out_ptr0, out_ptr1, out_ptr2, out_ptr3, out_ptr4, out_ptr5,
    out_ptr6, out_ptr7, out_ptr8, out_ptr9, out_ptr10, out_ptr11, out_ptr12,
    out_ptr13, xnumel, rnumel, XBLOCK: tl.constexpr):
    xnumel = 16
    RBLOCK: tl.constexpr = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    rindex = tl.arange(0, RBLOCK)[None, :]
    tl.full([XBLOCK, RBLOCK], True, tl.int1)
    r2 = rindex
    x3 = xindex
    x0 = xindex % 4
    x1 = xindex // 4
    tmp0 = tl.load(in_ptr0 + (r2 + 16 * x3), xmask, other=0.0)
    tmp1 = tl.load(in_ptr1 + (228 + x0), xmask, eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr1 + (232 + x0), xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr1 + (236 + x0), xmask, eviction_policy='evict_last')
    tmp7 = tl.load(in_ptr1 + (240 + x0), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr1 + (244 + x0), xmask, eviction_policy='evict_last')
    tmp11 = tl.load(in_ptr1 + (248 + x0), xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr1 + (252 + x0), xmask, eviction_policy='evict_last')
    tmp15 = tl.load(in_ptr2 + (912 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp16 = tl.load(in_ptr3 + (r2 + 16 * x1), xmask, eviction_policy=
        'evict_last', other=0.0)
    tmp19 = tl.load(in_ptr4 + (r2 + 16 * x1), xmask, eviction_policy=
        'evict_last', other=0.0)
    tmp26 = tl.load(in_ptr2 + (928 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp35 = tl.load(in_ptr2 + (944 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp44 = tl.load(in_ptr2 + (960 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp53 = tl.load(in_ptr2 + (976 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp62 = tl.load(in_ptr2 + (992 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp71 = tl.load(in_ptr2 + (1008 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp2 = tmp0 - tmp1
    tmp4 = tmp0 - tmp3
    tmp6 = tmp0 - tmp5
    tmp8 = tmp0 - tmp7
    tmp10 = tmp0 - tmp9
    tmp12 = tmp0 - tmp11
    tmp14 = tmp0 - tmp13
    tmp17 = tmp15 - tmp16
    tmp18 = tl_math.exp(tmp17)
    tmp20 = tmp18 / tmp19
    tmp21 = tmp2 * tmp20
    tmp22 = tl.broadcast_to(tmp21, [XBLOCK, RBLOCK])
    tmp24 = tl.where(xmask, tmp22, 0)
    tmp25 = tl.sum(tmp24, 1)[:, None]
    tmp27 = tmp26 - tmp16
    tmp28 = tl_math.exp(tmp27)
    tmp29 = tmp28 / tmp19
    tmp30 = tmp4 * tmp29
    tmp31 = tl.broadcast_to(tmp30, [XBLOCK, RBLOCK])
    tmp33 = tl.where(xmask, tmp31, 0)
    tmp34 = tl.sum(tmp33, 1)[:, None]
    tmp36 = tmp35 - tmp16
    tmp37 = tl_math.exp(tmp36)
    tmp38 = tmp37 / tmp19
    tmp39 = tmp6 * tmp38
    tmp40 = tl.broadcast_to(tmp39, [XBLOCK, RBLOCK])
    tmp42 = tl.where(xmask, tmp40, 0)
    tmp43 = tl.sum(tmp42, 1)[:, None]
    tmp45 = tmp44 - tmp16
    tmp46 = tl_math.exp(tmp45)
    tmp47 = tmp46 / tmp19
    tmp48 = tmp8 * tmp47
    tmp49 = tl.broadcast_to(tmp48, [XBLOCK, RBLOCK])
    tmp51 = tl.where(xmask, tmp49, 0)
    tmp52 = tl.sum(tmp51, 1)[:, None]
    tmp54 = tmp53 - tmp16
    tmp55 = tl_math.exp(tmp54)
    tmp56 = tmp55 / tmp19
    tmp57 = tmp10 * tmp56
    tmp58 = tl.broadcast_to(tmp57, [XBLOCK, RBLOCK])
    tmp60 = tl.where(xmask, tmp58, 0)
    tmp61 = tl.sum(tmp60, 1)[:, None]
    tmp63 = tmp62 - tmp16
    tmp64 = tl_math.exp(tmp63)
    tmp65 = tmp64 / tmp19
    tmp66 = tmp12 * tmp65
    tmp67 = tl.broadcast_to(tmp66, [XBLOCK, RBLOCK])
    tmp69 = tl.where(xmask, tmp67, 0)
    tmp70 = tl.sum(tmp69, 1)[:, None]
    tmp72 = tmp71 - tmp16
    tmp73 = tl_math.exp(tmp72)
    tmp74 = tmp73 / tmp19
    tmp75 = tmp14 * tmp74
    tmp76 = tl.broadcast_to(tmp75, [XBLOCK, RBLOCK])
    tmp78 = tl.where(xmask, tmp76, 0)
    tmp79 = tl.sum(tmp78, 1)[:, None]
    tl.store(out_ptr0 + (r2 + 16 * x3), tmp2, xmask)
    tl.store(out_ptr1 + (r2 + 16 * x3), tmp4, xmask)
    tl.store(out_ptr2 + (r2 + 16 * x3), tmp6, xmask)
    tl.store(out_ptr3 + (r2 + 16 * x3), tmp8, xmask)
    tl.store(out_ptr4 + (r2 + 16 * x3), tmp10, xmask)
    tl.store(out_ptr5 + (r2 + 16 * x3), tmp12, xmask)
    tl.store(out_ptr6 + (r2 + 16 * x3), tmp14, xmask)
    tl.store(out_ptr7 + x3, tmp25, xmask)
    tl.store(out_ptr8 + x3, tmp34, xmask)
    tl.store(out_ptr9 + x3, tmp43, xmask)
    tl.store(out_ptr10 + x3, tmp52, xmask)
    tl.store(out_ptr11 + x3, tmp61, xmask)
    tl.store(out_ptr12 + x3, tmp70, xmask)
    tl.store(out_ptr13 + x3, tmp79, xmask)


@triton.jit
def triton_poi_fused_copy_zeros_4(in_out_ptr0, in_ptr0, in_ptr1, in_ptr2,
    in_ptr3, in_ptr4, in_ptr5, in_ptr6, in_ptr7, in_ptr8, in_ptr9, in_ptr10,
    in_ptr11, in_ptr12, in_ptr13, in_ptr14, in_ptr15, in_ptr16, in_ptr17,
    in_ptr18, in_ptr19, in_ptr20, in_ptr21, in_ptr22, in_ptr23, in_ptr24,
    in_ptr25, in_ptr26, in_ptr27, in_ptr28, in_ptr29, in_ptr30, in_ptr31,
    in_ptr32, in_ptr33, in_ptr34, in_ptr35, in_ptr36, in_ptr37, in_ptr38,
    in_ptr39, in_ptr40, in_ptr41, in_ptr42, in_ptr43, in_ptr44, in_ptr45,
    in_ptr46, in_ptr47, in_ptr48, in_ptr49, in_ptr50, in_ptr51, in_ptr52,
    in_ptr53, in_ptr54, in_ptr55, in_ptr56, in_ptr57, in_ptr58, in_ptr59,
    in_ptr60, in_ptr61, in_ptr62, in_ptr63, xnumel, XBLOCK: tl.constexpr):
    xnumel = 1024
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x1 = xindex // 4 % 64
    x0 = xindex % 4
    x2 = xindex // 256
    x3 = xindex
    tmp0 = x1
    tmp1 = tl.full([1], 4, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = tl.full([1], 5, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp5 = tmp2 & tmp4
    tmp6 = tl.load(in_ptr0 + (x0 + 4 * x2), tmp5 & xmask, eviction_policy=
        'evict_last', other=0.0)
    tmp7 = tl.full([1], 3, tl.int64)
    tmp8 = tmp0 >= tmp7
    tmp9 = tmp0 < tmp1
    tmp10 = tmp8 & tmp9
    tmp11 = tl.load(in_ptr1 + (x0 + 4 * x2), tmp10 & xmask, eviction_policy
        ='evict_last', other=0.0)
    tmp12 = tl.full([1], 2, tl.int64)
    tmp13 = tmp0 >= tmp12
    tmp14 = tmp0 < tmp7
    tmp15 = tmp13 & tmp14
    tmp16 = tl.load(in_ptr2 + (x0 + 4 * x2), tmp15 & xmask, eviction_policy
        ='evict_last', other=0.0)
    tmp17 = tl.full([1], 1, tl.int64)
    tmp18 = tmp0 >= tmp17
    tmp19 = tmp0 < tmp12
    tmp20 = tmp18 & tmp19
    tmp21 = tl.load(in_ptr3 + (x0 + 4 * x2), tmp20 & xmask, eviction_policy
        ='evict_last', other=0.0)
    tmp22 = tmp0 < tmp17
    tmp23 = tl.load(in_ptr4 + (x0 + 4 * x2), tmp22 & xmask, eviction_policy
        ='evict_last', other=0.0)
    tmp24 = 0.0
    tmp25 = tl.where(tmp22, tmp23, tmp24)
    tmp26 = tl.where(tmp20, tmp21, tmp25)
    tmp27 = tl.where(tmp15, tmp16, tmp26)
    tmp28 = tl.where(tmp10, tmp11, tmp27)
    tmp29 = tl.where(tmp5, tmp6, tmp28)
    tmp30 = tl.full([1], 8, tl.int64)
    tmp31 = tmp0 >= tmp30
    tmp32 = tl.full([1], 9, tl.int64)
    tmp33 = tmp0 < tmp32
    tmp34 = tmp31 & tmp33
    tmp35 = tl.load(in_ptr5 + (x0 + 4 * x2), tmp34 & xmask, eviction_policy
        ='evict_last', other=0.0)
    tmp36 = tl.full([1], 7, tl.int64)
    tmp37 = tmp0 >= tmp36
    tmp38 = tmp0 < tmp30
    tmp39 = tmp37 & tmp38
    tmp40 = tl.load(in_ptr6 + (x0 + 4 * x2), tmp39 & xmask, eviction_policy
        ='evict_last', other=0.0)
    tmp41 = tl.full([1], 6, tl.int64)
    tmp42 = tmp0 >= tmp41
    tmp43 = tmp0 < tmp36
    tmp44 = tmp42 & tmp43
    tmp45 = tl.load(in_ptr7 + (x0 + 4 * x2), tmp44 & xmask, eviction_policy
        ='evict_last', other=0.0)
    tmp46 = tmp0 >= tmp3
    tmp47 = tmp0 < tmp41
    tmp48 = tmp46 & tmp47
    tmp49 = tl.load(in_ptr8 + (x0 + 4 * x2), tmp48 & xmask, eviction_policy
        ='evict_last', other=0.0)
    tmp50 = tl.where(tmp48, tmp49, tmp29)
    tmp51 = tl.where(tmp44, tmp45, tmp50)
    tmp52 = tl.where(tmp39, tmp40, tmp51)
    tmp53 = tl.where(tmp34, tmp35, tmp52)
    tmp54 = tl.full([1], 12, tl.int64)
    tmp55 = tmp0 >= tmp54
    tmp56 = tl.full([1], 13, tl.int64)
    tmp57 = tmp0 < tmp56
    tmp58 = tmp55 & tmp57
    tmp59 = tl.load(in_ptr9 + (x0 + 4 * x2), tmp58 & xmask, eviction_policy
        ='evict_last', other=0.0)
    tmp60 = tl.full([1], 11, tl.int64)
    tmp61 = tmp0 >= tmp60
    tmp62 = tmp0 < tmp54
    tmp63 = tmp61 & tmp62
    tmp64 = tl.load(in_ptr10 + (x0 + 4 * x2), tmp63 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp65 = tl.full([1], 10, tl.int64)
    tmp66 = tmp0 >= tmp65
    tmp67 = tmp0 < tmp60
    tmp68 = tmp66 & tmp67
    tmp69 = tl.load(in_ptr11 + (x0 + 4 * x2), tmp68 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp70 = tmp0 >= tmp32
    tmp71 = tmp0 < tmp65
    tmp72 = tmp70 & tmp71
    tmp73 = tl.load(in_ptr12 + (x0 + 4 * x2), tmp72 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp74 = tl.where(tmp72, tmp73, tmp53)
    tmp75 = tl.where(tmp68, tmp69, tmp74)
    tmp76 = tl.where(tmp63, tmp64, tmp75)
    tmp77 = tl.where(tmp58, tmp59, tmp76)
    tmp78 = tl.full([1], 16, tl.int64)
    tmp79 = tmp0 >= tmp78
    tmp80 = tl.full([1], 17, tl.int64)
    tmp81 = tmp0 < tmp80
    tmp82 = tmp79 & tmp81
    tmp83 = tl.load(in_ptr13 + (x0 + 4 * x2), tmp82 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp84 = tl.full([1], 15, tl.int64)
    tmp85 = tmp0 >= tmp84
    tmp86 = tmp0 < tmp78
    tmp87 = tmp85 & tmp86
    tmp88 = tl.load(in_ptr14 + (x0 + 4 * x2), tmp87 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp89 = tl.full([1], 14, tl.int64)
    tmp90 = tmp0 >= tmp89
    tmp91 = tmp0 < tmp84
    tmp92 = tmp90 & tmp91
    tmp93 = tl.load(in_ptr15 + (x0 + 4 * x2), tmp92 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp94 = tmp0 >= tmp56
    tmp95 = tmp0 < tmp89
    tmp96 = tmp94 & tmp95
    tmp97 = tl.load(in_ptr16 + (x0 + 4 * x2), tmp96 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp98 = tl.where(tmp96, tmp97, tmp77)
    tmp99 = tl.where(tmp92, tmp93, tmp98)
    tmp100 = tl.where(tmp87, tmp88, tmp99)
    tmp101 = tl.where(tmp82, tmp83, tmp100)
    tmp102 = tl.full([1], 20, tl.int64)
    tmp103 = tmp0 >= tmp102
    tmp104 = tl.full([1], 21, tl.int64)
    tmp105 = tmp0 < tmp104
    tmp106 = tmp103 & tmp105
    tmp107 = tl.load(in_ptr17 + (x0 + 4 * x2), tmp106 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp108 = tl.full([1], 19, tl.int64)
    tmp109 = tmp0 >= tmp108
    tmp110 = tmp0 < tmp102
    tmp111 = tmp109 & tmp110
    tmp112 = tl.load(in_ptr18 + (x0 + 4 * x2), tmp111 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp113 = tl.full([1], 18, tl.int64)
    tmp114 = tmp0 >= tmp113
    tmp115 = tmp0 < tmp108
    tmp116 = tmp114 & tmp115
    tmp117 = tl.load(in_ptr19 + (x0 + 4 * x2), tmp116 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp118 = tmp0 >= tmp80
    tmp119 = tmp0 < tmp113
    tmp120 = tmp118 & tmp119
    tmp121 = tl.load(in_ptr20 + (x0 + 4 * x2), tmp120 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp122 = tl.where(tmp120, tmp121, tmp101)
    tmp123 = tl.where(tmp116, tmp117, tmp122)
    tmp124 = tl.where(tmp111, tmp112, tmp123)
    tmp125 = tl.where(tmp106, tmp107, tmp124)
    tmp126 = tl.full([1], 24, tl.int64)
    tmp127 = tmp0 >= tmp126
    tmp128 = tl.full([1], 25, tl.int64)
    tmp129 = tmp0 < tmp128
    tmp130 = tmp127 & tmp129
    tmp131 = tl.load(in_ptr21 + (x0 + 4 * x2), tmp130 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp132 = tl.full([1], 23, tl.int64)
    tmp133 = tmp0 >= tmp132
    tmp134 = tmp0 < tmp126
    tmp135 = tmp133 & tmp134
    tmp136 = tl.load(in_ptr22 + (x0 + 4 * x2), tmp135 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp137 = tl.full([1], 22, tl.int64)
    tmp138 = tmp0 >= tmp137
    tmp139 = tmp0 < tmp132
    tmp140 = tmp138 & tmp139
    tmp141 = tl.load(in_ptr23 + (x0 + 4 * x2), tmp140 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp142 = tmp0 >= tmp104
    tmp143 = tmp0 < tmp137
    tmp144 = tmp142 & tmp143
    tmp145 = tl.load(in_ptr24 + (x0 + 4 * x2), tmp144 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp146 = tl.where(tmp144, tmp145, tmp125)
    tmp147 = tl.where(tmp140, tmp141, tmp146)
    tmp148 = tl.where(tmp135, tmp136, tmp147)
    tmp149 = tl.where(tmp130, tmp131, tmp148)
    tmp150 = tl.full([1], 28, tl.int64)
    tmp151 = tmp0 >= tmp150
    tmp152 = tl.full([1], 29, tl.int64)
    tmp153 = tmp0 < tmp152
    tmp154 = tmp151 & tmp153
    tmp155 = tl.load(in_ptr25 + (x0 + 4 * x2), tmp154 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp156 = tl.full([1], 27, tl.int64)
    tmp157 = tmp0 >= tmp156
    tmp158 = tmp0 < tmp150
    tmp159 = tmp157 & tmp158
    tmp160 = tl.load(in_ptr26 + (x0 + 4 * x2), tmp159 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp161 = tl.full([1], 26, tl.int64)
    tmp162 = tmp0 >= tmp161
    tmp163 = tmp0 < tmp156
    tmp164 = tmp162 & tmp163
    tmp165 = tl.load(in_ptr27 + (x0 + 4 * x2), tmp164 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp166 = tmp0 >= tmp128
    tmp167 = tmp0 < tmp161
    tmp168 = tmp166 & tmp167
    tmp169 = tl.load(in_ptr28 + (x0 + 4 * x2), tmp168 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp170 = tl.where(tmp168, tmp169, tmp149)
    tmp171 = tl.where(tmp164, tmp165, tmp170)
    tmp172 = tl.where(tmp159, tmp160, tmp171)
    tmp173 = tl.where(tmp154, tmp155, tmp172)
    tmp174 = tl.full([1], 32, tl.int64)
    tmp175 = tmp0 >= tmp174
    tmp176 = tl.full([1], 33, tl.int64)
    tmp177 = tmp0 < tmp176
    tmp178 = tmp175 & tmp177
    tmp179 = tl.load(in_ptr29 + (x0 + 4 * x2), tmp178 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp180 = tl.full([1], 31, tl.int64)
    tmp181 = tmp0 >= tmp180
    tmp182 = tmp0 < tmp174
    tmp183 = tmp181 & tmp182
    tmp184 = tl.load(in_ptr30 + (x0 + 4 * x2), tmp183 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp185 = tl.full([1], 30, tl.int64)
    tmp186 = tmp0 >= tmp185
    tmp187 = tmp0 < tmp180
    tmp188 = tmp186 & tmp187
    tmp189 = tl.load(in_ptr31 + (x0 + 4 * x2), tmp188 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp190 = tmp0 >= tmp152
    tmp191 = tmp0 < tmp185
    tmp192 = tmp190 & tmp191
    tmp193 = tl.load(in_ptr32 + (x0 + 4 * x2), tmp192 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp194 = tl.where(tmp192, tmp193, tmp173)
    tmp195 = tl.where(tmp188, tmp189, tmp194)
    tmp196 = tl.where(tmp183, tmp184, tmp195)
    tmp197 = tl.where(tmp178, tmp179, tmp196)
    tmp198 = tl.full([1], 36, tl.int64)
    tmp199 = tmp0 >= tmp198
    tmp200 = tl.full([1], 37, tl.int64)
    tmp201 = tmp0 < tmp200
    tmp202 = tmp199 & tmp201
    tmp203 = tl.load(in_ptr33 + (x0 + 4 * x2), tmp202 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp204 = tl.full([1], 35, tl.int64)
    tmp205 = tmp0 >= tmp204
    tmp206 = tmp0 < tmp198
    tmp207 = tmp205 & tmp206
    tmp208 = tl.load(in_ptr34 + (x0 + 4 * x2), tmp207 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp209 = tl.full([1], 34, tl.int64)
    tmp210 = tmp0 >= tmp209
    tmp211 = tmp0 < tmp204
    tmp212 = tmp210 & tmp211
    tmp213 = tl.load(in_ptr35 + (x0 + 4 * x2), tmp212 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp214 = tmp0 >= tmp176
    tmp215 = tmp0 < tmp209
    tmp216 = tmp214 & tmp215
    tmp217 = tl.load(in_ptr36 + (x0 + 4 * x2), tmp216 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp218 = tl.where(tmp216, tmp217, tmp197)
    tmp219 = tl.where(tmp212, tmp213, tmp218)
    tmp220 = tl.where(tmp207, tmp208, tmp219)
    tmp221 = tl.where(tmp202, tmp203, tmp220)
    tmp222 = tl.full([1], 40, tl.int64)
    tmp223 = tmp0 >= tmp222
    tmp224 = tl.full([1], 41, tl.int64)
    tmp225 = tmp0 < tmp224
    tmp226 = tmp223 & tmp225
    tmp227 = tl.load(in_ptr37 + (x0 + 4 * x2), tmp226 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp228 = tl.full([1], 39, tl.int64)
    tmp229 = tmp0 >= tmp228
    tmp230 = tmp0 < tmp222
    tmp231 = tmp229 & tmp230
    tmp232 = tl.load(in_ptr38 + (x0 + 4 * x2), tmp231 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp233 = tl.full([1], 38, tl.int64)
    tmp234 = tmp0 >= tmp233
    tmp235 = tmp0 < tmp228
    tmp236 = tmp234 & tmp235
    tmp237 = tl.load(in_ptr39 + (x0 + 4 * x2), tmp236 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp238 = tmp0 >= tmp200
    tmp239 = tmp0 < tmp233
    tmp240 = tmp238 & tmp239
    tmp241 = tl.load(in_ptr40 + (x0 + 4 * x2), tmp240 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp242 = tl.where(tmp240, tmp241, tmp221)
    tmp243 = tl.where(tmp236, tmp237, tmp242)
    tmp244 = tl.where(tmp231, tmp232, tmp243)
    tmp245 = tl.where(tmp226, tmp227, tmp244)
    tmp246 = tl.full([1], 44, tl.int64)
    tmp247 = tmp0 >= tmp246
    tmp248 = tl.full([1], 45, tl.int64)
    tmp249 = tmp0 < tmp248
    tmp250 = tmp247 & tmp249
    tmp251 = tl.load(in_ptr41 + (x0 + 4 * x2), tmp250 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp252 = tl.full([1], 43, tl.int64)
    tmp253 = tmp0 >= tmp252
    tmp254 = tmp0 < tmp246
    tmp255 = tmp253 & tmp254
    tmp256 = tl.load(in_ptr42 + (x0 + 4 * x2), tmp255 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp257 = tl.full([1], 42, tl.int64)
    tmp258 = tmp0 >= tmp257
    tmp259 = tmp0 < tmp252
    tmp260 = tmp258 & tmp259
    tmp261 = tl.load(in_ptr43 + (x0 + 4 * x2), tmp260 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp262 = tmp0 >= tmp224
    tmp263 = tmp0 < tmp257
    tmp264 = tmp262 & tmp263
    tmp265 = tl.load(in_ptr44 + (x0 + 4 * x2), tmp264 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp266 = tl.where(tmp264, tmp265, tmp245)
    tmp267 = tl.where(tmp260, tmp261, tmp266)
    tmp268 = tl.where(tmp255, tmp256, tmp267)
    tmp269 = tl.where(tmp250, tmp251, tmp268)
    tmp270 = tl.full([1], 48, tl.int64)
    tmp271 = tmp0 >= tmp270
    tmp272 = tl.full([1], 49, tl.int64)
    tmp273 = tmp0 < tmp272
    tmp274 = tmp271 & tmp273
    tmp275 = tl.load(in_ptr45 + (x0 + 4 * x2), tmp274 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp276 = tl.full([1], 47, tl.int64)
    tmp277 = tmp0 >= tmp276
    tmp278 = tmp0 < tmp270
    tmp279 = tmp277 & tmp278
    tmp280 = tl.load(in_ptr46 + (x0 + 4 * x2), tmp279 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp281 = tl.full([1], 46, tl.int64)
    tmp282 = tmp0 >= tmp281
    tmp283 = tmp0 < tmp276
    tmp284 = tmp282 & tmp283
    tmp285 = tl.load(in_ptr47 + (x0 + 4 * x2), tmp284 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp286 = tmp0 >= tmp248
    tmp287 = tmp0 < tmp281
    tmp288 = tmp286 & tmp287
    tmp289 = tl.load(in_ptr48 + (x0 + 4 * x2), tmp288 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp290 = tl.where(tmp288, tmp289, tmp269)
    tmp291 = tl.where(tmp284, tmp285, tmp290)
    tmp292 = tl.where(tmp279, tmp280, tmp291)
    tmp293 = tl.where(tmp274, tmp275, tmp292)
    tmp294 = tl.full([1], 52, tl.int64)
    tmp295 = tmp0 >= tmp294
    tmp296 = tl.full([1], 53, tl.int64)
    tmp297 = tmp0 < tmp296
    tmp298 = tmp295 & tmp297
    tmp299 = tl.load(in_ptr49 + (x0 + 4 * x2), tmp298 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp300 = tl.full([1], 51, tl.int64)
    tmp301 = tmp0 >= tmp300
    tmp302 = tmp0 < tmp294
    tmp303 = tmp301 & tmp302
    tmp304 = tl.load(in_ptr50 + (x0 + 4 * x2), tmp303 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp305 = tl.full([1], 50, tl.int64)
    tmp306 = tmp0 >= tmp305
    tmp307 = tmp0 < tmp300
    tmp308 = tmp306 & tmp307
    tmp309 = tl.load(in_ptr51 + (x0 + 4 * x2), tmp308 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp310 = tmp0 >= tmp272
    tmp311 = tmp0 < tmp305
    tmp312 = tmp310 & tmp311
    tmp313 = tl.load(in_ptr52 + (x0 + 4 * x2), tmp312 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp314 = tl.where(tmp312, tmp313, tmp293)
    tmp315 = tl.where(tmp308, tmp309, tmp314)
    tmp316 = tl.where(tmp303, tmp304, tmp315)
    tmp317 = tl.where(tmp298, tmp299, tmp316)
    tmp318 = tl.full([1], 56, tl.int64)
    tmp319 = tmp0 >= tmp318
    tmp320 = tl.full([1], 57, tl.int64)
    tmp321 = tmp0 < tmp320
    tmp322 = tmp319 & tmp321
    tmp323 = tl.load(in_ptr53 + (x0 + 4 * x2), tmp322 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp324 = tl.full([1], 55, tl.int64)
    tmp325 = tmp0 >= tmp324
    tmp326 = tmp0 < tmp318
    tmp327 = tmp325 & tmp326
    tmp328 = tl.load(in_ptr54 + (x0 + 4 * x2), tmp327 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp329 = tl.full([1], 54, tl.int64)
    tmp330 = tmp0 >= tmp329
    tmp331 = tmp0 < tmp324
    tmp332 = tmp330 & tmp331
    tmp333 = tl.load(in_ptr55 + (x0 + 4 * x2), tmp332 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp334 = tmp0 >= tmp296
    tmp335 = tmp0 < tmp329
    tmp336 = tmp334 & tmp335
    tmp337 = tl.load(in_ptr56 + (x0 + 4 * x2), tmp336 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp338 = tl.where(tmp336, tmp337, tmp317)
    tmp339 = tl.where(tmp332, tmp333, tmp338)
    tmp340 = tl.where(tmp327, tmp328, tmp339)
    tmp341 = tl.where(tmp322, tmp323, tmp340)
    tmp342 = tl.full([1], 60, tl.int64)
    tmp343 = tmp0 >= tmp342
    tmp344 = tl.full([1], 61, tl.int64)
    tmp345 = tmp0 < tmp344
    tmp346 = tmp343 & tmp345
    tmp347 = tl.load(in_ptr57 + (x0 + 4 * x2), tmp346 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp348 = tl.full([1], 59, tl.int64)
    tmp349 = tmp0 >= tmp348
    tmp350 = tmp0 < tmp342
    tmp351 = tmp349 & tmp350
    tmp352 = tl.load(in_ptr58 + (x0 + 4 * x2), tmp351 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp353 = tl.full([1], 58, tl.int64)
    tmp354 = tmp0 >= tmp353
    tmp355 = tmp0 < tmp348
    tmp356 = tmp354 & tmp355
    tmp357 = tl.load(in_ptr59 + (x0 + 4 * x2), tmp356 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp358 = tmp0 >= tmp320
    tmp359 = tmp0 < tmp353
    tmp360 = tmp358 & tmp359
    tmp361 = tl.load(in_ptr60 + (x0 + 4 * x2), tmp360 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp362 = tl.where(tmp360, tmp361, tmp341)
    tmp363 = tl.where(tmp356, tmp357, tmp362)
    tmp364 = tl.where(tmp351, tmp352, tmp363)
    tmp365 = tl.where(tmp346, tmp347, tmp364)
    tmp366 = tl.full([1], 63, tl.int64)
    tmp367 = tmp0 >= tmp366
    tmp368 = tl.load(in_ptr61 + (x0 + 4 * x2), tmp367 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp369 = tl.full([1], 62, tl.int64)
    tmp370 = tmp0 >= tmp369
    tmp371 = tmp0 < tmp366
    tmp372 = tmp370 & tmp371
    tmp373 = tl.load(in_ptr62 + (x0 + 4 * x2), tmp372 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp374 = tmp0 >= tmp344
    tmp375 = tmp0 < tmp369
    tmp376 = tmp374 & tmp375
    tmp377 = tl.load(in_ptr63 + (x0 + 4 * x2), tmp376 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp378 = tl.where(tmp376, tmp377, tmp365)
    tmp379 = tl.where(tmp372, tmp373, tmp378)
    tmp380 = tl.where(tmp367, tmp368, tmp379)
    tl.store(in_out_ptr0 + x3, tmp380, xmask)


@triton.jit
def triton_red_fused_div_linalg_vector_norm_5(in_out_ptr0, in_ptr0,
    out_ptr0, out_ptr1, xnumel, rnumel, XBLOCK: tl.constexpr, RBLOCK: tl.
    constexpr):
    xnumel = 4
    rnumel = 256
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    rbase = tl.arange(0, RBLOCK)[None, :]
    x0 = xindex
    _tmp18 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    for roffset in range(0, rnumel, RBLOCK):
        rindex = roffset + rbase
        rmask = rindex < rnumel
        r3 = rindex
        r2 = rindex // 4
        tmp0 = tl.load(in_ptr0 + (r3 + 256 * x0), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp1 = tl.load(in_ptr0 + (4 * r2 + 256 * x0), rmask & xmask,
            eviction_policy='evict_last', other=0.0)
        tmp3 = tl.load(in_ptr0 + (1 + 4 * r2 + 256 * x0), rmask & xmask,
            eviction_policy='evict_last', other=0.0)
        tmp6 = tl.load(in_ptr0 + (2 + 4 * r2 + 256 * x0), rmask & xmask,
            eviction_policy='evict_last', other=0.0)
        tmp9 = tl.load(in_ptr0 + (3 + 4 * r2 + 256 * x0), rmask & xmask,
            eviction_policy='evict_last', other=0.0)
        tmp2 = tmp1 * tmp1
        tmp4 = tmp3 * tmp3
        tmp5 = tmp2 + tmp4
        tmp7 = tmp6 * tmp6
        tmp8 = tmp5 + tmp7
        tmp10 = tmp9 * tmp9
        tmp11 = tmp8 + tmp10
        tmp12 = libdevice.sqrt(tmp11)
        tmp13 = 1e-12
        tmp14 = triton_helpers.maximum(tmp12, tmp13)
        tmp15 = tmp0 / tmp14
        tmp16 = tmp15 * tmp15
        tmp17 = tl.broadcast_to(tmp16, [XBLOCK, RBLOCK])
        tmp19 = _tmp18 + tmp17
        _tmp18 = tl.where(rmask & xmask, tmp19, _tmp18)
        tl.store(out_ptr0 + (r3 + 256 * x0), tmp15, rmask & xmask)
    tmp18 = tl.sum(_tmp18, 1)[:, None]
    tmp20 = libdevice.sqrt(tmp18)
    tl.debug_barrier()
    tl.store(in_out_ptr0 + x0, tmp20, xmask)
    for roffset in range(0, rnumel, RBLOCK):
        rindex = roffset + rbase
        rmask = rindex < rnumel
        r3 = rindex
        tmp21 = tl.load(out_ptr0 + (r3 + 256 * x0), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp22 = 1e-12
        tmp23 = triton_helpers.maximum(tmp20, tmp22)
        tmp24 = tmp21 / tmp23
        tl.store(out_ptr1 + (r3 + 256 * x0), tmp24, rmask & xmask)


def call(args):
    primals_1, primals_2, primals_3 = args
    args.clear()
    assert_size_stride(primals_1, (4, 4, 4, 4), (64, 16, 4, 1))
    assert_size_stride(primals_2, (64, 4, 1, 1), (4, 1, 1, 1))
    assert_size_stride(primals_3, (64, 4), (4, 1))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = extern_kernels.convolution(primals_1, primals_2, stride=(1, 
            1), padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf0, (4, 64, 4, 4), (1024, 16, 4, 1))
        buf1 = empty_strided_cuda((4, 1, 16), (16, 16, 1), torch.float32)
        buf2 = empty_strided_cuda((4, 1, 16), (16, 16, 1), torch.float32)
        get_raw_stream(0)
        triton_per_fused__softmax_0[grid(64)](buf0, buf1, buf2, 64, 64,
            XBLOCK=32, num_warps=8, num_stages=1)
        buf4 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf6 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf8 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf10 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf13 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf15 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf17 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf19 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf22 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf24 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf26 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf28 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf31 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf33 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf35 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf37 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf40 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf42 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf44 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf46 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf49 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf51 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf53 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf55 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf58 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf60 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf62 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf64 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf3 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf5 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf7 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf9 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf11 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf14 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf16 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf18 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf20 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf23 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf25 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf27 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf29 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf32 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf34 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf36 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf38 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf41 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf43 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf45 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf47 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf50 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf52 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf54 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf56 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf59 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf61 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf63 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf65 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        triton_per_fused_mul_sub_sum_1[grid(16)](primals_1, primals_3, buf0,
            buf1, buf2, buf4, buf6, buf8, buf10, buf13, buf15, buf17, buf19,
            buf22, buf24, buf26, buf28, buf31, buf33, buf35, buf37, buf40,
            buf42, buf44, buf46, buf49, buf51, buf53, buf55, buf58, buf60,
            buf62, buf64, buf3, buf5, buf7, buf9, buf11, buf14, buf16,
            buf18, buf20, buf23, buf25, buf27, buf29, buf32, buf34, buf36,
            buf38, buf41, buf43, buf45, buf47, buf50, buf52, buf54, buf56,
            buf59, buf61, buf63, buf65, 16, 16, XBLOCK=1, num_warps=2,
            num_stages=1)
        buf67 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf69 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf71 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf73 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf76 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf78 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf80 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf82 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf85 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf87 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf89 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf91 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf94 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf96 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf98 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf100 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf103 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf105 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf107 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf109 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf112 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf114 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf116 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf118 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf121 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf123 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf125 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf127 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf68 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf70 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf72 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf74 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf77 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf79 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf81 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf83 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf86 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf88 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf90 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf92 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf95 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf97 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf99 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf101 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf104 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf106 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf108 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf110 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf113 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf115 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf117 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf119 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf122 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf124 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf126 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf128 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        triton_per_fused_mul_sub_sum_2[grid(16)](primals_1, primals_3, buf0,
            buf1, buf2, buf67, buf69, buf71, buf73, buf76, buf78, buf80,
            buf82, buf85, buf87, buf89, buf91, buf94, buf96, buf98, buf100,
            buf103, buf105, buf107, buf109, buf112, buf114, buf116, buf118,
            buf121, buf123, buf125, buf127, buf68, buf70, buf72, buf74,
            buf77, buf79, buf81, buf83, buf86, buf88, buf90, buf92, buf95,
            buf97, buf99, buf101, buf104, buf106, buf108, buf110, buf113,
            buf115, buf117, buf119, buf122, buf124, buf126, buf128, 16, 16,
            XBLOCK=1, num_warps=2, num_stages=1)
        buf130 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf132 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf134 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf136 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf139 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf141 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf143 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf131 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf133 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf135 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf137 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf140 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf142 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf144 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        triton_per_fused_mul_sub_sum_3[grid(16)](primals_1, primals_3, buf0,
            buf1, buf2, buf130, buf132, buf134, buf136, buf139, buf141,
            buf143, buf131, buf133, buf135, buf137, buf140, buf142, buf144,
            16, 16, XBLOCK=1, num_warps=2, num_stages=1)
        buf12 = empty_strided_cuda((4, 64, 4), (256, 4, 1), torch.float32)
        buf21 = buf12
        del buf12
        buf30 = buf21
        del buf21
        buf39 = buf30
        del buf30
        buf48 = buf39
        del buf39
        buf57 = buf48
        del buf48
        buf66 = buf57
        del buf57
        buf75 = buf66
        del buf66
        buf84 = buf75
        del buf75
        buf93 = buf84
        del buf84
        buf102 = buf93
        del buf93
        buf111 = buf102
        del buf102
        buf120 = buf111
        del buf111
        buf129 = buf120
        del buf120
        buf138 = buf129
        del buf129
        buf145 = buf138
        del buf138
        triton_poi_fused_copy_zeros_4[grid(1024)](buf145, buf11, buf9, buf7,
            buf5, buf3, buf20, buf18, buf16, buf14, buf29, buf27, buf25,
            buf23, buf38, buf36, buf34, buf32, buf47, buf45, buf43, buf41,
            buf56, buf54, buf52, buf50, buf65, buf63, buf61, buf59, buf74,
            buf72, buf70, buf68, buf83, buf81, buf79, buf77, buf92, buf90,
            buf88, buf86, buf101, buf99, buf97, buf95, buf110, buf108,
            buf106, buf104, buf119, buf117, buf115, buf113, buf128, buf126,
            buf124, buf122, buf137, buf135, buf133, buf131, buf144, buf142,
            buf140, 1024, XBLOCK=128, num_warps=4, num_stages=1)
        del buf101
        del buf104
        del buf106
        del buf108
        del buf11
        del buf110
        del buf113
        del buf115
        del buf117
        del buf119
        del buf122
        del buf124
        del buf126
        del buf128
        del buf131
        del buf133
        del buf135
        del buf137
        del buf14
        del buf140
        del buf142
        del buf144
        del buf16
        del buf18
        del buf20
        del buf23
        del buf25
        del buf27
        del buf29
        del buf3
        del buf32
        del buf34
        del buf36
        del buf38
        del buf41
        del buf43
        del buf45
        del buf47
        del buf5
        del buf50
        del buf52
        del buf54
        del buf56
        del buf59
        del buf61
        del buf63
        del buf65
        del buf68
        del buf7
        del buf70
        del buf72
        del buf74
        del buf77
        del buf79
        del buf81
        del buf83
        del buf86
        del buf88
        del buf9
        del buf90
        del buf92
        del buf95
        del buf97
        del buf99
        buf146 = empty_strided_cuda((4, 64, 4), (256, 4, 1), torch.float32)
        buf147 = empty_strided_cuda((4, 1), (1, 4), torch.float32)
        buf148 = reinterpret_tensor(buf147, (4, 1), (1, 1), 0)
        del buf147
        buf149 = empty_strided_cuda((4, 256), (256, 1), torch.float32)
        triton_red_fused_div_linalg_vector_norm_5[grid(4)](buf148, buf145,
            buf146, buf149, 4, 256, XBLOCK=1, RBLOCK=256, num_warps=2,
            num_stages=1)
        del buf146
    return (buf149, primals_1, primals_2, buf0, buf1, buf2,
        reinterpret_tensor(primals_3, (1, 4), (4, 1), 0), buf4, buf6, buf8,
        buf10, buf13, buf15, buf17, buf19, buf22, buf24, buf26, buf28,
        buf31, buf33, buf35, buf37, buf40, buf42, buf44, buf46, buf49,
        buf51, buf53, buf55, buf58, buf60, buf62, buf64, buf67, buf69,
        buf71, buf73, buf76, buf78, buf80, buf82, buf85, buf87, buf89,
        buf91, buf94, buf96, buf98, buf100, buf103, buf105, buf107, buf109,
        buf112, buf114, buf116, buf118, buf121, buf123, buf125, buf127,
        buf130, buf132, buf134, buf136, buf139, buf141, buf143, buf145, buf148)


class NetVLADNew(nn.Module):
    """NetVLAD layer implementation"""

    def __init__(self, dim, num_clusters=64):
        """
        Args:
            dim : int
                Dimension of descriptors
            num_clusters : int
                The number of clusters
        """
        super(NetVLADNew, self).__init__()
        self.num_clusters = num_clusters
        self.conv = nn.Conv2d(dim, num_clusters, kernel_size=(1, 1), bias=False
            )
        self.centroids = nn.Parameter(torch.rand(num_clusters, dim))

    def init_params(self, clsts, traindescs):
        clsts_assign = clsts / np.linalg.norm(clsts, axis=1, keepdims=True)
        dots = np.dot(clsts_assign, traindescs.T)
        dots.sort(0)
        dots = dots[::-1, :]
        alpha = (-np.log(0.01) / np.mean(dots[0, :] - dots[1, :])).item()
        self.centroids = nn.Parameter(torch.from_numpy(clsts))
        self.conv.weight = nn.Parameter(torch.from_numpy(alpha *
            clsts_assign).unsqueeze(2).unsqueeze(3))
        self.conv.bias = None

    def forward(self, input_0):
        primals_3 = self.centroids
        primals_2 = self.conv.weight
        primals_1 = input_0
        output = call([primals_1, primals_2, primals_3])
        return output[0]
