# 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_7/inductor_cache/tb/ctbeeotfqzbneeewwh2aiay5657nsb5gfe5znphkkjrpdvh7ojsn.py
# Topologically Sorted Source Nodes: [x], Original ATen: [aten.linalg_vector_norm]
# Source node to ATen node mapping:
#   x => pow_1, sum_1
# Graph fragment:
#   %pow_1 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Scalar](args = (%primals_1, 2), kwargs = {})
#   %sum_1 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_1, [1], True), kwargs = {})
triton_red_fused_linalg_vector_norm_0 = async_compile.triton('triton_red_fused_linalg_vector_norm_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.reduction(
    size_hints=[16384, 128],
    reduction_hint=ReductionHint.DEFAULT,
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32', 3: '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), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_red_fused_linalg_vector_norm_0', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 1, '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_linalg_vector_norm_0(in_ptr0, out_ptr0, xnumel, rnumel, XBLOCK : tl.constexpr, RBLOCK : tl.constexpr):
    xnumel = 16384
    rnumel = 128
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = tl.full([XBLOCK, RBLOCK], True, tl.int1)
    rbase = tl.arange(0, RBLOCK)[None, :]
    x0 = xindex % 4096
    x1 = (xindex // 4096)
    _tmp3 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    x3 = xindex
    for roffset in range(0, rnumel, RBLOCK):
        rindex = roffset + rbase
        rmask = rindex < rnumel
        r2 = rindex
        tmp0 = tl.load(in_ptr0 + (x0 + (4096*r2) + (524288*x1)), rmask, eviction_policy='evict_last', other=0.0)
        tmp1 = tmp0 * tmp0
        tmp2 = tl.broadcast_to(tmp1, [XBLOCK, RBLOCK])
        tmp4 = _tmp3 + tmp2
        _tmp3 = tl.where(rmask, tmp4, _tmp3)
    tmp3 = tl.sum(_tmp3, 1)[:, None]
    tl.store(out_ptr0 + (x3), tmp3, None)
''', device_str='cuda')


# kernel path: runs/run_shard_7/inductor_cache/ef/cefdzljppvz2lfunb6uf63d2oi3ptkpnhsxqbeffjopee5fas75z.py
# Topologically Sorted Source Nodes: [x, residual_2, residual_4, residual_6, residual_8, residual_10, residual_12, residual_14, residual_16, residual_18, residual_20, residual_22, residual_24, residual_26, residual_28, residual_30, residual_32, residual_34, residual_36, residual_38, residual_40, residual_42, residual_44, residual_46, residual_48, residual_50, residual_52, residual_54, residual_56, residual_58, residual_60, residual_62, residual_64, residual_66, residual_68, residual_70, residual_72, residual_74, residual_76, residual_78, residual_80, residual_82, residual_84, residual_86, residual_88, residual_90, residual_92, residual_94, residual_96, residual_98, residual_100, residual_102, residual_104, residual_106, residual_108, residual_110, residual_112, residual_114, residual_116, residual_118, residual_120, residual_122, residual_124, residual_126], Original ATen: [aten.div, aten.sub]
# Source node to ATen node mapping:
#   residual_10 => sub_6
#   residual_100 => sub_51
#   residual_102 => sub_52
#   residual_104 => sub_53
#   residual_106 => sub_54
#   residual_108 => sub_55
#   residual_110 => sub_56
#   residual_112 => sub_57
#   residual_114 => sub_58
#   residual_116 => sub_59
#   residual_118 => sub_60
#   residual_12 => sub_7
#   residual_120 => sub_61
#   residual_122 => sub_62
#   residual_124 => sub_63
#   residual_126 => sub_64
#   residual_14 => sub_8
#   residual_16 => sub_9
#   residual_18 => sub_10
#   residual_2 => sub_2
#   residual_20 => sub_11
#   residual_22 => sub_12
#   residual_24 => sub_13
#   residual_26 => sub_14
#   residual_28 => sub_15
#   residual_30 => sub_16
#   residual_32 => sub_17
#   residual_34 => sub_18
#   residual_36 => sub_19
#   residual_38 => sub_20
#   residual_4 => sub_3
#   residual_40 => sub_21
#   residual_42 => sub_22
#   residual_44 => sub_23
#   residual_46 => sub_24
#   residual_48 => sub_25
#   residual_50 => sub_26
#   residual_52 => sub_27
#   residual_54 => sub_28
#   residual_56 => sub_29
#   residual_58 => sub_30
#   residual_6 => sub_4
#   residual_60 => sub_31
#   residual_62 => sub_32
#   residual_64 => sub_33
#   residual_66 => sub_34
#   residual_68 => sub_35
#   residual_70 => sub_36
#   residual_72 => sub_37
#   residual_74 => sub_38
#   residual_76 => sub_39
#   residual_78 => sub_40
#   residual_8 => sub_5
#   residual_80 => sub_41
#   residual_82 => sub_42
#   residual_84 => sub_43
#   residual_86 => sub_44
#   residual_88 => sub_45
#   residual_90 => sub_46
#   residual_92 => sub_47
#   residual_94 => sub_48
#   residual_96 => sub_49
#   residual_98 => sub_50
#   x => div
# Graph fragment:
#   %div : [num_users=3] = call_function[target=torch.ops.aten.div.Tensor](args = (%primals_1, %expand), kwargs = {})
#   %sub_2 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_4), kwargs = {})
#   %sub_3 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_7), kwargs = {})
#   %sub_4 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_10), kwargs = {})
#   %sub_5 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_13), kwargs = {})
#   %sub_6 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_16), kwargs = {})
#   %sub_7 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_19), kwargs = {})
#   %sub_8 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_22), kwargs = {})
#   %sub_9 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_25), kwargs = {})
#   %sub_10 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_28), kwargs = {})
#   %sub_11 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_31), kwargs = {})
#   %sub_12 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_34), kwargs = {})
#   %sub_13 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_37), kwargs = {})
#   %sub_14 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_40), kwargs = {})
#   %sub_15 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_43), kwargs = {})
#   %sub_16 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_46), kwargs = {})
#   %sub_17 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_49), kwargs = {})
#   %sub_18 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_52), kwargs = {})
#   %sub_19 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_55), kwargs = {})
#   %sub_20 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_58), kwargs = {})
#   %sub_21 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_61), kwargs = {})
#   %sub_22 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_64), kwargs = {})
#   %sub_23 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_67), kwargs = {})
#   %sub_24 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_70), kwargs = {})
#   %sub_25 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_73), kwargs = {})
#   %sub_26 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_76), kwargs = {})
#   %sub_27 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_79), kwargs = {})
#   %sub_28 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_82), kwargs = {})
#   %sub_29 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_85), kwargs = {})
#   %sub_30 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_88), kwargs = {})
#   %sub_31 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_91), kwargs = {})
#   %sub_32 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_94), kwargs = {})
#   %sub_33 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_97), kwargs = {})
#   %sub_34 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_100), kwargs = {})
#   %sub_35 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_103), kwargs = {})
#   %sub_36 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_106), kwargs = {})
#   %sub_37 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_109), kwargs = {})
#   %sub_38 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_112), kwargs = {})
#   %sub_39 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_115), kwargs = {})
#   %sub_40 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_118), kwargs = {})
#   %sub_41 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_121), kwargs = {})
#   %sub_42 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_124), kwargs = {})
#   %sub_43 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_127), kwargs = {})
#   %sub_44 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_130), kwargs = {})
#   %sub_45 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_133), kwargs = {})
#   %sub_46 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_136), kwargs = {})
#   %sub_47 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_139), kwargs = {})
#   %sub_48 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_142), kwargs = {})
#   %sub_49 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_145), kwargs = {})
#   %sub_50 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_148), kwargs = {})
#   %sub_51 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_151), kwargs = {})
#   %sub_52 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_154), kwargs = {})
#   %sub_53 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_157), kwargs = {})
#   %sub_54 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_160), kwargs = {})
#   %sub_55 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_163), kwargs = {})
#   %sub_56 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_166), kwargs = {})
#   %sub_57 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_169), kwargs = {})
#   %sub_58 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_172), kwargs = {})
#   %sub_59 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_175), kwargs = {})
#   %sub_60 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_178), kwargs = {})
#   %sub_61 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_181), kwargs = {})
#   %sub_62 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_184), kwargs = {})
#   %sub_63 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_187), kwargs = {})
#   %sub_64 : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%permute, %unsqueeze_190), kwargs = {})
triton_poi_fused_div_sub_1 = async_compile.triton('triton_poi_fused_div_sub_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.pointwise(
    size_hints=[2097152], 
    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: '*fp32', 66: '*fp32', 67: '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, 66, 67), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_div_sub_1', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 65, '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_div_sub_1(in_ptr0, in_ptr1, in_ptr2, 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, out_ptr57, out_ptr58, out_ptr59, out_ptr60, out_ptr61, out_ptr62, out_ptr63, xnumel, XBLOCK : tl.constexpr):
    xnumel = 2097152
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = tl.full([XBLOCK], True, tl.int1)
    x3 = xindex
    x0 = xindex % 4096
    x2 = (xindex // 524288)
    x1 = (xindex // 4096) % 128
    tmp0 = tl.load(in_ptr0 + (x3), None)
    tmp1 = tl.load(in_ptr1 + (x0 + (4096*x2)), None, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr2 + (128 + x1), None, eviction_policy='evict_last')
    tmp8 = tl.load(in_ptr2 + (256 + x1), None, eviction_policy='evict_last')
    tmp10 = tl.load(in_ptr2 + (384 + x1), None, eviction_policy='evict_last')
    tmp12 = tl.load(in_ptr2 + (512 + x1), None, eviction_policy='evict_last')
    tmp14 = tl.load(in_ptr2 + (640 + x1), None, eviction_policy='evict_last')
    tmp16 = tl.load(in_ptr2 + (768 + x1), None, eviction_policy='evict_last')
    tmp18 = tl.load(in_ptr2 + (896 + x1), None, eviction_policy='evict_last')
    tmp20 = tl.load(in_ptr2 + (1024 + x1), None, eviction_policy='evict_last')
    tmp22 = tl.load(in_ptr2 + (1152 + x1), None, eviction_policy='evict_last')
    tmp24 = tl.load(in_ptr2 + (1280 + x1), None, eviction_policy='evict_last')
    tmp26 = tl.load(in_ptr2 + (1408 + x1), None, eviction_policy='evict_last')
    tmp28 = tl.load(in_ptr2 + (1536 + x1), None, eviction_policy='evict_last')
    tmp30 = tl.load(in_ptr2 + (1664 + x1), None, eviction_policy='evict_last')
    tmp32 = tl.load(in_ptr2 + (1792 + x1), None, eviction_policy='evict_last')
    tmp34 = tl.load(in_ptr2 + (1920 + x1), None, eviction_policy='evict_last')
    tmp36 = tl.load(in_ptr2 + (2048 + x1), None, eviction_policy='evict_last')
    tmp38 = tl.load(in_ptr2 + (2176 + x1), None, eviction_policy='evict_last')
    tmp40 = tl.load(in_ptr2 + (2304 + x1), None, eviction_policy='evict_last')
    tmp42 = tl.load(in_ptr2 + (2432 + x1), None, eviction_policy='evict_last')
    tmp44 = tl.load(in_ptr2 + (2560 + x1), None, eviction_policy='evict_last')
    tmp46 = tl.load(in_ptr2 + (2688 + x1), None, eviction_policy='evict_last')
    tmp48 = tl.load(in_ptr2 + (2816 + x1), None, eviction_policy='evict_last')
    tmp50 = tl.load(in_ptr2 + (2944 + x1), None, eviction_policy='evict_last')
    tmp52 = tl.load(in_ptr2 + (3072 + x1), None, eviction_policy='evict_last')
    tmp54 = tl.load(in_ptr2 + (3200 + x1), None, eviction_policy='evict_last')
    tmp56 = tl.load(in_ptr2 + (3328 + x1), None, eviction_policy='evict_last')
    tmp58 = tl.load(in_ptr2 + (3456 + x1), None, eviction_policy='evict_last')
    tmp60 = tl.load(in_ptr2 + (3584 + x1), None, eviction_policy='evict_last')
    tmp62 = tl.load(in_ptr2 + (3712 + x1), None, eviction_policy='evict_last')
    tmp64 = tl.load(in_ptr2 + (3840 + x1), None, eviction_policy='evict_last')
    tmp66 = tl.load(in_ptr2 + (3968 + x1), None, eviction_policy='evict_last')
    tmp68 = tl.load(in_ptr2 + (4096 + x1), None, eviction_policy='evict_last')
    tmp70 = tl.load(in_ptr2 + (4224 + x1), None, eviction_policy='evict_last')
    tmp72 = tl.load(in_ptr2 + (4352 + x1), None, eviction_policy='evict_last')
    tmp74 = tl.load(in_ptr2 + (4480 + x1), None, eviction_policy='evict_last')
    tmp76 = tl.load(in_ptr2 + (4608 + x1), None, eviction_policy='evict_last')
    tmp78 = tl.load(in_ptr2 + (4736 + x1), None, eviction_policy='evict_last')
    tmp80 = tl.load(in_ptr2 + (4864 + x1), None, eviction_policy='evict_last')
    tmp82 = tl.load(in_ptr2 + (4992 + x1), None, eviction_policy='evict_last')
    tmp84 = tl.load(in_ptr2 + (5120 + x1), None, eviction_policy='evict_last')
    tmp86 = tl.load(in_ptr2 + (5248 + x1), None, eviction_policy='evict_last')
    tmp88 = tl.load(in_ptr2 + (5376 + x1), None, eviction_policy='evict_last')
    tmp90 = tl.load(in_ptr2 + (5504 + x1), None, eviction_policy='evict_last')
    tmp92 = tl.load(in_ptr2 + (5632 + x1), None, eviction_policy='evict_last')
    tmp94 = tl.load(in_ptr2 + (5760 + x1), None, eviction_policy='evict_last')
    tmp96 = tl.load(in_ptr2 + (5888 + x1), None, eviction_policy='evict_last')
    tmp98 = tl.load(in_ptr2 + (6016 + x1), None, eviction_policy='evict_last')
    tmp100 = tl.load(in_ptr2 + (6144 + x1), None, eviction_policy='evict_last')
    tmp102 = tl.load(in_ptr2 + (6272 + x1), None, eviction_policy='evict_last')
    tmp104 = tl.load(in_ptr2 + (6400 + x1), None, eviction_policy='evict_last')
    tmp106 = tl.load(in_ptr2 + (6528 + x1), None, eviction_policy='evict_last')
    tmp108 = tl.load(in_ptr2 + (6656 + x1), None, eviction_policy='evict_last')
    tmp110 = tl.load(in_ptr2 + (6784 + x1), None, eviction_policy='evict_last')
    tmp112 = tl.load(in_ptr2 + (6912 + x1), None, eviction_policy='evict_last')
    tmp114 = tl.load(in_ptr2 + (7040 + x1), None, eviction_policy='evict_last')
    tmp116 = tl.load(in_ptr2 + (7168 + x1), None, eviction_policy='evict_last')
    tmp118 = tl.load(in_ptr2 + (7296 + x1), None, eviction_policy='evict_last')
    tmp120 = tl.load(in_ptr2 + (7424 + x1), None, eviction_policy='evict_last')
    tmp122 = tl.load(in_ptr2 + (7552 + x1), None, eviction_policy='evict_last')
    tmp124 = tl.load(in_ptr2 + (7680 + x1), None, eviction_policy='evict_last')
    tmp126 = tl.load(in_ptr2 + (7808 + x1), None, eviction_policy='evict_last')
    tmp128 = tl.load(in_ptr2 + (7936 + x1), None, eviction_policy='evict_last')
    tmp130 = tl.load(in_ptr2 + (8064 + x1), None, eviction_policy='evict_last')
    tmp2 = libdevice.sqrt(tmp1)
    tmp3 = 1e-12
    tmp4 = triton_helpers.maximum(tmp2, tmp3)
    tmp5 = tmp0 / tmp4
    tmp7 = tmp5 - tmp6
    tmp9 = tmp5 - tmp8
    tmp11 = tmp5 - tmp10
    tmp13 = tmp5 - tmp12
    tmp15 = tmp5 - tmp14
    tmp17 = tmp5 - tmp16
    tmp19 = tmp5 - tmp18
    tmp21 = tmp5 - tmp20
    tmp23 = tmp5 - tmp22
    tmp25 = tmp5 - tmp24
    tmp27 = tmp5 - tmp26
    tmp29 = tmp5 - tmp28
    tmp31 = tmp5 - tmp30
    tmp33 = tmp5 - tmp32
    tmp35 = tmp5 - tmp34
    tmp37 = tmp5 - tmp36
    tmp39 = tmp5 - tmp38
    tmp41 = tmp5 - tmp40
    tmp43 = tmp5 - tmp42
    tmp45 = tmp5 - tmp44
    tmp47 = tmp5 - tmp46
    tmp49 = tmp5 - tmp48
    tmp51 = tmp5 - tmp50
    tmp53 = tmp5 - tmp52
    tmp55 = tmp5 - tmp54
    tmp57 = tmp5 - tmp56
    tmp59 = tmp5 - tmp58
    tmp61 = tmp5 - tmp60
    tmp63 = tmp5 - tmp62
    tmp65 = tmp5 - tmp64
    tmp67 = tmp5 - tmp66
    tmp69 = tmp5 - tmp68
    tmp71 = tmp5 - tmp70
    tmp73 = tmp5 - tmp72
    tmp75 = tmp5 - tmp74
    tmp77 = tmp5 - tmp76
    tmp79 = tmp5 - tmp78
    tmp81 = tmp5 - tmp80
    tmp83 = tmp5 - tmp82
    tmp85 = tmp5 - tmp84
    tmp87 = tmp5 - tmp86
    tmp89 = tmp5 - tmp88
    tmp91 = tmp5 - tmp90
    tmp93 = tmp5 - tmp92
    tmp95 = tmp5 - tmp94
    tmp97 = tmp5 - tmp96
    tmp99 = tmp5 - tmp98
    tmp101 = tmp5 - tmp100
    tmp103 = tmp5 - tmp102
    tmp105 = tmp5 - tmp104
    tmp107 = tmp5 - tmp106
    tmp109 = tmp5 - tmp108
    tmp111 = tmp5 - tmp110
    tmp113 = tmp5 - tmp112
    tmp115 = tmp5 - tmp114
    tmp117 = tmp5 - tmp116
    tmp119 = tmp5 - tmp118
    tmp121 = tmp5 - tmp120
    tmp123 = tmp5 - tmp122
    tmp125 = tmp5 - tmp124
    tmp127 = tmp5 - tmp126
    tmp129 = tmp5 - tmp128
    tmp131 = tmp5 - tmp130
    tl.store(out_ptr0 + (x3), tmp5, None)
    tl.store(out_ptr1 + (x3), tmp7, None)
    tl.store(out_ptr2 + (x3), tmp9, None)
    tl.store(out_ptr3 + (x3), tmp11, None)
    tl.store(out_ptr4 + (x3), tmp13, None)
    tl.store(out_ptr5 + (x3), tmp15, None)
    tl.store(out_ptr6 + (x3), tmp17, None)
    tl.store(out_ptr7 + (x3), tmp19, None)
    tl.store(out_ptr8 + (x3), tmp21, None)
    tl.store(out_ptr9 + (x3), tmp23, None)
    tl.store(out_ptr10 + (x3), tmp25, None)
    tl.store(out_ptr11 + (x3), tmp27, None)
    tl.store(out_ptr12 + (x3), tmp29, None)
    tl.store(out_ptr13 + (x3), tmp31, None)
    tl.store(out_ptr14 + (x3), tmp33, None)
    tl.store(out_ptr15 + (x3), tmp35, None)
    tl.store(out_ptr16 + (x3), tmp37, None)
    tl.store(out_ptr17 + (x3), tmp39, None)
    tl.store(out_ptr18 + (x3), tmp41, None)
    tl.store(out_ptr19 + (x3), tmp43, None)
    tl.store(out_ptr20 + (x3), tmp45, None)
    tl.store(out_ptr21 + (x3), tmp47, None)
    tl.store(out_ptr22 + (x3), tmp49, None)
    tl.store(out_ptr23 + (x3), tmp51, None)
    tl.store(out_ptr24 + (x3), tmp53, None)
    tl.store(out_ptr25 + (x3), tmp55, None)
    tl.store(out_ptr26 + (x3), tmp57, None)
    tl.store(out_ptr27 + (x3), tmp59, None)
    tl.store(out_ptr28 + (x3), tmp61, None)
    tl.store(out_ptr29 + (x3), tmp63, None)
    tl.store(out_ptr30 + (x3), tmp65, None)
    tl.store(out_ptr31 + (x3), tmp67, None)
    tl.store(out_ptr32 + (x3), tmp69, None)
    tl.store(out_ptr33 + (x3), tmp71, None)
    tl.store(out_ptr34 + (x3), tmp73, None)
    tl.store(out_ptr35 + (x3), tmp75, None)
    tl.store(out_ptr36 + (x3), tmp77, None)
    tl.store(out_ptr37 + (x3), tmp79, None)
    tl.store(out_ptr38 + (x3), tmp81, None)
    tl.store(out_ptr39 + (x3), tmp83, None)
    tl.store(out_ptr40 + (x3), tmp85, None)
    tl.store(out_ptr41 + (x3), tmp87, None)
    tl.store(out_ptr42 + (x3), tmp89, None)
    tl.store(out_ptr43 + (x3), tmp91, None)
    tl.store(out_ptr44 + (x3), tmp93, None)
    tl.store(out_ptr45 + (x3), tmp95, None)
    tl.store(out_ptr46 + (x3), tmp97, None)
    tl.store(out_ptr47 + (x3), tmp99, None)
    tl.store(out_ptr48 + (x3), tmp101, None)
    tl.store(out_ptr49 + (x3), tmp103, None)
    tl.store(out_ptr50 + (x3), tmp105, None)
    tl.store(out_ptr51 + (x3), tmp107, None)
    tl.store(out_ptr52 + (x3), tmp109, None)
    tl.store(out_ptr53 + (x3), tmp111, None)
    tl.store(out_ptr54 + (x3), tmp113, None)
    tl.store(out_ptr55 + (x3), tmp115, None)
    tl.store(out_ptr56 + (x3), tmp117, None)
    tl.store(out_ptr57 + (x3), tmp119, None)
    tl.store(out_ptr58 + (x3), tmp121, None)
    tl.store(out_ptr59 + (x3), tmp123, None)
    tl.store(out_ptr60 + (x3), tmp125, None)
    tl.store(out_ptr61 + (x3), tmp127, None)
    tl.store(out_ptr62 + (x3), tmp129, None)
    tl.store(out_ptr63 + (x3), tmp131, None)
''', device_str='cuda')


# kernel path: runs/run_shard_7/inductor_cache/u6/cu6dgbkwo4zyodk2zqiay4hwrwemkqpxzmixog3qipqaqcevgo7u.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_2
# 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_2 : [num_users=2] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%exp, [1], True), kwargs = {})
triton_per_fused__softmax_2 = async_compile.triton('triton_per_fused__softmax_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=[16384, 64],
    reduction_hint=ReductionHint.DEFAULT,
    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_2', '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_2(in_ptr0, out_ptr0, out_ptr1, xnumel, rnumel, XBLOCK : tl.constexpr):
    xnumel = 16384
    rnumel = 64
    RBLOCK: tl.constexpr = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = tl.full([XBLOCK, RBLOCK], True, tl.int1)
    rindex = tl.arange(0, RBLOCK)[None, :]
    roffset = 0
    rmask = tl.full([XBLOCK, RBLOCK], True, tl.int1)
    r2 = rindex
    x0 = xindex % 4096
    x1 = (xindex // 4096)
    x3 = xindex
    tmp0 = tl.load(in_ptr0 + (x0 + (4096*r2) + (262144*x1)), None)
    tmp1 = tl.broadcast_to(tmp0, [XBLOCK, RBLOCK])
    tmp3 = triton_helpers.max2(tmp1, 1)[:, None]
    tmp4 = tmp0 - tmp3
    tmp5 = tl_math.exp(tmp4)
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK, RBLOCK])
    tmp8 = tl.sum(tmp6, 1)[:, None]
    tl.store(out_ptr0 + (x3), tmp3, None)
    tl.store(out_ptr1 + (x3), tmp8, None)
''', device_str='cuda')


# kernel path: runs/run_shard_7/inductor_cache/46/c465fdmmhrzvuvb7xjrad46zallycaofrdeajo4ox533uv52dzji.py
# Topologically Sorted Source Nodes: [residual, residual_1, sum_1, residual_3, sum_2, residual_5, sum_3, residual_7, sum_4, residual_9, sum_5, residual_11, sum_6, residual_13, sum_7, residual_15, sum_8, residual_17, sum_9, residual_19, sum_10, residual_21, sum_11, residual_23, sum_12, residual_25, sum_13, residual_27, sum_14, residual_29, sum_15, residual_31, sum_16, residual_33, sum_17, residual_35, sum_18, residual_37, sum_19, residual_39, sum_20, residual_41, sum_21, residual_43, sum_22, residual_45, sum_23, residual_47, sum_24, residual_49, sum_25, residual_51, sum_26, residual_53, sum_27, residual_55, sum_28, 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_11 => mul_5
#   residual_13 => mul_6
#   residual_15 => mul_7
#   residual_17 => mul_8
#   residual_19 => mul_9
#   residual_21 => mul_10
#   residual_23 => mul_11
#   residual_25 => mul_12
#   residual_27 => mul_13
#   residual_29 => mul_14
#   residual_3 => mul_1
#   residual_31 => mul_15
#   residual_33 => mul_16
#   residual_35 => mul_17
#   residual_37 => mul_18
#   residual_39 => mul_19
#   residual_41 => mul_20
#   residual_43 => mul_21
#   residual_45 => mul_22
#   residual_47 => mul_23
#   residual_49 => mul_24
#   residual_5 => mul_2
#   residual_51 => mul_25
#   residual_53 => mul_26
#   residual_55 => mul_27
#   residual_57 => mul_28
#   residual_7 => mul_3
#   residual_9 => mul_4
#   sum_1 => sum_3
#   sum_10 => sum_12
#   sum_11 => sum_13
#   sum_12 => sum_14
#   sum_13 => sum_15
#   sum_14 => sum_16
#   sum_15 => sum_17
#   sum_16 => sum_18
#   sum_17 => sum_19
#   sum_18 => sum_20
#   sum_19 => sum_21
#   sum_2 => sum_4
#   sum_20 => sum_22
#   sum_21 => sum_23
#   sum_22 => sum_24
#   sum_23 => sum_25
#   sum_24 => sum_26
#   sum_25 => sum_27
#   sum_26 => sum_28
#   sum_27 => sum_29
#   sum_28 => sum_30
#   sum_29 => sum_31
#   sum_3 => sum_5
#   sum_4 => sum_6
#   sum_5 => sum_7
#   sum_6 => sum_8
#   sum_7 => sum_9
#   sum_8 => sum_10
#   sum_9 => sum_11
# 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_3 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul, [-1]), kwargs = {})
#   %mul_1 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_2, %unsqueeze_5), kwargs = {})
#   %sum_4 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_1, [-1]), kwargs = {})
#   %mul_2 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_3, %unsqueeze_8), kwargs = {})
#   %sum_5 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_2, [-1]), kwargs = {})
#   %mul_3 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_4, %unsqueeze_11), kwargs = {})
#   %sum_6 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_3, [-1]), kwargs = {})
#   %mul_4 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_5, %unsqueeze_14), kwargs = {})
#   %sum_7 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_4, [-1]), kwargs = {})
#   %mul_5 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_6, %unsqueeze_17), kwargs = {})
#   %sum_8 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_5, [-1]), kwargs = {})
#   %mul_6 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_7, %unsqueeze_20), kwargs = {})
#   %sum_9 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_6, [-1]), kwargs = {})
#   %mul_7 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_8, %unsqueeze_23), kwargs = {})
#   %sum_10 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_7, [-1]), kwargs = {})
#   %mul_8 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_9, %unsqueeze_26), kwargs = {})
#   %sum_11 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_8, [-1]), kwargs = {})
#   %mul_9 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_10, %unsqueeze_29), kwargs = {})
#   %sum_12 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_9, [-1]), kwargs = {})
#   %mul_10 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_11, %unsqueeze_32), kwargs = {})
#   %sum_13 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_10, [-1]), kwargs = {})
#   %mul_11 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_12, %unsqueeze_35), kwargs = {})
#   %sum_14 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_11, [-1]), kwargs = {})
#   %mul_12 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_13, %unsqueeze_38), kwargs = {})
#   %sum_15 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_12, [-1]), kwargs = {})
#   %mul_13 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_14, %unsqueeze_41), kwargs = {})
#   %sum_16 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_13, [-1]), kwargs = {})
#   %mul_14 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_15, %unsqueeze_44), kwargs = {})
#   %sum_17 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_14, [-1]), kwargs = {})
#   %mul_15 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_16, %unsqueeze_47), kwargs = {})
#   %sum_18 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_15, [-1]), kwargs = {})
#   %mul_16 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_17, %unsqueeze_50), kwargs = {})
#   %sum_19 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_16, [-1]), kwargs = {})
#   %mul_17 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_18, %unsqueeze_53), kwargs = {})
#   %sum_20 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_17, [-1]), kwargs = {})
#   %mul_18 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_19, %unsqueeze_56), kwargs = {})
#   %sum_21 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_18, [-1]), kwargs = {})
#   %mul_19 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_20, %unsqueeze_59), kwargs = {})
#   %sum_22 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_19, [-1]), kwargs = {})
#   %mul_20 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_21, %unsqueeze_62), kwargs = {})
#   %sum_23 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_20, [-1]), kwargs = {})
#   %mul_21 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_22, %unsqueeze_65), kwargs = {})
#   %sum_24 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_21, [-1]), kwargs = {})
#   %mul_22 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_23, %unsqueeze_68), kwargs = {})
#   %sum_25 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_22, [-1]), kwargs = {})
#   %mul_23 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_24, %unsqueeze_71), kwargs = {})
#   %sum_26 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_23, [-1]), kwargs = {})
#   %mul_24 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_25, %unsqueeze_74), kwargs = {})
#   %sum_27 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_24, [-1]), kwargs = {})
#   %mul_25 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_26, %unsqueeze_77), kwargs = {})
#   %sum_28 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_25, [-1]), kwargs = {})
#   %mul_26 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_27, %unsqueeze_80), kwargs = {})
#   %sum_29 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_26, [-1]), kwargs = {})
#   %mul_27 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_28, %unsqueeze_83), kwargs = {})
#   %sum_30 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_27, [-1]), kwargs = {})
#   %mul_28 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_29, %unsqueeze_86), kwargs = {})
#   %sum_31 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_28, [-1]), kwargs = {})
triton_red_fused_mul_sub_sum_3 = async_compile.triton('triton_red_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.reduction(
    size_hints=[512, 4096],
    reduction_hint=ReductionHint.INNER,
    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_red_fused_mul_sub_sum_3', '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_red_fused_mul_sub_sum_3(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, 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, xnumel, rnumel, XBLOCK : tl.constexpr, RBLOCK : tl.constexpr):
    xnumel = 512
    rnumel = 4096
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    rbase = tl.arange(0, RBLOCK)[None, :]
    x3 = xindex
    x0 = xindex % 128
    tmp1 = tl.load(in_ptr1 + (x0), xmask, eviction_policy='evict_last')
    x1 = (xindex // 128)
    _tmp11 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp20 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp29 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp38 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp47 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp56 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp65 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp74 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp83 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp92 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp101 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp110 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp119 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp128 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp137 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp146 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp155 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp164 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp173 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp182 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp191 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp200 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp209 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp218 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp227 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp236 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp245 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp254 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp263 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    for roffset in range(0, rnumel, RBLOCK):
        rindex = roffset + rbase
        rmask = rindex < rnumel
        r2 = rindex
        tmp0 = tl.load(in_ptr0 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp3 = tl.load(in_ptr2 + (r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp4 = tl.load(in_ptr3 + (r2 + (4096*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp7 = tl.load(in_ptr4 + (r2 + (4096*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp13 = tl.load(in_ptr5 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp14 = tl.load(in_ptr2 + (4096 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp22 = tl.load(in_ptr6 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp23 = tl.load(in_ptr2 + (8192 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp31 = tl.load(in_ptr7 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp32 = tl.load(in_ptr2 + (12288 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp40 = tl.load(in_ptr8 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp41 = tl.load(in_ptr2 + (16384 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp49 = tl.load(in_ptr9 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp50 = tl.load(in_ptr2 + (20480 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp58 = tl.load(in_ptr10 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp59 = tl.load(in_ptr2 + (24576 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp67 = tl.load(in_ptr11 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp68 = tl.load(in_ptr2 + (28672 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp76 = tl.load(in_ptr12 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp77 = tl.load(in_ptr2 + (32768 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp85 = tl.load(in_ptr13 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp86 = tl.load(in_ptr2 + (36864 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp94 = tl.load(in_ptr14 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp95 = tl.load(in_ptr2 + (40960 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp103 = tl.load(in_ptr15 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp104 = tl.load(in_ptr2 + (45056 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp112 = tl.load(in_ptr16 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp113 = tl.load(in_ptr2 + (49152 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp121 = tl.load(in_ptr17 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp122 = tl.load(in_ptr2 + (53248 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp130 = tl.load(in_ptr18 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp131 = tl.load(in_ptr2 + (57344 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp139 = tl.load(in_ptr19 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp140 = tl.load(in_ptr2 + (61440 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp148 = tl.load(in_ptr20 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp149 = tl.load(in_ptr2 + (65536 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp157 = tl.load(in_ptr21 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp158 = tl.load(in_ptr2 + (69632 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp166 = tl.load(in_ptr22 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp167 = tl.load(in_ptr2 + (73728 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp175 = tl.load(in_ptr23 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp176 = tl.load(in_ptr2 + (77824 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp184 = tl.load(in_ptr24 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp185 = tl.load(in_ptr2 + (81920 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp193 = tl.load(in_ptr25 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp194 = tl.load(in_ptr2 + (86016 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp202 = tl.load(in_ptr26 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp203 = tl.load(in_ptr2 + (90112 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp211 = tl.load(in_ptr27 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp212 = tl.load(in_ptr2 + (94208 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp220 = tl.load(in_ptr28 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp221 = tl.load(in_ptr2 + (98304 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp229 = tl.load(in_ptr29 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp230 = tl.load(in_ptr2 + (102400 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp238 = tl.load(in_ptr30 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp239 = tl.load(in_ptr2 + (106496 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp247 = tl.load(in_ptr31 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp248 = tl.load(in_ptr2 + (110592 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp256 = tl.load(in_ptr32 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp257 = tl.load(in_ptr2 + (114688 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp2 = tmp0 - tmp1
        tmp5 = tmp3 - tmp4
        tmp6 = tl_math.exp(tmp5)
        tmp8 = tmp6 / tmp7
        tmp9 = tmp2 * tmp8
        tmp10 = tl.broadcast_to(tmp9, [XBLOCK, RBLOCK])
        tmp12 = _tmp11 + tmp10
        _tmp11 = tl.where(rmask & xmask, tmp12, _tmp11)
        tmp15 = tmp14 - tmp4
        tmp16 = tl_math.exp(tmp15)
        tmp17 = tmp16 / tmp7
        tmp18 = tmp13 * tmp17
        tmp19 = tl.broadcast_to(tmp18, [XBLOCK, RBLOCK])
        tmp21 = _tmp20 + tmp19
        _tmp20 = tl.where(rmask & xmask, tmp21, _tmp20)
        tmp24 = tmp23 - tmp4
        tmp25 = tl_math.exp(tmp24)
        tmp26 = tmp25 / tmp7
        tmp27 = tmp22 * tmp26
        tmp28 = tl.broadcast_to(tmp27, [XBLOCK, RBLOCK])
        tmp30 = _tmp29 + tmp28
        _tmp29 = tl.where(rmask & xmask, tmp30, _tmp29)
        tmp33 = tmp32 - tmp4
        tmp34 = tl_math.exp(tmp33)
        tmp35 = tmp34 / tmp7
        tmp36 = tmp31 * tmp35
        tmp37 = tl.broadcast_to(tmp36, [XBLOCK, RBLOCK])
        tmp39 = _tmp38 + tmp37
        _tmp38 = tl.where(rmask & xmask, tmp39, _tmp38)
        tmp42 = tmp41 - tmp4
        tmp43 = tl_math.exp(tmp42)
        tmp44 = tmp43 / tmp7
        tmp45 = tmp40 * tmp44
        tmp46 = tl.broadcast_to(tmp45, [XBLOCK, RBLOCK])
        tmp48 = _tmp47 + tmp46
        _tmp47 = tl.where(rmask & xmask, tmp48, _tmp47)
        tmp51 = tmp50 - tmp4
        tmp52 = tl_math.exp(tmp51)
        tmp53 = tmp52 / tmp7
        tmp54 = tmp49 * tmp53
        tmp55 = tl.broadcast_to(tmp54, [XBLOCK, RBLOCK])
        tmp57 = _tmp56 + tmp55
        _tmp56 = tl.where(rmask & xmask, tmp57, _tmp56)
        tmp60 = tmp59 - tmp4
        tmp61 = tl_math.exp(tmp60)
        tmp62 = tmp61 / tmp7
        tmp63 = tmp58 * tmp62
        tmp64 = tl.broadcast_to(tmp63, [XBLOCK, RBLOCK])
        tmp66 = _tmp65 + tmp64
        _tmp65 = tl.where(rmask & xmask, tmp66, _tmp65)
        tmp69 = tmp68 - tmp4
        tmp70 = tl_math.exp(tmp69)
        tmp71 = tmp70 / tmp7
        tmp72 = tmp67 * tmp71
        tmp73 = tl.broadcast_to(tmp72, [XBLOCK, RBLOCK])
        tmp75 = _tmp74 + tmp73
        _tmp74 = tl.where(rmask & xmask, tmp75, _tmp74)
        tmp78 = tmp77 - tmp4
        tmp79 = tl_math.exp(tmp78)
        tmp80 = tmp79 / tmp7
        tmp81 = tmp76 * tmp80
        tmp82 = tl.broadcast_to(tmp81, [XBLOCK, RBLOCK])
        tmp84 = _tmp83 + tmp82
        _tmp83 = tl.where(rmask & xmask, tmp84, _tmp83)
        tmp87 = tmp86 - tmp4
        tmp88 = tl_math.exp(tmp87)
        tmp89 = tmp88 / tmp7
        tmp90 = tmp85 * tmp89
        tmp91 = tl.broadcast_to(tmp90, [XBLOCK, RBLOCK])
        tmp93 = _tmp92 + tmp91
        _tmp92 = tl.where(rmask & xmask, tmp93, _tmp92)
        tmp96 = tmp95 - tmp4
        tmp97 = tl_math.exp(tmp96)
        tmp98 = tmp97 / tmp7
        tmp99 = tmp94 * tmp98
        tmp100 = tl.broadcast_to(tmp99, [XBLOCK, RBLOCK])
        tmp102 = _tmp101 + tmp100
        _tmp101 = tl.where(rmask & xmask, tmp102, _tmp101)
        tmp105 = tmp104 - tmp4
        tmp106 = tl_math.exp(tmp105)
        tmp107 = tmp106 / tmp7
        tmp108 = tmp103 * tmp107
        tmp109 = tl.broadcast_to(tmp108, [XBLOCK, RBLOCK])
        tmp111 = _tmp110 + tmp109
        _tmp110 = tl.where(rmask & xmask, tmp111, _tmp110)
        tmp114 = tmp113 - tmp4
        tmp115 = tl_math.exp(tmp114)
        tmp116 = tmp115 / tmp7
        tmp117 = tmp112 * tmp116
        tmp118 = tl.broadcast_to(tmp117, [XBLOCK, RBLOCK])
        tmp120 = _tmp119 + tmp118
        _tmp119 = tl.where(rmask & xmask, tmp120, _tmp119)
        tmp123 = tmp122 - tmp4
        tmp124 = tl_math.exp(tmp123)
        tmp125 = tmp124 / tmp7
        tmp126 = tmp121 * tmp125
        tmp127 = tl.broadcast_to(tmp126, [XBLOCK, RBLOCK])
        tmp129 = _tmp128 + tmp127
        _tmp128 = tl.where(rmask & xmask, tmp129, _tmp128)
        tmp132 = tmp131 - tmp4
        tmp133 = tl_math.exp(tmp132)
        tmp134 = tmp133 / tmp7
        tmp135 = tmp130 * tmp134
        tmp136 = tl.broadcast_to(tmp135, [XBLOCK, RBLOCK])
        tmp138 = _tmp137 + tmp136
        _tmp137 = tl.where(rmask & xmask, tmp138, _tmp137)
        tmp141 = tmp140 - tmp4
        tmp142 = tl_math.exp(tmp141)
        tmp143 = tmp142 / tmp7
        tmp144 = tmp139 * tmp143
        tmp145 = tl.broadcast_to(tmp144, [XBLOCK, RBLOCK])
        tmp147 = _tmp146 + tmp145
        _tmp146 = tl.where(rmask & xmask, tmp147, _tmp146)
        tmp150 = tmp149 - tmp4
        tmp151 = tl_math.exp(tmp150)
        tmp152 = tmp151 / tmp7
        tmp153 = tmp148 * tmp152
        tmp154 = tl.broadcast_to(tmp153, [XBLOCK, RBLOCK])
        tmp156 = _tmp155 + tmp154
        _tmp155 = tl.where(rmask & xmask, tmp156, _tmp155)
        tmp159 = tmp158 - tmp4
        tmp160 = tl_math.exp(tmp159)
        tmp161 = tmp160 / tmp7
        tmp162 = tmp157 * tmp161
        tmp163 = tl.broadcast_to(tmp162, [XBLOCK, RBLOCK])
        tmp165 = _tmp164 + tmp163
        _tmp164 = tl.where(rmask & xmask, tmp165, _tmp164)
        tmp168 = tmp167 - tmp4
        tmp169 = tl_math.exp(tmp168)
        tmp170 = tmp169 / tmp7
        tmp171 = tmp166 * tmp170
        tmp172 = tl.broadcast_to(tmp171, [XBLOCK, RBLOCK])
        tmp174 = _tmp173 + tmp172
        _tmp173 = tl.where(rmask & xmask, tmp174, _tmp173)
        tmp177 = tmp176 - tmp4
        tmp178 = tl_math.exp(tmp177)
        tmp179 = tmp178 / tmp7
        tmp180 = tmp175 * tmp179
        tmp181 = tl.broadcast_to(tmp180, [XBLOCK, RBLOCK])
        tmp183 = _tmp182 + tmp181
        _tmp182 = tl.where(rmask & xmask, tmp183, _tmp182)
        tmp186 = tmp185 - tmp4
        tmp187 = tl_math.exp(tmp186)
        tmp188 = tmp187 / tmp7
        tmp189 = tmp184 * tmp188
        tmp190 = tl.broadcast_to(tmp189, [XBLOCK, RBLOCK])
        tmp192 = _tmp191 + tmp190
        _tmp191 = tl.where(rmask & xmask, tmp192, _tmp191)
        tmp195 = tmp194 - tmp4
        tmp196 = tl_math.exp(tmp195)
        tmp197 = tmp196 / tmp7
        tmp198 = tmp193 * tmp197
        tmp199 = tl.broadcast_to(tmp198, [XBLOCK, RBLOCK])
        tmp201 = _tmp200 + tmp199
        _tmp200 = tl.where(rmask & xmask, tmp201, _tmp200)
        tmp204 = tmp203 - tmp4
        tmp205 = tl_math.exp(tmp204)
        tmp206 = tmp205 / tmp7
        tmp207 = tmp202 * tmp206
        tmp208 = tl.broadcast_to(tmp207, [XBLOCK, RBLOCK])
        tmp210 = _tmp209 + tmp208
        _tmp209 = tl.where(rmask & xmask, tmp210, _tmp209)
        tmp213 = tmp212 - tmp4
        tmp214 = tl_math.exp(tmp213)
        tmp215 = tmp214 / tmp7
        tmp216 = tmp211 * tmp215
        tmp217 = tl.broadcast_to(tmp216, [XBLOCK, RBLOCK])
        tmp219 = _tmp218 + tmp217
        _tmp218 = tl.where(rmask & xmask, tmp219, _tmp218)
        tmp222 = tmp221 - tmp4
        tmp223 = tl_math.exp(tmp222)
        tmp224 = tmp223 / tmp7
        tmp225 = tmp220 * tmp224
        tmp226 = tl.broadcast_to(tmp225, [XBLOCK, RBLOCK])
        tmp228 = _tmp227 + tmp226
        _tmp227 = tl.where(rmask & xmask, tmp228, _tmp227)
        tmp231 = tmp230 - tmp4
        tmp232 = tl_math.exp(tmp231)
        tmp233 = tmp232 / tmp7
        tmp234 = tmp229 * tmp233
        tmp235 = tl.broadcast_to(tmp234, [XBLOCK, RBLOCK])
        tmp237 = _tmp236 + tmp235
        _tmp236 = tl.where(rmask & xmask, tmp237, _tmp236)
        tmp240 = tmp239 - tmp4
        tmp241 = tl_math.exp(tmp240)
        tmp242 = tmp241 / tmp7
        tmp243 = tmp238 * tmp242
        tmp244 = tl.broadcast_to(tmp243, [XBLOCK, RBLOCK])
        tmp246 = _tmp245 + tmp244
        _tmp245 = tl.where(rmask & xmask, tmp246, _tmp245)
        tmp249 = tmp248 - tmp4
        tmp250 = tl_math.exp(tmp249)
        tmp251 = tmp250 / tmp7
        tmp252 = tmp247 * tmp251
        tmp253 = tl.broadcast_to(tmp252, [XBLOCK, RBLOCK])
        tmp255 = _tmp254 + tmp253
        _tmp254 = tl.where(rmask & xmask, tmp255, _tmp254)
        tmp258 = tmp257 - tmp4
        tmp259 = tl_math.exp(tmp258)
        tmp260 = tmp259 / tmp7
        tmp261 = tmp256 * tmp260
        tmp262 = tl.broadcast_to(tmp261, [XBLOCK, RBLOCK])
        tmp264 = _tmp263 + tmp262
        _tmp263 = tl.where(rmask & xmask, tmp264, _tmp263)
    tmp11 = tl.sum(_tmp11, 1)[:, None]
    tl.store(out_ptr0 + (x3), tmp11, xmask)
    tmp20 = tl.sum(_tmp20, 1)[:, None]
    tl.store(out_ptr1 + (x3), tmp20, xmask)
    tmp29 = tl.sum(_tmp29, 1)[:, None]
    tl.store(out_ptr2 + (x3), tmp29, xmask)
    tmp38 = tl.sum(_tmp38, 1)[:, None]
    tl.store(out_ptr3 + (x3), tmp38, xmask)
    tmp47 = tl.sum(_tmp47, 1)[:, None]
    tl.store(out_ptr4 + (x3), tmp47, xmask)
    tmp56 = tl.sum(_tmp56, 1)[:, None]
    tl.store(out_ptr5 + (x3), tmp56, xmask)
    tmp65 = tl.sum(_tmp65, 1)[:, None]
    tl.store(out_ptr6 + (x3), tmp65, xmask)
    tmp74 = tl.sum(_tmp74, 1)[:, None]
    tl.store(out_ptr7 + (x3), tmp74, xmask)
    tmp83 = tl.sum(_tmp83, 1)[:, None]
    tl.store(out_ptr8 + (x3), tmp83, xmask)
    tmp92 = tl.sum(_tmp92, 1)[:, None]
    tl.store(out_ptr9 + (x3), tmp92, xmask)
    tmp101 = tl.sum(_tmp101, 1)[:, None]
    tl.store(out_ptr10 + (x3), tmp101, xmask)
    tmp110 = tl.sum(_tmp110, 1)[:, None]
    tl.store(out_ptr11 + (x3), tmp110, xmask)
    tmp119 = tl.sum(_tmp119, 1)[:, None]
    tl.store(out_ptr12 + (x3), tmp119, xmask)
    tmp128 = tl.sum(_tmp128, 1)[:, None]
    tl.store(out_ptr13 + (x3), tmp128, xmask)
    tmp137 = tl.sum(_tmp137, 1)[:, None]
    tl.store(out_ptr14 + (x3), tmp137, xmask)
    tmp146 = tl.sum(_tmp146, 1)[:, None]
    tl.store(out_ptr15 + (x3), tmp146, xmask)
    tmp155 = tl.sum(_tmp155, 1)[:, None]
    tl.store(out_ptr16 + (x3), tmp155, xmask)
    tmp164 = tl.sum(_tmp164, 1)[:, None]
    tl.store(out_ptr17 + (x3), tmp164, xmask)
    tmp173 = tl.sum(_tmp173, 1)[:, None]
    tl.store(out_ptr18 + (x3), tmp173, xmask)
    tmp182 = tl.sum(_tmp182, 1)[:, None]
    tl.store(out_ptr19 + (x3), tmp182, xmask)
    tmp191 = tl.sum(_tmp191, 1)[:, None]
    tl.store(out_ptr20 + (x3), tmp191, xmask)
    tmp200 = tl.sum(_tmp200, 1)[:, None]
    tl.store(out_ptr21 + (x3), tmp200, xmask)
    tmp209 = tl.sum(_tmp209, 1)[:, None]
    tl.store(out_ptr22 + (x3), tmp209, xmask)
    tmp218 = tl.sum(_tmp218, 1)[:, None]
    tl.store(out_ptr23 + (x3), tmp218, xmask)
    tmp227 = tl.sum(_tmp227, 1)[:, None]
    tl.store(out_ptr24 + (x3), tmp227, xmask)
    tmp236 = tl.sum(_tmp236, 1)[:, None]
    tl.store(out_ptr25 + (x3), tmp236, xmask)
    tmp245 = tl.sum(_tmp245, 1)[:, None]
    tl.store(out_ptr26 + (x3), tmp245, xmask)
    tmp254 = tl.sum(_tmp254, 1)[:, None]
    tl.store(out_ptr27 + (x3), tmp254, xmask)
    tmp263 = tl.sum(_tmp263, 1)[:, None]
    tl.store(out_ptr28 + (x3), tmp263, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_7/inductor_cache/7g/c7gpcb637ns46u6bq6sgchjaxn4thmkzjpeoxhjhn2ws6dc2fyq4.py
# Topologically Sorted Source Nodes: [residual_59, sum_30, residual_61, sum_31, residual_63, sum_32, residual_65, sum_33, residual_67, sum_34, residual_69, sum_35, residual_71, sum_36, residual_73, sum_37, residual_75, sum_38, residual_77, sum_39, residual_79, sum_40, residual_81, sum_41, residual_83, sum_42, residual_85, sum_43, residual_87, sum_44, residual_89, sum_45, residual_91, sum_46, residual_93, sum_47, residual_95, sum_48, residual_97, sum_49, residual_99, sum_50, residual_101, sum_51, residual_103, sum_52, residual_105, sum_53, residual_107, sum_54, residual_109, sum_55, residual_111, sum_56, residual_113, sum_57], Original ATen: [aten.mul, aten.sum]
# Source node to ATen node mapping:
#   residual_101 => mul_50
#   residual_103 => mul_51
#   residual_105 => mul_52
#   residual_107 => mul_53
#   residual_109 => mul_54
#   residual_111 => mul_55
#   residual_113 => mul_56
#   residual_59 => mul_29
#   residual_61 => mul_30
#   residual_63 => mul_31
#   residual_65 => mul_32
#   residual_67 => mul_33
#   residual_69 => mul_34
#   residual_71 => mul_35
#   residual_73 => mul_36
#   residual_75 => mul_37
#   residual_77 => mul_38
#   residual_79 => mul_39
#   residual_81 => mul_40
#   residual_83 => mul_41
#   residual_85 => mul_42
#   residual_87 => mul_43
#   residual_89 => mul_44
#   residual_91 => mul_45
#   residual_93 => mul_46
#   residual_95 => mul_47
#   residual_97 => mul_48
#   residual_99 => mul_49
#   sum_30 => sum_32
#   sum_31 => sum_33
#   sum_32 => sum_34
#   sum_33 => sum_35
#   sum_34 => sum_36
#   sum_35 => sum_37
#   sum_36 => sum_38
#   sum_37 => sum_39
#   sum_38 => sum_40
#   sum_39 => sum_41
#   sum_40 => sum_42
#   sum_41 => sum_43
#   sum_42 => sum_44
#   sum_43 => sum_45
#   sum_44 => sum_46
#   sum_45 => sum_47
#   sum_46 => sum_48
#   sum_47 => sum_49
#   sum_48 => sum_50
#   sum_49 => sum_51
#   sum_50 => sum_52
#   sum_51 => sum_53
#   sum_52 => sum_54
#   sum_53 => sum_55
#   sum_54 => sum_56
#   sum_55 => sum_57
#   sum_56 => sum_58
#   sum_57 => sum_59
# Graph fragment:
#   %mul_29 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_30, %unsqueeze_89), kwargs = {})
#   %sum_32 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_29, [-1]), kwargs = {})
#   %mul_30 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_31, %unsqueeze_92), kwargs = {})
#   %sum_33 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_30, [-1]), kwargs = {})
#   %mul_31 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_32, %unsqueeze_95), kwargs = {})
#   %sum_34 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_31, [-1]), kwargs = {})
#   %mul_32 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_33, %unsqueeze_98), kwargs = {})
#   %sum_35 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_32, [-1]), kwargs = {})
#   %mul_33 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_34, %unsqueeze_101), kwargs = {})
#   %sum_36 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_33, [-1]), kwargs = {})
#   %mul_34 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_35, %unsqueeze_104), kwargs = {})
#   %sum_37 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_34, [-1]), kwargs = {})
#   %mul_35 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_36, %unsqueeze_107), kwargs = {})
#   %sum_38 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_35, [-1]), kwargs = {})
#   %mul_36 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_37, %unsqueeze_110), kwargs = {})
#   %sum_39 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_36, [-1]), kwargs = {})
#   %mul_37 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_38, %unsqueeze_113), kwargs = {})
#   %sum_40 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_37, [-1]), kwargs = {})
#   %mul_38 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_39, %unsqueeze_116), kwargs = {})
#   %sum_41 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_38, [-1]), kwargs = {})
#   %mul_39 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_40, %unsqueeze_119), kwargs = {})
#   %sum_42 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_39, [-1]), kwargs = {})
#   %mul_40 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_41, %unsqueeze_122), kwargs = {})
#   %sum_43 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_40, [-1]), kwargs = {})
#   %mul_41 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_42, %unsqueeze_125), kwargs = {})
#   %sum_44 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_41, [-1]), kwargs = {})
#   %mul_42 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_43, %unsqueeze_128), kwargs = {})
#   %sum_45 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_42, [-1]), kwargs = {})
#   %mul_43 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_44, %unsqueeze_131), kwargs = {})
#   %sum_46 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_43, [-1]), kwargs = {})
#   %mul_44 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_45, %unsqueeze_134), kwargs = {})
#   %sum_47 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_44, [-1]), kwargs = {})
#   %mul_45 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_46, %unsqueeze_137), kwargs = {})
#   %sum_48 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_45, [-1]), kwargs = {})
#   %mul_46 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_47, %unsqueeze_140), kwargs = {})
#   %sum_49 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_46, [-1]), kwargs = {})
#   %mul_47 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_48, %unsqueeze_143), kwargs = {})
#   %sum_50 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_47, [-1]), kwargs = {})
#   %mul_48 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_49, %unsqueeze_146), kwargs = {})
#   %sum_51 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_48, [-1]), kwargs = {})
#   %mul_49 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_50, %unsqueeze_149), kwargs = {})
#   %sum_52 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_49, [-1]), kwargs = {})
#   %mul_50 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_51, %unsqueeze_152), kwargs = {})
#   %sum_53 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_50, [-1]), kwargs = {})
#   %mul_51 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_52, %unsqueeze_155), kwargs = {})
#   %sum_54 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_51, [-1]), kwargs = {})
#   %mul_52 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_53, %unsqueeze_158), kwargs = {})
#   %sum_55 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_52, [-1]), kwargs = {})
#   %mul_53 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_54, %unsqueeze_161), kwargs = {})
#   %sum_56 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_53, [-1]), kwargs = {})
#   %mul_54 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_55, %unsqueeze_164), kwargs = {})
#   %sum_57 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_54, [-1]), kwargs = {})
#   %mul_55 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_56, %unsqueeze_167), kwargs = {})
#   %sum_58 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_55, [-1]), kwargs = {})
#   %mul_56 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_57, %unsqueeze_170), kwargs = {})
#   %sum_59 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_56, [-1]), kwargs = {})
triton_red_fused_mul_sum_4 = async_compile.triton('triton_red_fused_mul_sum_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.reduction(
    size_hints=[512, 4096],
    reduction_hint=ReductionHint.INNER,
    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: 'i32', 60: '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), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_red_fused_mul_sum_4', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 58, '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_red_fused_mul_sum_4(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, 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, xnumel, rnumel, XBLOCK : tl.constexpr, RBLOCK : tl.constexpr):
    xnumel = 512
    rnumel = 4096
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    rbase = tl.arange(0, RBLOCK)[None, :]
    x3 = xindex
    x1 = (xindex // 128)
    _tmp9 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp18 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp27 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp36 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp45 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp54 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp63 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp72 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp81 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp90 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp99 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp108 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp117 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp126 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp135 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp144 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp153 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp162 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp171 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp180 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp189 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp198 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp207 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp216 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp225 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp234 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp243 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp252 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    for roffset in range(0, rnumel, RBLOCK):
        rindex = roffset + rbase
        rmask = rindex < rnumel
        r2 = rindex
        tmp0 = tl.load(in_ptr0 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp1 = tl.load(in_ptr1 + (118784 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp2 = tl.load(in_ptr2 + (r2 + (4096*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp5 = tl.load(in_ptr3 + (r2 + (4096*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp11 = tl.load(in_ptr4 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp12 = tl.load(in_ptr1 + (122880 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp20 = tl.load(in_ptr5 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp21 = tl.load(in_ptr1 + (126976 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp29 = tl.load(in_ptr6 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp30 = tl.load(in_ptr1 + (131072 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp38 = tl.load(in_ptr7 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp39 = tl.load(in_ptr1 + (135168 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp47 = tl.load(in_ptr8 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp48 = tl.load(in_ptr1 + (139264 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp56 = tl.load(in_ptr9 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp57 = tl.load(in_ptr1 + (143360 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp65 = tl.load(in_ptr10 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp66 = tl.load(in_ptr1 + (147456 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp74 = tl.load(in_ptr11 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp75 = tl.load(in_ptr1 + (151552 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp83 = tl.load(in_ptr12 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp84 = tl.load(in_ptr1 + (155648 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp92 = tl.load(in_ptr13 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp93 = tl.load(in_ptr1 + (159744 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp101 = tl.load(in_ptr14 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp102 = tl.load(in_ptr1 + (163840 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp110 = tl.load(in_ptr15 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp111 = tl.load(in_ptr1 + (167936 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp119 = tl.load(in_ptr16 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp120 = tl.load(in_ptr1 + (172032 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp128 = tl.load(in_ptr17 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp129 = tl.load(in_ptr1 + (176128 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp137 = tl.load(in_ptr18 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp138 = tl.load(in_ptr1 + (180224 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp146 = tl.load(in_ptr19 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp147 = tl.load(in_ptr1 + (184320 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp155 = tl.load(in_ptr20 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp156 = tl.load(in_ptr1 + (188416 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp164 = tl.load(in_ptr21 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp165 = tl.load(in_ptr1 + (192512 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp173 = tl.load(in_ptr22 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp174 = tl.load(in_ptr1 + (196608 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp182 = tl.load(in_ptr23 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp183 = tl.load(in_ptr1 + (200704 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp191 = tl.load(in_ptr24 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp192 = tl.load(in_ptr1 + (204800 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp200 = tl.load(in_ptr25 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp201 = tl.load(in_ptr1 + (208896 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp209 = tl.load(in_ptr26 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp210 = tl.load(in_ptr1 + (212992 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp218 = tl.load(in_ptr27 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp219 = tl.load(in_ptr1 + (217088 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp227 = tl.load(in_ptr28 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp228 = tl.load(in_ptr1 + (221184 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp236 = tl.load(in_ptr29 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp237 = tl.load(in_ptr1 + (225280 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp245 = tl.load(in_ptr30 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp246 = tl.load(in_ptr1 + (229376 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp3 = tmp1 - tmp2
        tmp4 = tl_math.exp(tmp3)
        tmp6 = tmp4 / tmp5
        tmp7 = tmp0 * tmp6
        tmp8 = tl.broadcast_to(tmp7, [XBLOCK, RBLOCK])
        tmp10 = _tmp9 + tmp8
        _tmp9 = tl.where(rmask & xmask, tmp10, _tmp9)
        tmp13 = tmp12 - tmp2
        tmp14 = tl_math.exp(tmp13)
        tmp15 = tmp14 / tmp5
        tmp16 = tmp11 * tmp15
        tmp17 = tl.broadcast_to(tmp16, [XBLOCK, RBLOCK])
        tmp19 = _tmp18 + tmp17
        _tmp18 = tl.where(rmask & xmask, tmp19, _tmp18)
        tmp22 = tmp21 - tmp2
        tmp23 = tl_math.exp(tmp22)
        tmp24 = tmp23 / tmp5
        tmp25 = tmp20 * tmp24
        tmp26 = tl.broadcast_to(tmp25, [XBLOCK, RBLOCK])
        tmp28 = _tmp27 + tmp26
        _tmp27 = tl.where(rmask & xmask, tmp28, _tmp27)
        tmp31 = tmp30 - tmp2
        tmp32 = tl_math.exp(tmp31)
        tmp33 = tmp32 / tmp5
        tmp34 = tmp29 * tmp33
        tmp35 = tl.broadcast_to(tmp34, [XBLOCK, RBLOCK])
        tmp37 = _tmp36 + tmp35
        _tmp36 = tl.where(rmask & xmask, tmp37, _tmp36)
        tmp40 = tmp39 - tmp2
        tmp41 = tl_math.exp(tmp40)
        tmp42 = tmp41 / tmp5
        tmp43 = tmp38 * tmp42
        tmp44 = tl.broadcast_to(tmp43, [XBLOCK, RBLOCK])
        tmp46 = _tmp45 + tmp44
        _tmp45 = tl.where(rmask & xmask, tmp46, _tmp45)
        tmp49 = tmp48 - tmp2
        tmp50 = tl_math.exp(tmp49)
        tmp51 = tmp50 / tmp5
        tmp52 = tmp47 * tmp51
        tmp53 = tl.broadcast_to(tmp52, [XBLOCK, RBLOCK])
        tmp55 = _tmp54 + tmp53
        _tmp54 = tl.where(rmask & xmask, tmp55, _tmp54)
        tmp58 = tmp57 - tmp2
        tmp59 = tl_math.exp(tmp58)
        tmp60 = tmp59 / tmp5
        tmp61 = tmp56 * tmp60
        tmp62 = tl.broadcast_to(tmp61, [XBLOCK, RBLOCK])
        tmp64 = _tmp63 + tmp62
        _tmp63 = tl.where(rmask & xmask, tmp64, _tmp63)
        tmp67 = tmp66 - tmp2
        tmp68 = tl_math.exp(tmp67)
        tmp69 = tmp68 / tmp5
        tmp70 = tmp65 * tmp69
        tmp71 = tl.broadcast_to(tmp70, [XBLOCK, RBLOCK])
        tmp73 = _tmp72 + tmp71
        _tmp72 = tl.where(rmask & xmask, tmp73, _tmp72)
        tmp76 = tmp75 - tmp2
        tmp77 = tl_math.exp(tmp76)
        tmp78 = tmp77 / tmp5
        tmp79 = tmp74 * tmp78
        tmp80 = tl.broadcast_to(tmp79, [XBLOCK, RBLOCK])
        tmp82 = _tmp81 + tmp80
        _tmp81 = tl.where(rmask & xmask, tmp82, _tmp81)
        tmp85 = tmp84 - tmp2
        tmp86 = tl_math.exp(tmp85)
        tmp87 = tmp86 / tmp5
        tmp88 = tmp83 * tmp87
        tmp89 = tl.broadcast_to(tmp88, [XBLOCK, RBLOCK])
        tmp91 = _tmp90 + tmp89
        _tmp90 = tl.where(rmask & xmask, tmp91, _tmp90)
        tmp94 = tmp93 - tmp2
        tmp95 = tl_math.exp(tmp94)
        tmp96 = tmp95 / tmp5
        tmp97 = tmp92 * tmp96
        tmp98 = tl.broadcast_to(tmp97, [XBLOCK, RBLOCK])
        tmp100 = _tmp99 + tmp98
        _tmp99 = tl.where(rmask & xmask, tmp100, _tmp99)
        tmp103 = tmp102 - tmp2
        tmp104 = tl_math.exp(tmp103)
        tmp105 = tmp104 / tmp5
        tmp106 = tmp101 * tmp105
        tmp107 = tl.broadcast_to(tmp106, [XBLOCK, RBLOCK])
        tmp109 = _tmp108 + tmp107
        _tmp108 = tl.where(rmask & xmask, tmp109, _tmp108)
        tmp112 = tmp111 - tmp2
        tmp113 = tl_math.exp(tmp112)
        tmp114 = tmp113 / tmp5
        tmp115 = tmp110 * tmp114
        tmp116 = tl.broadcast_to(tmp115, [XBLOCK, RBLOCK])
        tmp118 = _tmp117 + tmp116
        _tmp117 = tl.where(rmask & xmask, tmp118, _tmp117)
        tmp121 = tmp120 - tmp2
        tmp122 = tl_math.exp(tmp121)
        tmp123 = tmp122 / tmp5
        tmp124 = tmp119 * tmp123
        tmp125 = tl.broadcast_to(tmp124, [XBLOCK, RBLOCK])
        tmp127 = _tmp126 + tmp125
        _tmp126 = tl.where(rmask & xmask, tmp127, _tmp126)
        tmp130 = tmp129 - tmp2
        tmp131 = tl_math.exp(tmp130)
        tmp132 = tmp131 / tmp5
        tmp133 = tmp128 * tmp132
        tmp134 = tl.broadcast_to(tmp133, [XBLOCK, RBLOCK])
        tmp136 = _tmp135 + tmp134
        _tmp135 = tl.where(rmask & xmask, tmp136, _tmp135)
        tmp139 = tmp138 - tmp2
        tmp140 = tl_math.exp(tmp139)
        tmp141 = tmp140 / tmp5
        tmp142 = tmp137 * tmp141
        tmp143 = tl.broadcast_to(tmp142, [XBLOCK, RBLOCK])
        tmp145 = _tmp144 + tmp143
        _tmp144 = tl.where(rmask & xmask, tmp145, _tmp144)
        tmp148 = tmp147 - tmp2
        tmp149 = tl_math.exp(tmp148)
        tmp150 = tmp149 / tmp5
        tmp151 = tmp146 * tmp150
        tmp152 = tl.broadcast_to(tmp151, [XBLOCK, RBLOCK])
        tmp154 = _tmp153 + tmp152
        _tmp153 = tl.where(rmask & xmask, tmp154, _tmp153)
        tmp157 = tmp156 - tmp2
        tmp158 = tl_math.exp(tmp157)
        tmp159 = tmp158 / tmp5
        tmp160 = tmp155 * tmp159
        tmp161 = tl.broadcast_to(tmp160, [XBLOCK, RBLOCK])
        tmp163 = _tmp162 + tmp161
        _tmp162 = tl.where(rmask & xmask, tmp163, _tmp162)
        tmp166 = tmp165 - tmp2
        tmp167 = tl_math.exp(tmp166)
        tmp168 = tmp167 / tmp5
        tmp169 = tmp164 * tmp168
        tmp170 = tl.broadcast_to(tmp169, [XBLOCK, RBLOCK])
        tmp172 = _tmp171 + tmp170
        _tmp171 = tl.where(rmask & xmask, tmp172, _tmp171)
        tmp175 = tmp174 - tmp2
        tmp176 = tl_math.exp(tmp175)
        tmp177 = tmp176 / tmp5
        tmp178 = tmp173 * tmp177
        tmp179 = tl.broadcast_to(tmp178, [XBLOCK, RBLOCK])
        tmp181 = _tmp180 + tmp179
        _tmp180 = tl.where(rmask & xmask, tmp181, _tmp180)
        tmp184 = tmp183 - tmp2
        tmp185 = tl_math.exp(tmp184)
        tmp186 = tmp185 / tmp5
        tmp187 = tmp182 * tmp186
        tmp188 = tl.broadcast_to(tmp187, [XBLOCK, RBLOCK])
        tmp190 = _tmp189 + tmp188
        _tmp189 = tl.where(rmask & xmask, tmp190, _tmp189)
        tmp193 = tmp192 - tmp2
        tmp194 = tl_math.exp(tmp193)
        tmp195 = tmp194 / tmp5
        tmp196 = tmp191 * tmp195
        tmp197 = tl.broadcast_to(tmp196, [XBLOCK, RBLOCK])
        tmp199 = _tmp198 + tmp197
        _tmp198 = tl.where(rmask & xmask, tmp199, _tmp198)
        tmp202 = tmp201 - tmp2
        tmp203 = tl_math.exp(tmp202)
        tmp204 = tmp203 / tmp5
        tmp205 = tmp200 * tmp204
        tmp206 = tl.broadcast_to(tmp205, [XBLOCK, RBLOCK])
        tmp208 = _tmp207 + tmp206
        _tmp207 = tl.where(rmask & xmask, tmp208, _tmp207)
        tmp211 = tmp210 - tmp2
        tmp212 = tl_math.exp(tmp211)
        tmp213 = tmp212 / tmp5
        tmp214 = tmp209 * tmp213
        tmp215 = tl.broadcast_to(tmp214, [XBLOCK, RBLOCK])
        tmp217 = _tmp216 + tmp215
        _tmp216 = tl.where(rmask & xmask, tmp217, _tmp216)
        tmp220 = tmp219 - tmp2
        tmp221 = tl_math.exp(tmp220)
        tmp222 = tmp221 / tmp5
        tmp223 = tmp218 * tmp222
        tmp224 = tl.broadcast_to(tmp223, [XBLOCK, RBLOCK])
        tmp226 = _tmp225 + tmp224
        _tmp225 = tl.where(rmask & xmask, tmp226, _tmp225)
        tmp229 = tmp228 - tmp2
        tmp230 = tl_math.exp(tmp229)
        tmp231 = tmp230 / tmp5
        tmp232 = tmp227 * tmp231
        tmp233 = tl.broadcast_to(tmp232, [XBLOCK, RBLOCK])
        tmp235 = _tmp234 + tmp233
        _tmp234 = tl.where(rmask & xmask, tmp235, _tmp234)
        tmp238 = tmp237 - tmp2
        tmp239 = tl_math.exp(tmp238)
        tmp240 = tmp239 / tmp5
        tmp241 = tmp236 * tmp240
        tmp242 = tl.broadcast_to(tmp241, [XBLOCK, RBLOCK])
        tmp244 = _tmp243 + tmp242
        _tmp243 = tl.where(rmask & xmask, tmp244, _tmp243)
        tmp247 = tmp246 - tmp2
        tmp248 = tl_math.exp(tmp247)
        tmp249 = tmp248 / tmp5
        tmp250 = tmp245 * tmp249
        tmp251 = tl.broadcast_to(tmp250, [XBLOCK, RBLOCK])
        tmp253 = _tmp252 + tmp251
        _tmp252 = tl.where(rmask & xmask, tmp253, _tmp252)
    tmp9 = tl.sum(_tmp9, 1)[:, None]
    tl.store(out_ptr0 + (x3), tmp9, xmask)
    tmp18 = tl.sum(_tmp18, 1)[:, None]
    tl.store(out_ptr1 + (x3), tmp18, xmask)
    tmp27 = tl.sum(_tmp27, 1)[:, None]
    tl.store(out_ptr2 + (x3), tmp27, xmask)
    tmp36 = tl.sum(_tmp36, 1)[:, None]
    tl.store(out_ptr3 + (x3), tmp36, xmask)
    tmp45 = tl.sum(_tmp45, 1)[:, None]
    tl.store(out_ptr4 + (x3), tmp45, xmask)
    tmp54 = tl.sum(_tmp54, 1)[:, None]
    tl.store(out_ptr5 + (x3), tmp54, xmask)
    tmp63 = tl.sum(_tmp63, 1)[:, None]
    tl.store(out_ptr6 + (x3), tmp63, xmask)
    tmp72 = tl.sum(_tmp72, 1)[:, None]
    tl.store(out_ptr7 + (x3), tmp72, xmask)
    tmp81 = tl.sum(_tmp81, 1)[:, None]
    tl.store(out_ptr8 + (x3), tmp81, xmask)
    tmp90 = tl.sum(_tmp90, 1)[:, None]
    tl.store(out_ptr9 + (x3), tmp90, xmask)
    tmp99 = tl.sum(_tmp99, 1)[:, None]
    tl.store(out_ptr10 + (x3), tmp99, xmask)
    tmp108 = tl.sum(_tmp108, 1)[:, None]
    tl.store(out_ptr11 + (x3), tmp108, xmask)
    tmp117 = tl.sum(_tmp117, 1)[:, None]
    tl.store(out_ptr12 + (x3), tmp117, xmask)
    tmp126 = tl.sum(_tmp126, 1)[:, None]
    tl.store(out_ptr13 + (x3), tmp126, xmask)
    tmp135 = tl.sum(_tmp135, 1)[:, None]
    tl.store(out_ptr14 + (x3), tmp135, xmask)
    tmp144 = tl.sum(_tmp144, 1)[:, None]
    tl.store(out_ptr15 + (x3), tmp144, xmask)
    tmp153 = tl.sum(_tmp153, 1)[:, None]
    tl.store(out_ptr16 + (x3), tmp153, xmask)
    tmp162 = tl.sum(_tmp162, 1)[:, None]
    tl.store(out_ptr17 + (x3), tmp162, xmask)
    tmp171 = tl.sum(_tmp171, 1)[:, None]
    tl.store(out_ptr18 + (x3), tmp171, xmask)
    tmp180 = tl.sum(_tmp180, 1)[:, None]
    tl.store(out_ptr19 + (x3), tmp180, xmask)
    tmp189 = tl.sum(_tmp189, 1)[:, None]
    tl.store(out_ptr20 + (x3), tmp189, xmask)
    tmp198 = tl.sum(_tmp198, 1)[:, None]
    tl.store(out_ptr21 + (x3), tmp198, xmask)
    tmp207 = tl.sum(_tmp207, 1)[:, None]
    tl.store(out_ptr22 + (x3), tmp207, xmask)
    tmp216 = tl.sum(_tmp216, 1)[:, None]
    tl.store(out_ptr23 + (x3), tmp216, xmask)
    tmp225 = tl.sum(_tmp225, 1)[:, None]
    tl.store(out_ptr24 + (x3), tmp225, xmask)
    tmp234 = tl.sum(_tmp234, 1)[:, None]
    tl.store(out_ptr25 + (x3), tmp234, xmask)
    tmp243 = tl.sum(_tmp243, 1)[:, None]
    tl.store(out_ptr26 + (x3), tmp243, xmask)
    tmp252 = tl.sum(_tmp252, 1)[:, None]
    tl.store(out_ptr27 + (x3), tmp252, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_7/inductor_cache/m5/cm5hatbwewijgqsezz7mpghb6gtaqevomtlc673msign42fqnq42.py
# Topologically Sorted Source Nodes: [residual_115, sum_58, residual_117, sum_59, residual_119, sum_60, residual_121, sum_61, residual_123, sum_62, residual_125, sum_63, residual_127, sum_64], Original ATen: [aten.mul, aten.sum]
# Source node to ATen node mapping:
#   residual_115 => mul_57
#   residual_117 => mul_58
#   residual_119 => mul_59
#   residual_121 => mul_60
#   residual_123 => mul_61
#   residual_125 => mul_62
#   residual_127 => mul_63
#   sum_58 => sum_60
#   sum_59 => sum_61
#   sum_60 => sum_62
#   sum_61 => sum_63
#   sum_62 => sum_64
#   sum_63 => sum_65
#   sum_64 => sum_66
# Graph fragment:
#   %mul_57 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_58, %unsqueeze_173), kwargs = {})
#   %sum_60 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_57, [-1]), kwargs = {})
#   %mul_58 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_59, %unsqueeze_176), kwargs = {})
#   %sum_61 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_58, [-1]), kwargs = {})
#   %mul_59 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_60, %unsqueeze_179), kwargs = {})
#   %sum_62 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_59, [-1]), kwargs = {})
#   %mul_60 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_61, %unsqueeze_182), kwargs = {})
#   %sum_63 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_60, [-1]), kwargs = {})
#   %mul_61 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_62, %unsqueeze_185), kwargs = {})
#   %sum_64 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_61, [-1]), kwargs = {})
#   %mul_62 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_63, %unsqueeze_188), kwargs = {})
#   %sum_65 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_62, [-1]), kwargs = {})
#   %mul_63 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_64, %unsqueeze_191), kwargs = {})
#   %sum_66 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_63, [-1]), kwargs = {})
triton_red_fused_mul_sum_5 = async_compile.triton('triton_red_fused_mul_sum_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=[512, 4096],
    reduction_hint=ReductionHint.INNER,
    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: 'i32', 18: '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), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_red_fused_mul_sum_5', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 16, '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_red_fused_mul_sum_5(in_ptr0, in_ptr1, in_ptr2, in_ptr3, in_ptr4, in_ptr5, in_ptr6, in_ptr7, in_ptr8, in_ptr9, out_ptr0, out_ptr1, out_ptr2, out_ptr3, out_ptr4, out_ptr5, out_ptr6, xnumel, rnumel, XBLOCK : tl.constexpr, RBLOCK : tl.constexpr):
    xnumel = 512
    rnumel = 4096
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    rbase = tl.arange(0, RBLOCK)[None, :]
    x3 = xindex
    x1 = (xindex // 128)
    _tmp9 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp18 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp27 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp36 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp45 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp54 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp63 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    for roffset in range(0, rnumel, RBLOCK):
        rindex = roffset + rbase
        rmask = rindex < rnumel
        r2 = rindex
        tmp0 = tl.load(in_ptr0 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp1 = tl.load(in_ptr1 + (233472 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp2 = tl.load(in_ptr2 + (r2 + (4096*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp5 = tl.load(in_ptr3 + (r2 + (4096*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp11 = tl.load(in_ptr4 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp12 = tl.load(in_ptr1 + (237568 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp20 = tl.load(in_ptr5 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp21 = tl.load(in_ptr1 + (241664 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp29 = tl.load(in_ptr6 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp30 = tl.load(in_ptr1 + (245760 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp38 = tl.load(in_ptr7 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp39 = tl.load(in_ptr1 + (249856 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp47 = tl.load(in_ptr8 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp48 = tl.load(in_ptr1 + (253952 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp56 = tl.load(in_ptr9 + (r2 + (4096*x3)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp57 = tl.load(in_ptr1 + (258048 + r2 + (262144*x1)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp3 = tmp1 - tmp2
        tmp4 = tl_math.exp(tmp3)
        tmp6 = tmp4 / tmp5
        tmp7 = tmp0 * tmp6
        tmp8 = tl.broadcast_to(tmp7, [XBLOCK, RBLOCK])
        tmp10 = _tmp9 + tmp8
        _tmp9 = tl.where(rmask & xmask, tmp10, _tmp9)
        tmp13 = tmp12 - tmp2
        tmp14 = tl_math.exp(tmp13)
        tmp15 = tmp14 / tmp5
        tmp16 = tmp11 * tmp15
        tmp17 = tl.broadcast_to(tmp16, [XBLOCK, RBLOCK])
        tmp19 = _tmp18 + tmp17
        _tmp18 = tl.where(rmask & xmask, tmp19, _tmp18)
        tmp22 = tmp21 - tmp2
        tmp23 = tl_math.exp(tmp22)
        tmp24 = tmp23 / tmp5
        tmp25 = tmp20 * tmp24
        tmp26 = tl.broadcast_to(tmp25, [XBLOCK, RBLOCK])
        tmp28 = _tmp27 + tmp26
        _tmp27 = tl.where(rmask & xmask, tmp28, _tmp27)
        tmp31 = tmp30 - tmp2
        tmp32 = tl_math.exp(tmp31)
        tmp33 = tmp32 / tmp5
        tmp34 = tmp29 * tmp33
        tmp35 = tl.broadcast_to(tmp34, [XBLOCK, RBLOCK])
        tmp37 = _tmp36 + tmp35
        _tmp36 = tl.where(rmask & xmask, tmp37, _tmp36)
        tmp40 = tmp39 - tmp2
        tmp41 = tl_math.exp(tmp40)
        tmp42 = tmp41 / tmp5
        tmp43 = tmp38 * tmp42
        tmp44 = tl.broadcast_to(tmp43, [XBLOCK, RBLOCK])
        tmp46 = _tmp45 + tmp44
        _tmp45 = tl.where(rmask & xmask, tmp46, _tmp45)
        tmp49 = tmp48 - tmp2
        tmp50 = tl_math.exp(tmp49)
        tmp51 = tmp50 / tmp5
        tmp52 = tmp47 * tmp51
        tmp53 = tl.broadcast_to(tmp52, [XBLOCK, RBLOCK])
        tmp55 = _tmp54 + tmp53
        _tmp54 = tl.where(rmask & xmask, tmp55, _tmp54)
        tmp58 = tmp57 - tmp2
        tmp59 = tl_math.exp(tmp58)
        tmp60 = tmp59 / tmp5
        tmp61 = tmp56 * tmp60
        tmp62 = tl.broadcast_to(tmp61, [XBLOCK, RBLOCK])
        tmp64 = _tmp63 + tmp62
        _tmp63 = tl.where(rmask & xmask, tmp64, _tmp63)
    tmp9 = tl.sum(_tmp9, 1)[:, None]
    tl.store(out_ptr0 + (x3), tmp9, xmask)
    tmp18 = tl.sum(_tmp18, 1)[:, None]
    tl.store(out_ptr1 + (x3), tmp18, xmask)
    tmp27 = tl.sum(_tmp27, 1)[:, None]
    tl.store(out_ptr2 + (x3), tmp27, xmask)
    tmp36 = tl.sum(_tmp36, 1)[:, None]
    tl.store(out_ptr3 + (x3), tmp36, xmask)
    tmp45 = tl.sum(_tmp45, 1)[:, None]
    tl.store(out_ptr4 + (x3), tmp45, xmask)
    tmp54 = tl.sum(_tmp54, 1)[:, None]
    tl.store(out_ptr5 + (x3), tmp54, xmask)
    tmp63 = tl.sum(_tmp63, 1)[:, None]
    tl.store(out_ptr6 + (x3), tmp63, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_7/inductor_cache/ew/cewrqjskzvue6r2kcna4men3gingd3ajhrksiyyptwu2fliqalf7.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, vlad_1], Original ATen: [aten.zeros, aten.copy, aten.linalg_vector_norm]
# 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
#   vlad_1 => pow_3, pow_4, sum_67
# Graph fragment:
#   %full : [num_users=2] = call_function[target=torch.ops.aten.full.default](args = ([4, 64, 128], 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_3), 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_4), 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_5), 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_6), 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_7), 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_8), 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_9), 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_10), 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_11), 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_12), 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_13), 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_14), 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_15), 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_16), 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_17), 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_18), 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_19), 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_20), 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_21), 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_22), 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_23), 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_24), 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_25), 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_26), 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_27), 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_28), 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_29), 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_30), 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_31), 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_32), 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_33), 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_34), 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_35), 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_36), 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_37), 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_38), 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_39), 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_40), 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_41), 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_42), 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_43), 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_44), 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_45), 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_46), 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_47), 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_48), 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_49), 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_50), 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_51), 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_52), 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_53), 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_54), 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_55), 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_56), 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_57), 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_58), 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_59), 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_60), 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_61), 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_62), 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_63), 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_64), 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_65), 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_66), 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 = {})
#   %pow_3 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Scalar](args = (%slice_scatter_default_63, 2), kwargs = {})
#   %sum_67 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_3, [2], True), kwargs = {})
#   %pow_4 : [num_users=2] = call_function[target=torch.ops.aten.pow.Tensor_Scalar](args = (%sum_67, 0.5), kwargs = {})
triton_per_fused_copy_linalg_vector_norm_zeros_6 = async_compile.triton('triton_per_fused_copy_linalg_vector_norm_zeros_6', '''
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=[256, 128],
    reduction_hint=ReductionHint.INNER,
    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: '*fp32', 66: 'i32', 67: '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, 66, 67), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_per_fused_copy_linalg_vector_norm_zeros_6', 'mutated_arg_names': ['in_out_ptr0', 'in_out_ptr1'], 'no_x_dim': False, 'num_load': 64, '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_per_fused_copy_linalg_vector_norm_zeros_6(in_out_ptr0, in_out_ptr1, 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, rnumel, XBLOCK : tl.constexpr):
    xnumel = 256
    rnumel = 128
    RBLOCK: tl.constexpr = 128
    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)
    x0 = xindex % 64
    r2 = rindex
    x1 = (xindex // 64)
    x3 = xindex
    tmp0 = x0
    tmp1 = tl.full([1, 1], 4, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = tl.full([1, 1], 5, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp5 = tmp2 & tmp4
    tmp6 = tl.load(in_ptr0 + (r2 + (128*x1)), tmp5 & xmask, eviction_policy='evict_last', other=0.0)
    tmp7 = tl.full([1, 1], 3, tl.int64)
    tmp8 = tmp0 >= tmp7
    tmp9 = tmp0 < tmp1
    tmp10 = tmp8 & tmp9
    tmp11 = tl.load(in_ptr1 + (r2 + (128*x1)), tmp10 & xmask, eviction_policy='evict_last', other=0.0)
    tmp12 = tl.full([1, 1], 2, tl.int64)
    tmp13 = tmp0 >= tmp12
    tmp14 = tmp0 < tmp7
    tmp15 = tmp13 & tmp14
    tmp16 = tl.load(in_ptr2 + (r2 + (128*x1)), tmp15 & xmask, eviction_policy='evict_last', other=0.0)
    tmp17 = tl.full([1, 1], 1, tl.int64)
    tmp18 = tmp0 >= tmp17
    tmp19 = tmp0 < tmp12
    tmp20 = tmp18 & tmp19
    tmp21 = tl.load(in_ptr3 + (r2 + (128*x1)), tmp20 & xmask, eviction_policy='evict_last', other=0.0)
    tmp22 = tmp0 < tmp17
    tmp23 = tl.load(in_ptr4 + (r2 + (128*x1)), 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, 1], 8, tl.int64)
    tmp31 = tmp0 >= tmp30
    tmp32 = tl.full([1, 1], 9, tl.int64)
    tmp33 = tmp0 < tmp32
    tmp34 = tmp31 & tmp33
    tmp35 = tl.load(in_ptr5 + (r2 + (128*x1)), tmp34 & xmask, eviction_policy='evict_last', other=0.0)
    tmp36 = tl.full([1, 1], 7, tl.int64)
    tmp37 = tmp0 >= tmp36
    tmp38 = tmp0 < tmp30
    tmp39 = tmp37 & tmp38
    tmp40 = tl.load(in_ptr6 + (r2 + (128*x1)), tmp39 & xmask, eviction_policy='evict_last', other=0.0)
    tmp41 = tl.full([1, 1], 6, tl.int64)
    tmp42 = tmp0 >= tmp41
    tmp43 = tmp0 < tmp36
    tmp44 = tmp42 & tmp43
    tmp45 = tl.load(in_ptr7 + (r2 + (128*x1)), tmp44 & xmask, eviction_policy='evict_last', other=0.0)
    tmp46 = tmp0 >= tmp3
    tmp47 = tmp0 < tmp41
    tmp48 = tmp46 & tmp47
    tmp49 = tl.load(in_ptr8 + (r2 + (128*x1)), 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, 1], 12, tl.int64)
    tmp55 = tmp0 >= tmp54
    tmp56 = tl.full([1, 1], 13, tl.int64)
    tmp57 = tmp0 < tmp56
    tmp58 = tmp55 & tmp57
    tmp59 = tl.load(in_ptr9 + (r2 + (128*x1)), tmp58 & xmask, eviction_policy='evict_last', other=0.0)
    tmp60 = tl.full([1, 1], 11, tl.int64)
    tmp61 = tmp0 >= tmp60
    tmp62 = tmp0 < tmp54
    tmp63 = tmp61 & tmp62
    tmp64 = tl.load(in_ptr10 + (r2 + (128*x1)), tmp63 & xmask, eviction_policy='evict_last', other=0.0)
    tmp65 = tl.full([1, 1], 10, tl.int64)
    tmp66 = tmp0 >= tmp65
    tmp67 = tmp0 < tmp60
    tmp68 = tmp66 & tmp67
    tmp69 = tl.load(in_ptr11 + (r2 + (128*x1)), tmp68 & xmask, eviction_policy='evict_last', other=0.0)
    tmp70 = tmp0 >= tmp32
    tmp71 = tmp0 < tmp65
    tmp72 = tmp70 & tmp71
    tmp73 = tl.load(in_ptr12 + (r2 + (128*x1)), 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, 1], 16, tl.int64)
    tmp79 = tmp0 >= tmp78
    tmp80 = tl.full([1, 1], 17, tl.int64)
    tmp81 = tmp0 < tmp80
    tmp82 = tmp79 & tmp81
    tmp83 = tl.load(in_ptr13 + (r2 + (128*x1)), tmp82 & xmask, eviction_policy='evict_last', other=0.0)
    tmp84 = tl.full([1, 1], 15, tl.int64)
    tmp85 = tmp0 >= tmp84
    tmp86 = tmp0 < tmp78
    tmp87 = tmp85 & tmp86
    tmp88 = tl.load(in_ptr14 + (r2 + (128*x1)), tmp87 & xmask, eviction_policy='evict_last', other=0.0)
    tmp89 = tl.full([1, 1], 14, tl.int64)
    tmp90 = tmp0 >= tmp89
    tmp91 = tmp0 < tmp84
    tmp92 = tmp90 & tmp91
    tmp93 = tl.load(in_ptr15 + (r2 + (128*x1)), tmp92 & xmask, eviction_policy='evict_last', other=0.0)
    tmp94 = tmp0 >= tmp56
    tmp95 = tmp0 < tmp89
    tmp96 = tmp94 & tmp95
    tmp97 = tl.load(in_ptr16 + (r2 + (128*x1)), 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, 1], 20, tl.int64)
    tmp103 = tmp0 >= tmp102
    tmp104 = tl.full([1, 1], 21, tl.int64)
    tmp105 = tmp0 < tmp104
    tmp106 = tmp103 & tmp105
    tmp107 = tl.load(in_ptr17 + (r2 + (128*x1)), tmp106 & xmask, eviction_policy='evict_last', other=0.0)
    tmp108 = tl.full([1, 1], 19, tl.int64)
    tmp109 = tmp0 >= tmp108
    tmp110 = tmp0 < tmp102
    tmp111 = tmp109 & tmp110
    tmp112 = tl.load(in_ptr18 + (r2 + (128*x1)), tmp111 & xmask, eviction_policy='evict_last', other=0.0)
    tmp113 = tl.full([1, 1], 18, tl.int64)
    tmp114 = tmp0 >= tmp113
    tmp115 = tmp0 < tmp108
    tmp116 = tmp114 & tmp115
    tmp117 = tl.load(in_ptr19 + (r2 + (128*x1)), tmp116 & xmask, eviction_policy='evict_last', other=0.0)
    tmp118 = tmp0 >= tmp80
    tmp119 = tmp0 < tmp113
    tmp120 = tmp118 & tmp119
    tmp121 = tl.load(in_ptr20 + (r2 + (128*x1)), 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, 1], 24, tl.int64)
    tmp127 = tmp0 >= tmp126
    tmp128 = tl.full([1, 1], 25, tl.int64)
    tmp129 = tmp0 < tmp128
    tmp130 = tmp127 & tmp129
    tmp131 = tl.load(in_ptr21 + (r2 + (128*x1)), tmp130 & xmask, eviction_policy='evict_last', other=0.0)
    tmp132 = tl.full([1, 1], 23, tl.int64)
    tmp133 = tmp0 >= tmp132
    tmp134 = tmp0 < tmp126
    tmp135 = tmp133 & tmp134
    tmp136 = tl.load(in_ptr22 + (r2 + (128*x1)), tmp135 & xmask, eviction_policy='evict_last', other=0.0)
    tmp137 = tl.full([1, 1], 22, tl.int64)
    tmp138 = tmp0 >= tmp137
    tmp139 = tmp0 < tmp132
    tmp140 = tmp138 & tmp139
    tmp141 = tl.load(in_ptr23 + (r2 + (128*x1)), tmp140 & xmask, eviction_policy='evict_last', other=0.0)
    tmp142 = tmp0 >= tmp104
    tmp143 = tmp0 < tmp137
    tmp144 = tmp142 & tmp143
    tmp145 = tl.load(in_ptr24 + (r2 + (128*x1)), 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, 1], 28, tl.int64)
    tmp151 = tmp0 >= tmp150
    tmp152 = tl.full([1, 1], 29, tl.int64)
    tmp153 = tmp0 < tmp152
    tmp154 = tmp151 & tmp153
    tmp155 = tl.load(in_ptr25 + (r2 + (128*x1)), tmp154 & xmask, eviction_policy='evict_last', other=0.0)
    tmp156 = tl.full([1, 1], 27, tl.int64)
    tmp157 = tmp0 >= tmp156
    tmp158 = tmp0 < tmp150
    tmp159 = tmp157 & tmp158
    tmp160 = tl.load(in_ptr26 + (r2 + (128*x1)), tmp159 & xmask, eviction_policy='evict_last', other=0.0)
    tmp161 = tl.full([1, 1], 26, tl.int64)
    tmp162 = tmp0 >= tmp161
    tmp163 = tmp0 < tmp156
    tmp164 = tmp162 & tmp163
    tmp165 = tl.load(in_ptr27 + (r2 + (128*x1)), tmp164 & xmask, eviction_policy='evict_last', other=0.0)
    tmp166 = tmp0 >= tmp128
    tmp167 = tmp0 < tmp161
    tmp168 = tmp166 & tmp167
    tmp169 = tl.load(in_ptr28 + (r2 + (128*x1)), 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, 1], 32, tl.int64)
    tmp175 = tmp0 >= tmp174
    tmp176 = tl.full([1, 1], 33, tl.int64)
    tmp177 = tmp0 < tmp176
    tmp178 = tmp175 & tmp177
    tmp179 = tl.load(in_ptr29 + (r2 + (128*x1)), tmp178 & xmask, eviction_policy='evict_last', other=0.0)
    tmp180 = tl.full([1, 1], 31, tl.int64)
    tmp181 = tmp0 >= tmp180
    tmp182 = tmp0 < tmp174
    tmp183 = tmp181 & tmp182
    tmp184 = tl.load(in_ptr30 + (r2 + (128*x1)), tmp183 & xmask, eviction_policy='evict_last', other=0.0)
    tmp185 = tl.full([1, 1], 30, tl.int64)
    tmp186 = tmp0 >= tmp185
    tmp187 = tmp0 < tmp180
    tmp188 = tmp186 & tmp187
    tmp189 = tl.load(in_ptr31 + (r2 + (128*x1)), tmp188 & xmask, eviction_policy='evict_last', other=0.0)
    tmp190 = tmp0 >= tmp152
    tmp191 = tmp0 < tmp185
    tmp192 = tmp190 & tmp191
    tmp193 = tl.load(in_ptr32 + (r2 + (128*x1)), 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, 1], 36, tl.int64)
    tmp199 = tmp0 >= tmp198
    tmp200 = tl.full([1, 1], 37, tl.int64)
    tmp201 = tmp0 < tmp200
    tmp202 = tmp199 & tmp201
    tmp203 = tl.load(in_ptr33 + (r2 + (128*x1)), tmp202 & xmask, eviction_policy='evict_last', other=0.0)
    tmp204 = tl.full([1, 1], 35, tl.int64)
    tmp205 = tmp0 >= tmp204
    tmp206 = tmp0 < tmp198
    tmp207 = tmp205 & tmp206
    tmp208 = tl.load(in_ptr34 + (r2 + (128*x1)), tmp207 & xmask, eviction_policy='evict_last', other=0.0)
    tmp209 = tl.full([1, 1], 34, tl.int64)
    tmp210 = tmp0 >= tmp209
    tmp211 = tmp0 < tmp204
    tmp212 = tmp210 & tmp211
    tmp213 = tl.load(in_ptr35 + (r2 + (128*x1)), tmp212 & xmask, eviction_policy='evict_last', other=0.0)
    tmp214 = tmp0 >= tmp176
    tmp215 = tmp0 < tmp209
    tmp216 = tmp214 & tmp215
    tmp217 = tl.load(in_ptr36 + (r2 + (128*x1)), 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, 1], 40, tl.int64)
    tmp223 = tmp0 >= tmp222
    tmp224 = tl.full([1, 1], 41, tl.int64)
    tmp225 = tmp0 < tmp224
    tmp226 = tmp223 & tmp225
    tmp227 = tl.load(in_ptr37 + (r2 + (128*x1)), tmp226 & xmask, eviction_policy='evict_last', other=0.0)
    tmp228 = tl.full([1, 1], 39, tl.int64)
    tmp229 = tmp0 >= tmp228
    tmp230 = tmp0 < tmp222
    tmp231 = tmp229 & tmp230
    tmp232 = tl.load(in_ptr38 + (r2 + (128*x1)), tmp231 & xmask, eviction_policy='evict_last', other=0.0)
    tmp233 = tl.full([1, 1], 38, tl.int64)
    tmp234 = tmp0 >= tmp233
    tmp235 = tmp0 < tmp228
    tmp236 = tmp234 & tmp235
    tmp237 = tl.load(in_ptr39 + (r2 + (128*x1)), tmp236 & xmask, eviction_policy='evict_last', other=0.0)
    tmp238 = tmp0 >= tmp200
    tmp239 = tmp0 < tmp233
    tmp240 = tmp238 & tmp239
    tmp241 = tl.load(in_ptr40 + (r2 + (128*x1)), 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, 1], 44, tl.int64)
    tmp247 = tmp0 >= tmp246
    tmp248 = tl.full([1, 1], 45, tl.int64)
    tmp249 = tmp0 < tmp248
    tmp250 = tmp247 & tmp249
    tmp251 = tl.load(in_ptr41 + (r2 + (128*x1)), tmp250 & xmask, eviction_policy='evict_last', other=0.0)
    tmp252 = tl.full([1, 1], 43, tl.int64)
    tmp253 = tmp0 >= tmp252
    tmp254 = tmp0 < tmp246
    tmp255 = tmp253 & tmp254
    tmp256 = tl.load(in_ptr42 + (r2 + (128*x1)), tmp255 & xmask, eviction_policy='evict_last', other=0.0)
    tmp257 = tl.full([1, 1], 42, tl.int64)
    tmp258 = tmp0 >= tmp257
    tmp259 = tmp0 < tmp252
    tmp260 = tmp258 & tmp259
    tmp261 = tl.load(in_ptr43 + (r2 + (128*x1)), tmp260 & xmask, eviction_policy='evict_last', other=0.0)
    tmp262 = tmp0 >= tmp224
    tmp263 = tmp0 < tmp257
    tmp264 = tmp262 & tmp263
    tmp265 = tl.load(in_ptr44 + (r2 + (128*x1)), 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, 1], 48, tl.int64)
    tmp271 = tmp0 >= tmp270
    tmp272 = tl.full([1, 1], 49, tl.int64)
    tmp273 = tmp0 < tmp272
    tmp274 = tmp271 & tmp273
    tmp275 = tl.load(in_ptr45 + (r2 + (128*x1)), tmp274 & xmask, eviction_policy='evict_last', other=0.0)
    tmp276 = tl.full([1, 1], 47, tl.int64)
    tmp277 = tmp0 >= tmp276
    tmp278 = tmp0 < tmp270
    tmp279 = tmp277 & tmp278
    tmp280 = tl.load(in_ptr46 + (r2 + (128*x1)), tmp279 & xmask, eviction_policy='evict_last', other=0.0)
    tmp281 = tl.full([1, 1], 46, tl.int64)
    tmp282 = tmp0 >= tmp281
    tmp283 = tmp0 < tmp276
    tmp284 = tmp282 & tmp283
    tmp285 = tl.load(in_ptr47 + (r2 + (128*x1)), tmp284 & xmask, eviction_policy='evict_last', other=0.0)
    tmp286 = tmp0 >= tmp248
    tmp287 = tmp0 < tmp281
    tmp288 = tmp286 & tmp287
    tmp289 = tl.load(in_ptr48 + (r2 + (128*x1)), 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, 1], 52, tl.int64)
    tmp295 = tmp0 >= tmp294
    tmp296 = tl.full([1, 1], 53, tl.int64)
    tmp297 = tmp0 < tmp296
    tmp298 = tmp295 & tmp297
    tmp299 = tl.load(in_ptr49 + (r2 + (128*x1)), tmp298 & xmask, eviction_policy='evict_last', other=0.0)
    tmp300 = tl.full([1, 1], 51, tl.int64)
    tmp301 = tmp0 >= tmp300
    tmp302 = tmp0 < tmp294
    tmp303 = tmp301 & tmp302
    tmp304 = tl.load(in_ptr50 + (r2 + (128*x1)), tmp303 & xmask, eviction_policy='evict_last', other=0.0)
    tmp305 = tl.full([1, 1], 50, tl.int64)
    tmp306 = tmp0 >= tmp305
    tmp307 = tmp0 < tmp300
    tmp308 = tmp306 & tmp307
    tmp309 = tl.load(in_ptr51 + (r2 + (128*x1)), tmp308 & xmask, eviction_policy='evict_last', other=0.0)
    tmp310 = tmp0 >= tmp272
    tmp311 = tmp0 < tmp305
    tmp312 = tmp310 & tmp311
    tmp313 = tl.load(in_ptr52 + (r2 + (128*x1)), 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, 1], 56, tl.int64)
    tmp319 = tmp0 >= tmp318
    tmp320 = tl.full([1, 1], 57, tl.int64)
    tmp321 = tmp0 < tmp320
    tmp322 = tmp319 & tmp321
    tmp323 = tl.load(in_ptr53 + (r2 + (128*x1)), tmp322 & xmask, eviction_policy='evict_last', other=0.0)
    tmp324 = tl.full([1, 1], 55, tl.int64)
    tmp325 = tmp0 >= tmp324
    tmp326 = tmp0 < tmp318
    tmp327 = tmp325 & tmp326
    tmp328 = tl.load(in_ptr54 + (r2 + (128*x1)), tmp327 & xmask, eviction_policy='evict_last', other=0.0)
    tmp329 = tl.full([1, 1], 54, tl.int64)
    tmp330 = tmp0 >= tmp329
    tmp331 = tmp0 < tmp324
    tmp332 = tmp330 & tmp331
    tmp333 = tl.load(in_ptr55 + (r2 + (128*x1)), tmp332 & xmask, eviction_policy='evict_last', other=0.0)
    tmp334 = tmp0 >= tmp296
    tmp335 = tmp0 < tmp329
    tmp336 = tmp334 & tmp335
    tmp337 = tl.load(in_ptr56 + (r2 + (128*x1)), 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, 1], 60, tl.int64)
    tmp343 = tmp0 >= tmp342
    tmp344 = tl.full([1, 1], 61, tl.int64)
    tmp345 = tmp0 < tmp344
    tmp346 = tmp343 & tmp345
    tmp347 = tl.load(in_ptr57 + (r2 + (128*x1)), tmp346 & xmask, eviction_policy='evict_last', other=0.0)
    tmp348 = tl.full([1, 1], 59, tl.int64)
    tmp349 = tmp0 >= tmp348
    tmp350 = tmp0 < tmp342
    tmp351 = tmp349 & tmp350
    tmp352 = tl.load(in_ptr58 + (r2 + (128*x1)), tmp351 & xmask, eviction_policy='evict_last', other=0.0)
    tmp353 = tl.full([1, 1], 58, tl.int64)
    tmp354 = tmp0 >= tmp353
    tmp355 = tmp0 < tmp348
    tmp356 = tmp354 & tmp355
    tmp357 = tl.load(in_ptr59 + (r2 + (128*x1)), tmp356 & xmask, eviction_policy='evict_last', other=0.0)
    tmp358 = tmp0 >= tmp320
    tmp359 = tmp0 < tmp353
    tmp360 = tmp358 & tmp359
    tmp361 = tl.load(in_ptr60 + (r2 + (128*x1)), 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, 1], 63, tl.int64)
    tmp367 = tmp0 >= tmp366
    tmp368 = tl.load(in_ptr61 + (r2 + (128*x1)), tmp367 & xmask, eviction_policy='evict_last', other=0.0)
    tmp369 = tl.full([1, 1], 62, tl.int64)
    tmp370 = tmp0 >= tmp369
    tmp371 = tmp0 < tmp366
    tmp372 = tmp370 & tmp371
    tmp373 = tl.load(in_ptr62 + (r2 + (128*x1)), tmp372 & xmask, eviction_policy='evict_last', other=0.0)
    tmp374 = tmp0 >= tmp344
    tmp375 = tmp0 < tmp369
    tmp376 = tmp374 & tmp375
    tmp377 = tl.load(in_ptr63 + (r2 + (128*x1)), 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)
    tmp381 = tmp380 * tmp380
    tmp382 = tl.broadcast_to(tmp381, [XBLOCK, RBLOCK])
    tmp384 = tl.where(xmask, tmp382, 0)
    tmp385 = tl.sum(tmp384, 1)[:, None]
    tmp386 = libdevice.sqrt(tmp385)
    tl.store(in_out_ptr0 + (r2 + (128*x3)), tmp380, xmask)
    tl.debug_barrier()
    tl.store(in_out_ptr1 + (x3), tmp386, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_7/inductor_cache/t2/ct2f2hshheqz3ic3c445uhobgzuy7jfkonekptjcv4yqglojftmh.py
# Topologically Sorted Source Nodes: [vlad_3], Original ATen: [aten.linalg_vector_norm, aten.div]
# Source node to ATen node mapping:
#   vlad_3 => div_3, pow_5, pow_6, sum_68
# Graph fragment:
#   %pow_5 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Scalar](args = (%view_2, 2), kwargs = {})
#   %sum_68 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_5, [1], True), kwargs = {})
#   %pow_6 : [num_users=2] = call_function[target=torch.ops.aten.pow.Tensor_Scalar](args = (%sum_68, 0.5), kwargs = {})
#   %div_3 : [num_users=1] = call_function[target=torch.ops.aten.div.Tensor](args = (%view_2, %expand_66), kwargs = {})
triton_red_fused_div_linalg_vector_norm_7 = async_compile.triton('triton_red_fused_div_linalg_vector_norm_7', '''
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, 8192],
    reduction_hint=ReductionHint.INNER,
    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_7', 'mutated_arg_names': ['in_out_ptr0'], 'no_x_dim': False, 'num_load': 4, '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_7(in_out_ptr0, in_ptr0, in_ptr1, out_ptr0, xnumel, rnumel, XBLOCK : tl.constexpr, RBLOCK : tl.constexpr):
    xnumel = 4
    rnumel = 8192
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    rbase = tl.arange(0, RBLOCK)[None, :]
    x0 = xindex
    _tmp7 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    for roffset in range(0, rnumel, RBLOCK):
        rindex = roffset + rbase
        rmask = rindex < rnumel
        r1 = rindex
        tmp0 = tl.load(in_ptr0 + (r1 + (8192*x0)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp1 = tl.load(in_ptr1 + ((64*x0) + (r1 // 128)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp2 = 1e-12
        tmp3 = triton_helpers.maximum(tmp1, tmp2)
        tmp4 = tmp0 / tmp3
        tmp5 = tmp4 * tmp4
        tmp6 = tl.broadcast_to(tmp5, [XBLOCK, RBLOCK])
        tmp8 = _tmp7 + tmp6
        _tmp7 = tl.where(rmask & xmask, tmp8, _tmp7)
    tmp7 = tl.sum(_tmp7, 1)[:, None]
    tmp9 = libdevice.sqrt(tmp7)
    tl.debug_barrier()
    tl.store(in_out_ptr0 + (x0), tmp9, xmask)
    for roffset in range(0, rnumel, RBLOCK):
        rindex = roffset + rbase
        rmask = rindex < rnumel
        r1 = rindex
        tmp10 = tl.load(in_ptr0 + (r1 + (8192*x0)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp11 = tl.load(in_ptr1 + ((64*x0) + (r1 // 128)), rmask & xmask, eviction_policy='evict_last', other=0.0)
        tmp12 = 1e-12
        tmp13 = triton_helpers.maximum(tmp11, tmp12)
        tmp14 = tmp10 / tmp13
        tmp15 = triton_helpers.maximum(tmp9, tmp12)
        tmp16 = tmp14 / tmp15
        tl.store(out_ptr0 + (r1 + (8192*x0)), tmp16, 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, 128, 64, 64), (524288, 4096, 64, 1))
    assert_size_stride(primals_2, (64, 128, 1, 1), (128, 1, 1, 1))
    assert_size_stride(primals_3, (64, 128), (128, 1))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = empty_strided_cuda((4, 1, 64, 64), (4096, 16384, 64, 1), torch.float32)
        # Topologically Sorted Source Nodes: [x], Original ATen: [aten.linalg_vector_norm]
        stream0 = get_raw_stream(0)
        triton_red_fused_linalg_vector_norm_0.run(primals_1, buf0, 16384, 128, grid=grid(16384), stream=stream0)
        buf1 = empty_strided_cuda((4, 128, 64, 64), (524288, 4096, 64, 1), torch.float32)
        buf6 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf8 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf10 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf12 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf15 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf17 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf19 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf21 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf24 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf26 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf28 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf30 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf33 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf35 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf37 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf39 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf42 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf44 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf46 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf48 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf51 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf53 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf55 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf57 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf60 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf62 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf64 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf66 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf69 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf71 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf73 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf75 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf78 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf80 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf82 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf84 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf87 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf89 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf91 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf93 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf96 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf98 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf100 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf102 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf105 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf107 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf109 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf111 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf114 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf116 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf118 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf120 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf123 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf125 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf127 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf129 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf132 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf134 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf136 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf138 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf141 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf143 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        buf145 = empty_strided_cuda((4, 1, 128, 4096), (524288, 2097152, 4096, 1), torch.float32)
        # Topologically Sorted Source Nodes: [x, residual_2, residual_4, residual_6, residual_8, residual_10, residual_12, residual_14, residual_16, residual_18, residual_20, residual_22, residual_24, residual_26, residual_28, residual_30, residual_32, residual_34, residual_36, residual_38, residual_40, residual_42, residual_44, residual_46, residual_48, residual_50, residual_52, residual_54, residual_56, residual_58, residual_60, residual_62, residual_64, residual_66, residual_68, residual_70, residual_72, residual_74, residual_76, residual_78, residual_80, residual_82, residual_84, residual_86, residual_88, residual_90, residual_92, residual_94, residual_96, residual_98, residual_100, residual_102, residual_104, residual_106, residual_108, residual_110, residual_112, residual_114, residual_116, residual_118, residual_120, residual_122, residual_124, residual_126], Original ATen: [aten.div, aten.sub]
        triton_poi_fused_div_sub_1.run(primals_1, buf0, primals_3, buf1, buf6, buf8, buf10, buf12, buf15, buf17, buf19, buf21, buf24, buf26, buf28, buf30, buf33, buf35, buf37, buf39, buf42, buf44, buf46, buf48, buf51, buf53, buf55, buf57, buf60, buf62, buf64, buf66, buf69, buf71, buf73, buf75, buf78, buf80, buf82, buf84, buf87, buf89, buf91, buf93, buf96, buf98, buf100, buf102, buf105, buf107, buf109, buf111, buf114, buf116, buf118, buf120, buf123, buf125, buf127, buf129, buf132, buf134, buf136, buf138, buf141, buf143, buf145, 2097152, grid=grid(2097152), stream=stream0)
        del primals_1
        # Topologically Sorted Source Nodes: [conv2d], Original ATen: [aten.convolution]
        buf2 = extern_kernels.convolution(buf1, primals_2, stride=(1, 1), padding=(0, 0), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf2, (4, 64, 64, 64), (262144, 4096, 64, 1))
        buf3 = reinterpret_tensor(buf0, (4, 1, 4096), (4096, 4096, 1), 0); del buf0  # reuse
        buf4 = empty_strided_cuda((4, 1, 4096), (4096, 4096, 1), torch.float32)
        # Topologically Sorted Source Nodes: [soft_assign_1], Original ATen: [aten._softmax]
        triton_per_fused__softmax_2.run(buf2, buf3, buf4, 16384, 64, grid=grid(16384), stream=stream0)
        buf5 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf7 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf9 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf11 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf13 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf16 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf18 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf20 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf22 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf25 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf27 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf29 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf31 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf34 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf36 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf38 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf40 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf43 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf45 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf47 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf49 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf52 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf54 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf56 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf58 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf61 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf63 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf65 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf67 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        # Topologically Sorted Source Nodes: [residual, residual_1, sum_1, residual_3, sum_2, residual_5, sum_3, residual_7, sum_4, residual_9, sum_5, residual_11, sum_6, residual_13, sum_7, residual_15, sum_8, residual_17, sum_9, residual_19, sum_10, residual_21, sum_11, residual_23, sum_12, residual_25, sum_13, residual_27, sum_14, residual_29, sum_15, residual_31, sum_16, residual_33, sum_17, residual_35, sum_18, residual_37, sum_19, residual_39, sum_20, residual_41, sum_21, residual_43, sum_22, residual_45, sum_23, residual_47, sum_24, residual_49, sum_25, residual_51, sum_26, residual_53, sum_27, residual_55, sum_28, residual_57, sum_29], Original ATen: [aten.sub, aten.mul, aten.sum]
        triton_red_fused_mul_sub_sum_3.run(buf1, primals_3, buf2, buf3, buf4, buf6, buf8, buf10, buf12, buf15, buf17, buf19, buf21, buf24, buf26, buf28, buf30, buf33, buf35, buf37, buf39, buf42, buf44, buf46, buf48, buf51, buf53, buf55, buf57, buf60, buf62, buf64, buf66, buf5, buf7, buf9, buf11, buf13, buf16, buf18, buf20, buf22, buf25, buf27, buf29, buf31, buf34, buf36, buf38, buf40, buf43, buf45, buf47, buf49, buf52, buf54, buf56, buf58, buf61, buf63, buf65, buf67, 512, 4096, grid=grid(512), stream=stream0)
        buf70 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf72 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf74 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf76 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf79 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf81 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf83 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf85 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf88 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf90 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf92 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf94 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf97 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf99 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf101 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf103 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf106 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf108 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf110 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf112 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf115 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf117 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf119 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf121 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf124 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf126 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf128 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf130 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        # Topologically Sorted Source Nodes: [residual_59, sum_30, residual_61, sum_31, residual_63, sum_32, residual_65, sum_33, residual_67, sum_34, residual_69, sum_35, residual_71, sum_36, residual_73, sum_37, residual_75, sum_38, residual_77, sum_39, residual_79, sum_40, residual_81, sum_41, residual_83, sum_42, residual_85, sum_43, residual_87, sum_44, residual_89, sum_45, residual_91, sum_46, residual_93, sum_47, residual_95, sum_48, residual_97, sum_49, residual_99, sum_50, residual_101, sum_51, residual_103, sum_52, residual_105, sum_53, residual_107, sum_54, residual_109, sum_55, residual_111, sum_56, residual_113, sum_57], Original ATen: [aten.mul, aten.sum]
        triton_red_fused_mul_sum_4.run(buf69, buf2, buf3, buf4, buf71, buf73, buf75, buf78, buf80, buf82, buf84, buf87, buf89, buf91, buf93, buf96, buf98, buf100, buf102, buf105, buf107, buf109, buf111, buf114, buf116, buf118, buf120, buf123, buf125, buf127, buf129, buf70, buf72, buf74, buf76, buf79, buf81, buf83, buf85, buf88, buf90, buf92, buf94, buf97, buf99, buf101, buf103, buf106, buf108, buf110, buf112, buf115, buf117, buf119, buf121, buf124, buf126, buf128, buf130, 512, 4096, grid=grid(512), stream=stream0)
        buf133 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf135 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf137 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf139 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf142 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf144 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        buf146 = empty_strided_cuda((4, 1, 128), (128, 512, 1), torch.float32)
        # Topologically Sorted Source Nodes: [residual_115, sum_58, residual_117, sum_59, residual_119, sum_60, residual_121, sum_61, residual_123, sum_62, residual_125, sum_63, residual_127, sum_64], Original ATen: [aten.mul, aten.sum]
        triton_red_fused_mul_sum_5.run(buf132, buf2, buf3, buf4, buf134, buf136, buf138, buf141, buf143, buf145, buf133, buf135, buf137, buf139, buf142, buf144, buf146, 512, 4096, grid=grid(512), stream=stream0)
        buf14 = empty_strided_cuda((4, 64, 128), (8192, 128, 1), torch.float32)
        buf23 = buf14; del buf14  # reuse
        buf32 = buf23; del buf23  # reuse
        buf41 = buf32; del buf32  # reuse
        buf50 = buf41; del buf41  # reuse
        buf59 = buf50; del buf50  # reuse
        buf68 = buf59; del buf59  # reuse
        buf77 = buf68; del buf68  # reuse
        buf86 = buf77; del buf77  # reuse
        buf95 = buf86; del buf86  # reuse
        buf104 = buf95; del buf95  # reuse
        buf113 = buf104; del buf104  # reuse
        buf122 = buf113; del buf113  # reuse
        buf131 = buf122; del buf122  # reuse
        buf140 = buf131; del buf131  # reuse
        buf147 = buf140; del buf140  # reuse
        buf148 = empty_strided_cuda((4, 64, 1), (64, 1, 256), torch.float32)
        buf149 = reinterpret_tensor(buf148, (4, 64, 1), (64, 1, 1), 0); del buf148  # 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, vlad_1], Original ATen: [aten.zeros, aten.copy, aten.linalg_vector_norm]
        triton_per_fused_copy_linalg_vector_norm_zeros_6.run(buf147, buf149, buf13, buf11, buf9, buf7, buf5, buf22, buf20, buf18, buf16, buf31, buf29, buf27, buf25, buf40, buf38, buf36, buf34, buf49, buf47, buf45, buf43, buf58, buf56, buf54, buf52, buf67, buf65, buf63, buf61, buf76, buf74, buf72, buf70, buf85, buf83, buf81, buf79, buf94, buf92, buf90, buf88, buf103, buf101, buf99, buf97, buf112, buf110, buf108, buf106, buf121, buf119, buf117, buf115, buf130, buf128, buf126, buf124, buf139, buf137, buf135, buf133, buf146, buf144, buf142, 256, 128, grid=grid(256), stream=stream0)
        del buf101
        del buf103
        del buf106
        del buf108
        del buf11
        del buf110
        del buf112
        del buf115
        del buf117
        del buf119
        del buf121
        del buf124
        del buf126
        del buf128
        del buf13
        del buf130
        del buf133
        del buf135
        del buf137
        del buf139
        del buf142
        del buf144
        del buf146
        del buf16
        del buf18
        del buf20
        del buf22
        del buf25
        del buf27
        del buf29
        del buf31
        del buf34
        del buf36
        del buf38
        del buf40
        del buf43
        del buf45
        del buf47
        del buf49
        del buf5
        del buf52
        del buf54
        del buf56
        del buf58
        del buf61
        del buf63
        del buf65
        del buf67
        del buf7
        del buf70
        del buf72
        del buf74
        del buf76
        del buf79
        del buf81
        del buf83
        del buf85
        del buf88
        del buf9
        del buf90
        del buf92
        del buf94
        del buf97
        del buf99
        buf150 = empty_strided_cuda((4, 1), (1, 4), torch.float32)
        buf151 = reinterpret_tensor(buf150, (4, 1), (1, 1), 0); del buf150  # reuse
        buf152 = empty_strided_cuda((4, 8192), (8192, 1), torch.float32)
        # Topologically Sorted Source Nodes: [vlad_3], Original ATen: [aten.linalg_vector_norm, aten.div]
        triton_red_fused_div_linalg_vector_norm_7.run(buf151, buf147, buf149, buf152, 4, 8192, grid=grid(4), stream=stream0)
    return (buf152, primals_2, buf1, buf2, buf3, buf4, reinterpret_tensor(primals_3, (1, 128), (128, 1), 0), buf6, buf8, buf10, buf12, buf15, buf17, buf19, buf21, buf24, buf26, buf28, buf30, buf33, buf35, buf37, buf39, buf42, buf44, buf46, buf48, buf51, buf53, buf55, buf57, buf60, buf62, buf64, buf66, buf69, buf71, buf73, buf75, buf78, buf80, buf82, buf84, buf87, buf89, buf91, buf93, buf96, buf98, buf100, buf102, buf105, buf107, buf109, buf111, buf114, buf116, buf118, buf120, buf123, buf125, buf127, buf129, buf132, buf134, buf136, buf138, buf141, buf143, buf145, buf147, buf149, buf151, )


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, 128, 64, 64), (524288, 4096, 64, 1), device='cuda:0', dtype=torch.float32)
    primals_2 = rand_strided((64, 128, 1, 1), (128, 1, 1, 1), device='cuda:0', dtype=torch.float32)
    primals_3 = rand_strided((64, 128), (128, 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
import torch.nn as nn
import torch.nn.functional as F
from sklearn.neighbors import NearestNeighbors


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

    def __init__(self, num_clusters=64, dim=128, normalize_input=True,
        vladv2=False):
        """
        Args:
            num_clusters : int
                The number of clusters
            dim : int
                Dimension of descriptors
            alpha : float
                Parameter of initialization. Larger value is harder assignment.
            normalize_input : bool
                If true, descriptor-wise L2 normalization is applied to input.
            vladv2 : bool
                If true, use vladv2 otherwise use vladv1
        """
        super(NetVLAD, self).__init__()
        self.num_clusters = num_clusters
        self.dim = dim
        self.alpha = 0
        self.vladv2 = vladv2
        self.normalize_input = normalize_input
        self.conv = nn.Conv2d(dim, num_clusters, kernel_size=(1, 1), bias=
            vladv2)
        self.centroids = nn.Parameter(torch.rand(num_clusters, dim))

    def init_params(self, clsts, traindescs):
        if self.vladv2 is False:
            clstsAssign = clsts / np.linalg.norm(clsts, axis=1, keepdims=True)
            dots = np.dot(clstsAssign, traindescs.T)
            dots.sort(0)
            dots = dots[::-1, :]
            self.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(self.alpha *
                clstsAssign).unsqueeze(2).unsqueeze(3))
            self.conv.bias = None
        else:
            knn = NearestNeighbors(n_jobs=-1)
            knn.fit(traindescs)
            del traindescs
            dsSq = np.square(knn.kneighbors(clsts, 2)[1])
            del knn
            self.alpha = (-np.log(0.01) / np.mean(dsSq[:, 1] - dsSq[:, 0])
                ).item()
            self.centroids = nn.Parameter(torch.from_numpy(clsts))
            del clsts, dsSq
            self.conv.weight = nn.Parameter((2.0 * self.alpha * self.
                centroids).unsqueeze(-1).unsqueeze(-1))
            self.conv.bias = nn.Parameter(-self.alpha * self.centroids.norm
                (dim=1))

    def forward(self, x):
        N, C = x.shape[:2]
        if self.normalize_input:
            x = F.normalize(x, p=2, dim=1)
        soft_assign = self.conv(x).view(N, self.num_clusters, -1)
        soft_assign = F.softmax(soft_assign, dim=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(x.size(0), -1)
        vlad = F.normalize(vlad, p=2, dim=1)
        return vlad


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


def get_init_inputs():
    return [[], {}]

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
import torch.nn as nn
from sklearn.neighbors import NearestNeighbors
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_red_fused_linalg_vector_norm_0(in_ptr0, out_ptr0, xnumel, rnumel,
    XBLOCK: tl.constexpr, RBLOCK: tl.constexpr):
    rnumel = 128
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    tl.full([XBLOCK, RBLOCK], True, tl.int1)
    rbase = tl.arange(0, RBLOCK)[None, :]
    x0 = xindex % 4096
    x1 = xindex // 4096
    _tmp3 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    x3 = xindex
    for roffset in range(0, rnumel, RBLOCK):
        rindex = roffset + rbase
        rmask = rindex < rnumel
        r2 = rindex
        tmp0 = tl.load(in_ptr0 + (x0 + 4096 * r2 + 524288 * x1), rmask,
            eviction_policy='evict_last', other=0.0)
        tmp1 = tmp0 * tmp0
        tmp2 = tl.broadcast_to(tmp1, [XBLOCK, RBLOCK])
        tmp4 = _tmp3 + tmp2
        _tmp3 = tl.where(rmask, tmp4, _tmp3)
    tmp3 = tl.sum(_tmp3, 1)[:, None]
    tl.store(out_ptr0 + x3, tmp3, None)


@triton.jit
def triton_poi_fused_div_sub_1(in_ptr0, in_ptr1, in_ptr2, 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, out_ptr57, out_ptr58, out_ptr59, out_ptr60, out_ptr61,
    out_ptr62, out_ptr63, xnumel, XBLOCK: tl.constexpr):
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    tl.full([XBLOCK], True, tl.int1)
    x3 = xindex
    x0 = xindex % 4096
    x2 = xindex // 524288
    x1 = xindex // 4096 % 128
    tmp0 = tl.load(in_ptr0 + x3, None)
    tmp1 = tl.load(in_ptr1 + (x0 + 4096 * x2), None, eviction_policy=
        'evict_last')
    tmp6 = tl.load(in_ptr2 + (128 + x1), None, eviction_policy='evict_last')
    tmp8 = tl.load(in_ptr2 + (256 + x1), None, eviction_policy='evict_last')
    tmp10 = tl.load(in_ptr2 + (384 + x1), None, eviction_policy='evict_last')
    tmp12 = tl.load(in_ptr2 + (512 + x1), None, eviction_policy='evict_last')
    tmp14 = tl.load(in_ptr2 + (640 + x1), None, eviction_policy='evict_last')
    tmp16 = tl.load(in_ptr2 + (768 + x1), None, eviction_policy='evict_last')
    tmp18 = tl.load(in_ptr2 + (896 + x1), None, eviction_policy='evict_last')
    tmp20 = tl.load(in_ptr2 + (1024 + x1), None, eviction_policy='evict_last')
    tmp22 = tl.load(in_ptr2 + (1152 + x1), None, eviction_policy='evict_last')
    tmp24 = tl.load(in_ptr2 + (1280 + x1), None, eviction_policy='evict_last')
    tmp26 = tl.load(in_ptr2 + (1408 + x1), None, eviction_policy='evict_last')
    tmp28 = tl.load(in_ptr2 + (1536 + x1), None, eviction_policy='evict_last')
    tmp30 = tl.load(in_ptr2 + (1664 + x1), None, eviction_policy='evict_last')
    tmp32 = tl.load(in_ptr2 + (1792 + x1), None, eviction_policy='evict_last')
    tmp34 = tl.load(in_ptr2 + (1920 + x1), None, eviction_policy='evict_last')
    tmp36 = tl.load(in_ptr2 + (2048 + x1), None, eviction_policy='evict_last')
    tmp38 = tl.load(in_ptr2 + (2176 + x1), None, eviction_policy='evict_last')
    tmp40 = tl.load(in_ptr2 + (2304 + x1), None, eviction_policy='evict_last')
    tmp42 = tl.load(in_ptr2 + (2432 + x1), None, eviction_policy='evict_last')
    tmp44 = tl.load(in_ptr2 + (2560 + x1), None, eviction_policy='evict_last')
    tmp46 = tl.load(in_ptr2 + (2688 + x1), None, eviction_policy='evict_last')
    tmp48 = tl.load(in_ptr2 + (2816 + x1), None, eviction_policy='evict_last')
    tmp50 = tl.load(in_ptr2 + (2944 + x1), None, eviction_policy='evict_last')
    tmp52 = tl.load(in_ptr2 + (3072 + x1), None, eviction_policy='evict_last')
    tmp54 = tl.load(in_ptr2 + (3200 + x1), None, eviction_policy='evict_last')
    tmp56 = tl.load(in_ptr2 + (3328 + x1), None, eviction_policy='evict_last')
    tmp58 = tl.load(in_ptr2 + (3456 + x1), None, eviction_policy='evict_last')
    tmp60 = tl.load(in_ptr2 + (3584 + x1), None, eviction_policy='evict_last')
    tmp62 = tl.load(in_ptr2 + (3712 + x1), None, eviction_policy='evict_last')
    tmp64 = tl.load(in_ptr2 + (3840 + x1), None, eviction_policy='evict_last')
    tmp66 = tl.load(in_ptr2 + (3968 + x1), None, eviction_policy='evict_last')
    tmp68 = tl.load(in_ptr2 + (4096 + x1), None, eviction_policy='evict_last')
    tmp70 = tl.load(in_ptr2 + (4224 + x1), None, eviction_policy='evict_last')
    tmp72 = tl.load(in_ptr2 + (4352 + x1), None, eviction_policy='evict_last')
    tmp74 = tl.load(in_ptr2 + (4480 + x1), None, eviction_policy='evict_last')
    tmp76 = tl.load(in_ptr2 + (4608 + x1), None, eviction_policy='evict_last')
    tmp78 = tl.load(in_ptr2 + (4736 + x1), None, eviction_policy='evict_last')
    tmp80 = tl.load(in_ptr2 + (4864 + x1), None, eviction_policy='evict_last')
    tmp82 = tl.load(in_ptr2 + (4992 + x1), None, eviction_policy='evict_last')
    tmp84 = tl.load(in_ptr2 + (5120 + x1), None, eviction_policy='evict_last')
    tmp86 = tl.load(in_ptr2 + (5248 + x1), None, eviction_policy='evict_last')
    tmp88 = tl.load(in_ptr2 + (5376 + x1), None, eviction_policy='evict_last')
    tmp90 = tl.load(in_ptr2 + (5504 + x1), None, eviction_policy='evict_last')
    tmp92 = tl.load(in_ptr2 + (5632 + x1), None, eviction_policy='evict_last')
    tmp94 = tl.load(in_ptr2 + (5760 + x1), None, eviction_policy='evict_last')
    tmp96 = tl.load(in_ptr2 + (5888 + x1), None, eviction_policy='evict_last')
    tmp98 = tl.load(in_ptr2 + (6016 + x1), None, eviction_policy='evict_last')
    tmp100 = tl.load(in_ptr2 + (6144 + x1), None, eviction_policy='evict_last')
    tmp102 = tl.load(in_ptr2 + (6272 + x1), None, eviction_policy='evict_last')
    tmp104 = tl.load(in_ptr2 + (6400 + x1), None, eviction_policy='evict_last')
    tmp106 = tl.load(in_ptr2 + (6528 + x1), None, eviction_policy='evict_last')
    tmp108 = tl.load(in_ptr2 + (6656 + x1), None, eviction_policy='evict_last')
    tmp110 = tl.load(in_ptr2 + (6784 + x1), None, eviction_policy='evict_last')
    tmp112 = tl.load(in_ptr2 + (6912 + x1), None, eviction_policy='evict_last')
    tmp114 = tl.load(in_ptr2 + (7040 + x1), None, eviction_policy='evict_last')
    tmp116 = tl.load(in_ptr2 + (7168 + x1), None, eviction_policy='evict_last')
    tmp118 = tl.load(in_ptr2 + (7296 + x1), None, eviction_policy='evict_last')
    tmp120 = tl.load(in_ptr2 + (7424 + x1), None, eviction_policy='evict_last')
    tmp122 = tl.load(in_ptr2 + (7552 + x1), None, eviction_policy='evict_last')
    tmp124 = tl.load(in_ptr2 + (7680 + x1), None, eviction_policy='evict_last')
    tmp126 = tl.load(in_ptr2 + (7808 + x1), None, eviction_policy='evict_last')
    tmp128 = tl.load(in_ptr2 + (7936 + x1), None, eviction_policy='evict_last')
    tmp130 = tl.load(in_ptr2 + (8064 + x1), None, eviction_policy='evict_last')
    tmp2 = libdevice.sqrt(tmp1)
    tmp3 = 1e-12
    tmp4 = triton_helpers.maximum(tmp2, tmp3)
    tmp5 = tmp0 / tmp4
    tmp7 = tmp5 - tmp6
    tmp9 = tmp5 - tmp8
    tmp11 = tmp5 - tmp10
    tmp13 = tmp5 - tmp12
    tmp15 = tmp5 - tmp14
    tmp17 = tmp5 - tmp16
    tmp19 = tmp5 - tmp18
    tmp21 = tmp5 - tmp20
    tmp23 = tmp5 - tmp22
    tmp25 = tmp5 - tmp24
    tmp27 = tmp5 - tmp26
    tmp29 = tmp5 - tmp28
    tmp31 = tmp5 - tmp30
    tmp33 = tmp5 - tmp32
    tmp35 = tmp5 - tmp34
    tmp37 = tmp5 - tmp36
    tmp39 = tmp5 - tmp38
    tmp41 = tmp5 - tmp40
    tmp43 = tmp5 - tmp42
    tmp45 = tmp5 - tmp44
    tmp47 = tmp5 - tmp46
    tmp49 = tmp5 - tmp48
    tmp51 = tmp5 - tmp50
    tmp53 = tmp5 - tmp52
    tmp55 = tmp5 - tmp54
    tmp57 = tmp5 - tmp56
    tmp59 = tmp5 - tmp58
    tmp61 = tmp5 - tmp60
    tmp63 = tmp5 - tmp62
    tmp65 = tmp5 - tmp64
    tmp67 = tmp5 - tmp66
    tmp69 = tmp5 - tmp68
    tmp71 = tmp5 - tmp70
    tmp73 = tmp5 - tmp72
    tmp75 = tmp5 - tmp74
    tmp77 = tmp5 - tmp76
    tmp79 = tmp5 - tmp78
    tmp81 = tmp5 - tmp80
    tmp83 = tmp5 - tmp82
    tmp85 = tmp5 - tmp84
    tmp87 = tmp5 - tmp86
    tmp89 = tmp5 - tmp88
    tmp91 = tmp5 - tmp90
    tmp93 = tmp5 - tmp92
    tmp95 = tmp5 - tmp94
    tmp97 = tmp5 - tmp96
    tmp99 = tmp5 - tmp98
    tmp101 = tmp5 - tmp100
    tmp103 = tmp5 - tmp102
    tmp105 = tmp5 - tmp104
    tmp107 = tmp5 - tmp106
    tmp109 = tmp5 - tmp108
    tmp111 = tmp5 - tmp110
    tmp113 = tmp5 - tmp112
    tmp115 = tmp5 - tmp114
    tmp117 = tmp5 - tmp116
    tmp119 = tmp5 - tmp118
    tmp121 = tmp5 - tmp120
    tmp123 = tmp5 - tmp122
    tmp125 = tmp5 - tmp124
    tmp127 = tmp5 - tmp126
    tmp129 = tmp5 - tmp128
    tmp131 = tmp5 - tmp130
    tl.store(out_ptr0 + x3, tmp5, None)
    tl.store(out_ptr1 + x3, tmp7, None)
    tl.store(out_ptr2 + x3, tmp9, None)
    tl.store(out_ptr3 + x3, tmp11, None)
    tl.store(out_ptr4 + x3, tmp13, None)
    tl.store(out_ptr5 + x3, tmp15, None)
    tl.store(out_ptr6 + x3, tmp17, None)
    tl.store(out_ptr7 + x3, tmp19, None)
    tl.store(out_ptr8 + x3, tmp21, None)
    tl.store(out_ptr9 + x3, tmp23, None)
    tl.store(out_ptr10 + x3, tmp25, None)
    tl.store(out_ptr11 + x3, tmp27, None)
    tl.store(out_ptr12 + x3, tmp29, None)
    tl.store(out_ptr13 + x3, tmp31, None)
    tl.store(out_ptr14 + x3, tmp33, None)
    tl.store(out_ptr15 + x3, tmp35, None)
    tl.store(out_ptr16 + x3, tmp37, None)
    tl.store(out_ptr17 + x3, tmp39, None)
    tl.store(out_ptr18 + x3, tmp41, None)
    tl.store(out_ptr19 + x3, tmp43, None)
    tl.store(out_ptr20 + x3, tmp45, None)
    tl.store(out_ptr21 + x3, tmp47, None)
    tl.store(out_ptr22 + x3, tmp49, None)
    tl.store(out_ptr23 + x3, tmp51, None)
    tl.store(out_ptr24 + x3, tmp53, None)
    tl.store(out_ptr25 + x3, tmp55, None)
    tl.store(out_ptr26 + x3, tmp57, None)
    tl.store(out_ptr27 + x3, tmp59, None)
    tl.store(out_ptr28 + x3, tmp61, None)
    tl.store(out_ptr29 + x3, tmp63, None)
    tl.store(out_ptr30 + x3, tmp65, None)
    tl.store(out_ptr31 + x3, tmp67, None)
    tl.store(out_ptr32 + x3, tmp69, None)
    tl.store(out_ptr33 + x3, tmp71, None)
    tl.store(out_ptr34 + x3, tmp73, None)
    tl.store(out_ptr35 + x3, tmp75, None)
    tl.store(out_ptr36 + x3, tmp77, None)
    tl.store(out_ptr37 + x3, tmp79, None)
    tl.store(out_ptr38 + x3, tmp81, None)
    tl.store(out_ptr39 + x3, tmp83, None)
    tl.store(out_ptr40 + x3, tmp85, None)
    tl.store(out_ptr41 + x3, tmp87, None)
    tl.store(out_ptr42 + x3, tmp89, None)
    tl.store(out_ptr43 + x3, tmp91, None)
    tl.store(out_ptr44 + x3, tmp93, None)
    tl.store(out_ptr45 + x3, tmp95, None)
    tl.store(out_ptr46 + x3, tmp97, None)
    tl.store(out_ptr47 + x3, tmp99, None)
    tl.store(out_ptr48 + x3, tmp101, None)
    tl.store(out_ptr49 + x3, tmp103, None)
    tl.store(out_ptr50 + x3, tmp105, None)
    tl.store(out_ptr51 + x3, tmp107, None)
    tl.store(out_ptr52 + x3, tmp109, None)
    tl.store(out_ptr53 + x3, tmp111, None)
    tl.store(out_ptr54 + x3, tmp113, None)
    tl.store(out_ptr55 + x3, tmp115, None)
    tl.store(out_ptr56 + x3, tmp117, None)
    tl.store(out_ptr57 + x3, tmp119, None)
    tl.store(out_ptr58 + x3, tmp121, None)
    tl.store(out_ptr59 + x3, tmp123, None)
    tl.store(out_ptr60 + x3, tmp125, None)
    tl.store(out_ptr61 + x3, tmp127, None)
    tl.store(out_ptr62 + x3, tmp129, None)
    tl.store(out_ptr63 + x3, tmp131, None)


@triton.jit
def triton_per_fused__softmax_2(in_ptr0, out_ptr0, out_ptr1, xnumel, rnumel,
    XBLOCK: tl.constexpr):
    RBLOCK: tl.constexpr = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    tl.full([XBLOCK, RBLOCK], True, tl.int1)
    rindex = tl.arange(0, RBLOCK)[None, :]
    tl.full([XBLOCK, RBLOCK], True, tl.int1)
    r2 = rindex
    x0 = xindex % 4096
    x1 = xindex // 4096
    x3 = xindex
    tmp0 = tl.load(in_ptr0 + (x0 + 4096 * r2 + 262144 * x1), None)
    tmp1 = tl.broadcast_to(tmp0, [XBLOCK, RBLOCK])
    tmp3 = triton_helpers.max2(tmp1, 1)[:, None]
    tmp4 = tmp0 - tmp3
    tmp5 = tl_math.exp(tmp4)
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK, RBLOCK])
    tmp8 = tl.sum(tmp6, 1)[:, None]
    tl.store(out_ptr0 + x3, tmp3, None)
    tl.store(out_ptr1 + x3, tmp8, None)


@triton.jit
def triton_red_fused_mul_sub_sum_3(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, 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, xnumel, rnumel, XBLOCK: tl.
    constexpr, RBLOCK: tl.constexpr):
    xnumel = 512
    rnumel = 4096
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    rbase = tl.arange(0, RBLOCK)[None, :]
    x3 = xindex
    x0 = xindex % 128
    tmp1 = tl.load(in_ptr1 + x0, xmask, eviction_policy='evict_last')
    x1 = xindex // 128
    _tmp11 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp20 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp29 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp38 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp47 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp56 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp65 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp74 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp83 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp92 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp101 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp110 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp119 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp128 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp137 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp146 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp155 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp164 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp173 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp182 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp191 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp200 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp209 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp218 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp227 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp236 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp245 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp254 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp263 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    for roffset in range(0, rnumel, RBLOCK):
        rindex = roffset + rbase
        rmask = rindex < rnumel
        r2 = rindex
        tmp0 = tl.load(in_ptr0 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp3 = tl.load(in_ptr2 + (r2 + 262144 * x1), rmask & xmask,
            eviction_policy='evict_last', other=0.0)
        tmp4 = tl.load(in_ptr3 + (r2 + 4096 * x1), rmask & xmask,
            eviction_policy='evict_last', other=0.0)
        tmp7 = tl.load(in_ptr4 + (r2 + 4096 * x1), rmask & xmask,
            eviction_policy='evict_last', other=0.0)
        tmp13 = tl.load(in_ptr5 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp14 = tl.load(in_ptr2 + (4096 + r2 + 262144 * x1), rmask & xmask,
            eviction_policy='evict_last', other=0.0)
        tmp22 = tl.load(in_ptr6 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp23 = tl.load(in_ptr2 + (8192 + r2 + 262144 * x1), rmask & xmask,
            eviction_policy='evict_last', other=0.0)
        tmp31 = tl.load(in_ptr7 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp32 = tl.load(in_ptr2 + (12288 + r2 + 262144 * x1), rmask & xmask,
            eviction_policy='evict_last', other=0.0)
        tmp40 = tl.load(in_ptr8 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp41 = tl.load(in_ptr2 + (16384 + r2 + 262144 * x1), rmask & xmask,
            eviction_policy='evict_last', other=0.0)
        tmp49 = tl.load(in_ptr9 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp50 = tl.load(in_ptr2 + (20480 + r2 + 262144 * x1), rmask & xmask,
            eviction_policy='evict_last', other=0.0)
        tmp58 = tl.load(in_ptr10 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp59 = tl.load(in_ptr2 + (24576 + r2 + 262144 * x1), rmask & xmask,
            eviction_policy='evict_last', other=0.0)
        tmp67 = tl.load(in_ptr11 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp68 = tl.load(in_ptr2 + (28672 + r2 + 262144 * x1), rmask & xmask,
            eviction_policy='evict_last', other=0.0)
        tmp76 = tl.load(in_ptr12 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp77 = tl.load(in_ptr2 + (32768 + r2 + 262144 * x1), rmask & xmask,
            eviction_policy='evict_last', other=0.0)
        tmp85 = tl.load(in_ptr13 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp86 = tl.load(in_ptr2 + (36864 + r2 + 262144 * x1), rmask & xmask,
            eviction_policy='evict_last', other=0.0)
        tmp94 = tl.load(in_ptr14 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp95 = tl.load(in_ptr2 + (40960 + r2 + 262144 * x1), rmask & xmask,
            eviction_policy='evict_last', other=0.0)
        tmp103 = tl.load(in_ptr15 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp104 = tl.load(in_ptr2 + (45056 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp112 = tl.load(in_ptr16 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp113 = tl.load(in_ptr2 + (49152 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp121 = tl.load(in_ptr17 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp122 = tl.load(in_ptr2 + (53248 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp130 = tl.load(in_ptr18 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp131 = tl.load(in_ptr2 + (57344 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp139 = tl.load(in_ptr19 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp140 = tl.load(in_ptr2 + (61440 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp148 = tl.load(in_ptr20 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp149 = tl.load(in_ptr2 + (65536 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp157 = tl.load(in_ptr21 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp158 = tl.load(in_ptr2 + (69632 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp166 = tl.load(in_ptr22 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp167 = tl.load(in_ptr2 + (73728 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp175 = tl.load(in_ptr23 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp176 = tl.load(in_ptr2 + (77824 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp184 = tl.load(in_ptr24 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp185 = tl.load(in_ptr2 + (81920 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp193 = tl.load(in_ptr25 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp194 = tl.load(in_ptr2 + (86016 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp202 = tl.load(in_ptr26 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp203 = tl.load(in_ptr2 + (90112 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp211 = tl.load(in_ptr27 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp212 = tl.load(in_ptr2 + (94208 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp220 = tl.load(in_ptr28 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp221 = tl.load(in_ptr2 + (98304 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp229 = tl.load(in_ptr29 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp230 = tl.load(in_ptr2 + (102400 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp238 = tl.load(in_ptr30 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp239 = tl.load(in_ptr2 + (106496 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp247 = tl.load(in_ptr31 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp248 = tl.load(in_ptr2 + (110592 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp256 = tl.load(in_ptr32 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp257 = tl.load(in_ptr2 + (114688 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp2 = tmp0 - tmp1
        tmp5 = tmp3 - tmp4
        tmp6 = tl_math.exp(tmp5)
        tmp8 = tmp6 / tmp7
        tmp9 = tmp2 * tmp8
        tmp10 = tl.broadcast_to(tmp9, [XBLOCK, RBLOCK])
        tmp12 = _tmp11 + tmp10
        _tmp11 = tl.where(rmask & xmask, tmp12, _tmp11)
        tmp15 = tmp14 - tmp4
        tmp16 = tl_math.exp(tmp15)
        tmp17 = tmp16 / tmp7
        tmp18 = tmp13 * tmp17
        tmp19 = tl.broadcast_to(tmp18, [XBLOCK, RBLOCK])
        tmp21 = _tmp20 + tmp19
        _tmp20 = tl.where(rmask & xmask, tmp21, _tmp20)
        tmp24 = tmp23 - tmp4
        tmp25 = tl_math.exp(tmp24)
        tmp26 = tmp25 / tmp7
        tmp27 = tmp22 * tmp26
        tmp28 = tl.broadcast_to(tmp27, [XBLOCK, RBLOCK])
        tmp30 = _tmp29 + tmp28
        _tmp29 = tl.where(rmask & xmask, tmp30, _tmp29)
        tmp33 = tmp32 - tmp4
        tmp34 = tl_math.exp(tmp33)
        tmp35 = tmp34 / tmp7
        tmp36 = tmp31 * tmp35
        tmp37 = tl.broadcast_to(tmp36, [XBLOCK, RBLOCK])
        tmp39 = _tmp38 + tmp37
        _tmp38 = tl.where(rmask & xmask, tmp39, _tmp38)
        tmp42 = tmp41 - tmp4
        tmp43 = tl_math.exp(tmp42)
        tmp44 = tmp43 / tmp7
        tmp45 = tmp40 * tmp44
        tmp46 = tl.broadcast_to(tmp45, [XBLOCK, RBLOCK])
        tmp48 = _tmp47 + tmp46
        _tmp47 = tl.where(rmask & xmask, tmp48, _tmp47)
        tmp51 = tmp50 - tmp4
        tmp52 = tl_math.exp(tmp51)
        tmp53 = tmp52 / tmp7
        tmp54 = tmp49 * tmp53
        tmp55 = tl.broadcast_to(tmp54, [XBLOCK, RBLOCK])
        tmp57 = _tmp56 + tmp55
        _tmp56 = tl.where(rmask & xmask, tmp57, _tmp56)
        tmp60 = tmp59 - tmp4
        tmp61 = tl_math.exp(tmp60)
        tmp62 = tmp61 / tmp7
        tmp63 = tmp58 * tmp62
        tmp64 = tl.broadcast_to(tmp63, [XBLOCK, RBLOCK])
        tmp66 = _tmp65 + tmp64
        _tmp65 = tl.where(rmask & xmask, tmp66, _tmp65)
        tmp69 = tmp68 - tmp4
        tmp70 = tl_math.exp(tmp69)
        tmp71 = tmp70 / tmp7
        tmp72 = tmp67 * tmp71
        tmp73 = tl.broadcast_to(tmp72, [XBLOCK, RBLOCK])
        tmp75 = _tmp74 + tmp73
        _tmp74 = tl.where(rmask & xmask, tmp75, _tmp74)
        tmp78 = tmp77 - tmp4
        tmp79 = tl_math.exp(tmp78)
        tmp80 = tmp79 / tmp7
        tmp81 = tmp76 * tmp80
        tmp82 = tl.broadcast_to(tmp81, [XBLOCK, RBLOCK])
        tmp84 = _tmp83 + tmp82
        _tmp83 = tl.where(rmask & xmask, tmp84, _tmp83)
        tmp87 = tmp86 - tmp4
        tmp88 = tl_math.exp(tmp87)
        tmp89 = tmp88 / tmp7
        tmp90 = tmp85 * tmp89
        tmp91 = tl.broadcast_to(tmp90, [XBLOCK, RBLOCK])
        tmp93 = _tmp92 + tmp91
        _tmp92 = tl.where(rmask & xmask, tmp93, _tmp92)
        tmp96 = tmp95 - tmp4
        tmp97 = tl_math.exp(tmp96)
        tmp98 = tmp97 / tmp7
        tmp99 = tmp94 * tmp98
        tmp100 = tl.broadcast_to(tmp99, [XBLOCK, RBLOCK])
        tmp102 = _tmp101 + tmp100
        _tmp101 = tl.where(rmask & xmask, tmp102, _tmp101)
        tmp105 = tmp104 - tmp4
        tmp106 = tl_math.exp(tmp105)
        tmp107 = tmp106 / tmp7
        tmp108 = tmp103 * tmp107
        tmp109 = tl.broadcast_to(tmp108, [XBLOCK, RBLOCK])
        tmp111 = _tmp110 + tmp109
        _tmp110 = tl.where(rmask & xmask, tmp111, _tmp110)
        tmp114 = tmp113 - tmp4
        tmp115 = tl_math.exp(tmp114)
        tmp116 = tmp115 / tmp7
        tmp117 = tmp112 * tmp116
        tmp118 = tl.broadcast_to(tmp117, [XBLOCK, RBLOCK])
        tmp120 = _tmp119 + tmp118
        _tmp119 = tl.where(rmask & xmask, tmp120, _tmp119)
        tmp123 = tmp122 - tmp4
        tmp124 = tl_math.exp(tmp123)
        tmp125 = tmp124 / tmp7
        tmp126 = tmp121 * tmp125
        tmp127 = tl.broadcast_to(tmp126, [XBLOCK, RBLOCK])
        tmp129 = _tmp128 + tmp127
        _tmp128 = tl.where(rmask & xmask, tmp129, _tmp128)
        tmp132 = tmp131 - tmp4
        tmp133 = tl_math.exp(tmp132)
        tmp134 = tmp133 / tmp7
        tmp135 = tmp130 * tmp134
        tmp136 = tl.broadcast_to(tmp135, [XBLOCK, RBLOCK])
        tmp138 = _tmp137 + tmp136
        _tmp137 = tl.where(rmask & xmask, tmp138, _tmp137)
        tmp141 = tmp140 - tmp4
        tmp142 = tl_math.exp(tmp141)
        tmp143 = tmp142 / tmp7
        tmp144 = tmp139 * tmp143
        tmp145 = tl.broadcast_to(tmp144, [XBLOCK, RBLOCK])
        tmp147 = _tmp146 + tmp145
        _tmp146 = tl.where(rmask & xmask, tmp147, _tmp146)
        tmp150 = tmp149 - tmp4
        tmp151 = tl_math.exp(tmp150)
        tmp152 = tmp151 / tmp7
        tmp153 = tmp148 * tmp152
        tmp154 = tl.broadcast_to(tmp153, [XBLOCK, RBLOCK])
        tmp156 = _tmp155 + tmp154
        _tmp155 = tl.where(rmask & xmask, tmp156, _tmp155)
        tmp159 = tmp158 - tmp4
        tmp160 = tl_math.exp(tmp159)
        tmp161 = tmp160 / tmp7
        tmp162 = tmp157 * tmp161
        tmp163 = tl.broadcast_to(tmp162, [XBLOCK, RBLOCK])
        tmp165 = _tmp164 + tmp163
        _tmp164 = tl.where(rmask & xmask, tmp165, _tmp164)
        tmp168 = tmp167 - tmp4
        tmp169 = tl_math.exp(tmp168)
        tmp170 = tmp169 / tmp7
        tmp171 = tmp166 * tmp170
        tmp172 = tl.broadcast_to(tmp171, [XBLOCK, RBLOCK])
        tmp174 = _tmp173 + tmp172
        _tmp173 = tl.where(rmask & xmask, tmp174, _tmp173)
        tmp177 = tmp176 - tmp4
        tmp178 = tl_math.exp(tmp177)
        tmp179 = tmp178 / tmp7
        tmp180 = tmp175 * tmp179
        tmp181 = tl.broadcast_to(tmp180, [XBLOCK, RBLOCK])
        tmp183 = _tmp182 + tmp181
        _tmp182 = tl.where(rmask & xmask, tmp183, _tmp182)
        tmp186 = tmp185 - tmp4
        tmp187 = tl_math.exp(tmp186)
        tmp188 = tmp187 / tmp7
        tmp189 = tmp184 * tmp188
        tmp190 = tl.broadcast_to(tmp189, [XBLOCK, RBLOCK])
        tmp192 = _tmp191 + tmp190
        _tmp191 = tl.where(rmask & xmask, tmp192, _tmp191)
        tmp195 = tmp194 - tmp4
        tmp196 = tl_math.exp(tmp195)
        tmp197 = tmp196 / tmp7
        tmp198 = tmp193 * tmp197
        tmp199 = tl.broadcast_to(tmp198, [XBLOCK, RBLOCK])
        tmp201 = _tmp200 + tmp199
        _tmp200 = tl.where(rmask & xmask, tmp201, _tmp200)
        tmp204 = tmp203 - tmp4
        tmp205 = tl_math.exp(tmp204)
        tmp206 = tmp205 / tmp7
        tmp207 = tmp202 * tmp206
        tmp208 = tl.broadcast_to(tmp207, [XBLOCK, RBLOCK])
        tmp210 = _tmp209 + tmp208
        _tmp209 = tl.where(rmask & xmask, tmp210, _tmp209)
        tmp213 = tmp212 - tmp4
        tmp214 = tl_math.exp(tmp213)
        tmp215 = tmp214 / tmp7
        tmp216 = tmp211 * tmp215
        tmp217 = tl.broadcast_to(tmp216, [XBLOCK, RBLOCK])
        tmp219 = _tmp218 + tmp217
        _tmp218 = tl.where(rmask & xmask, tmp219, _tmp218)
        tmp222 = tmp221 - tmp4
        tmp223 = tl_math.exp(tmp222)
        tmp224 = tmp223 / tmp7
        tmp225 = tmp220 * tmp224
        tmp226 = tl.broadcast_to(tmp225, [XBLOCK, RBLOCK])
        tmp228 = _tmp227 + tmp226
        _tmp227 = tl.where(rmask & xmask, tmp228, _tmp227)
        tmp231 = tmp230 - tmp4
        tmp232 = tl_math.exp(tmp231)
        tmp233 = tmp232 / tmp7
        tmp234 = tmp229 * tmp233
        tmp235 = tl.broadcast_to(tmp234, [XBLOCK, RBLOCK])
        tmp237 = _tmp236 + tmp235
        _tmp236 = tl.where(rmask & xmask, tmp237, _tmp236)
        tmp240 = tmp239 - tmp4
        tmp241 = tl_math.exp(tmp240)
        tmp242 = tmp241 / tmp7
        tmp243 = tmp238 * tmp242
        tmp244 = tl.broadcast_to(tmp243, [XBLOCK, RBLOCK])
        tmp246 = _tmp245 + tmp244
        _tmp245 = tl.where(rmask & xmask, tmp246, _tmp245)
        tmp249 = tmp248 - tmp4
        tmp250 = tl_math.exp(tmp249)
        tmp251 = tmp250 / tmp7
        tmp252 = tmp247 * tmp251
        tmp253 = tl.broadcast_to(tmp252, [XBLOCK, RBLOCK])
        tmp255 = _tmp254 + tmp253
        _tmp254 = tl.where(rmask & xmask, tmp255, _tmp254)
        tmp258 = tmp257 - tmp4
        tmp259 = tl_math.exp(tmp258)
        tmp260 = tmp259 / tmp7
        tmp261 = tmp256 * tmp260
        tmp262 = tl.broadcast_to(tmp261, [XBLOCK, RBLOCK])
        tmp264 = _tmp263 + tmp262
        _tmp263 = tl.where(rmask & xmask, tmp264, _tmp263)
    tmp11 = tl.sum(_tmp11, 1)[:, None]
    tl.store(out_ptr0 + x3, tmp11, xmask)
    tmp20 = tl.sum(_tmp20, 1)[:, None]
    tl.store(out_ptr1 + x3, tmp20, xmask)
    tmp29 = tl.sum(_tmp29, 1)[:, None]
    tl.store(out_ptr2 + x3, tmp29, xmask)
    tmp38 = tl.sum(_tmp38, 1)[:, None]
    tl.store(out_ptr3 + x3, tmp38, xmask)
    tmp47 = tl.sum(_tmp47, 1)[:, None]
    tl.store(out_ptr4 + x3, tmp47, xmask)
    tmp56 = tl.sum(_tmp56, 1)[:, None]
    tl.store(out_ptr5 + x3, tmp56, xmask)
    tmp65 = tl.sum(_tmp65, 1)[:, None]
    tl.store(out_ptr6 + x3, tmp65, xmask)
    tmp74 = tl.sum(_tmp74, 1)[:, None]
    tl.store(out_ptr7 + x3, tmp74, xmask)
    tmp83 = tl.sum(_tmp83, 1)[:, None]
    tl.store(out_ptr8 + x3, tmp83, xmask)
    tmp92 = tl.sum(_tmp92, 1)[:, None]
    tl.store(out_ptr9 + x3, tmp92, xmask)
    tmp101 = tl.sum(_tmp101, 1)[:, None]
    tl.store(out_ptr10 + x3, tmp101, xmask)
    tmp110 = tl.sum(_tmp110, 1)[:, None]
    tl.store(out_ptr11 + x3, tmp110, xmask)
    tmp119 = tl.sum(_tmp119, 1)[:, None]
    tl.store(out_ptr12 + x3, tmp119, xmask)
    tmp128 = tl.sum(_tmp128, 1)[:, None]
    tl.store(out_ptr13 + x3, tmp128, xmask)
    tmp137 = tl.sum(_tmp137, 1)[:, None]
    tl.store(out_ptr14 + x3, tmp137, xmask)
    tmp146 = tl.sum(_tmp146, 1)[:, None]
    tl.store(out_ptr15 + x3, tmp146, xmask)
    tmp155 = tl.sum(_tmp155, 1)[:, None]
    tl.store(out_ptr16 + x3, tmp155, xmask)
    tmp164 = tl.sum(_tmp164, 1)[:, None]
    tl.store(out_ptr17 + x3, tmp164, xmask)
    tmp173 = tl.sum(_tmp173, 1)[:, None]
    tl.store(out_ptr18 + x3, tmp173, xmask)
    tmp182 = tl.sum(_tmp182, 1)[:, None]
    tl.store(out_ptr19 + x3, tmp182, xmask)
    tmp191 = tl.sum(_tmp191, 1)[:, None]
    tl.store(out_ptr20 + x3, tmp191, xmask)
    tmp200 = tl.sum(_tmp200, 1)[:, None]
    tl.store(out_ptr21 + x3, tmp200, xmask)
    tmp209 = tl.sum(_tmp209, 1)[:, None]
    tl.store(out_ptr22 + x3, tmp209, xmask)
    tmp218 = tl.sum(_tmp218, 1)[:, None]
    tl.store(out_ptr23 + x3, tmp218, xmask)
    tmp227 = tl.sum(_tmp227, 1)[:, None]
    tl.store(out_ptr24 + x3, tmp227, xmask)
    tmp236 = tl.sum(_tmp236, 1)[:, None]
    tl.store(out_ptr25 + x3, tmp236, xmask)
    tmp245 = tl.sum(_tmp245, 1)[:, None]
    tl.store(out_ptr26 + x3, tmp245, xmask)
    tmp254 = tl.sum(_tmp254, 1)[:, None]
    tl.store(out_ptr27 + x3, tmp254, xmask)
    tmp263 = tl.sum(_tmp263, 1)[:, None]
    tl.store(out_ptr28 + x3, tmp263, xmask)


@triton.jit
def triton_red_fused_mul_sum_4(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, 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, xnumel, rnumel, XBLOCK: tl.constexpr, RBLOCK: tl.constexpr):
    xnumel = 512
    rnumel = 4096
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    rbase = tl.arange(0, RBLOCK)[None, :]
    x3 = xindex
    x1 = xindex // 128
    _tmp9 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp18 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp27 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp36 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp45 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp54 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp63 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp72 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp81 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp90 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp99 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp108 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp117 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp126 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp135 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp144 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp153 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp162 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp171 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp180 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp189 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp198 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp207 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp216 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp225 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp234 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp243 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp252 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    for roffset in range(0, rnumel, RBLOCK):
        rindex = roffset + rbase
        rmask = rindex < rnumel
        r2 = rindex
        tmp0 = tl.load(in_ptr0 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp1 = tl.load(in_ptr1 + (118784 + r2 + 262144 * x1), rmask & xmask,
            eviction_policy='evict_last', other=0.0)
        tmp2 = tl.load(in_ptr2 + (r2 + 4096 * x1), rmask & xmask,
            eviction_policy='evict_last', other=0.0)
        tmp5 = tl.load(in_ptr3 + (r2 + 4096 * x1), rmask & xmask,
            eviction_policy='evict_last', other=0.0)
        tmp11 = tl.load(in_ptr4 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp12 = tl.load(in_ptr1 + (122880 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp20 = tl.load(in_ptr5 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp21 = tl.load(in_ptr1 + (126976 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp29 = tl.load(in_ptr6 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp30 = tl.load(in_ptr1 + (131072 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp38 = tl.load(in_ptr7 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp39 = tl.load(in_ptr1 + (135168 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp47 = tl.load(in_ptr8 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp48 = tl.load(in_ptr1 + (139264 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp56 = tl.load(in_ptr9 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp57 = tl.load(in_ptr1 + (143360 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp65 = tl.load(in_ptr10 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp66 = tl.load(in_ptr1 + (147456 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp74 = tl.load(in_ptr11 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp75 = tl.load(in_ptr1 + (151552 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp83 = tl.load(in_ptr12 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp84 = tl.load(in_ptr1 + (155648 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp92 = tl.load(in_ptr13 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp93 = tl.load(in_ptr1 + (159744 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp101 = tl.load(in_ptr14 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp102 = tl.load(in_ptr1 + (163840 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp110 = tl.load(in_ptr15 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp111 = tl.load(in_ptr1 + (167936 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp119 = tl.load(in_ptr16 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp120 = tl.load(in_ptr1 + (172032 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp128 = tl.load(in_ptr17 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp129 = tl.load(in_ptr1 + (176128 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp137 = tl.load(in_ptr18 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp138 = tl.load(in_ptr1 + (180224 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp146 = tl.load(in_ptr19 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp147 = tl.load(in_ptr1 + (184320 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp155 = tl.load(in_ptr20 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp156 = tl.load(in_ptr1 + (188416 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp164 = tl.load(in_ptr21 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp165 = tl.load(in_ptr1 + (192512 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp173 = tl.load(in_ptr22 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp174 = tl.load(in_ptr1 + (196608 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp182 = tl.load(in_ptr23 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp183 = tl.load(in_ptr1 + (200704 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp191 = tl.load(in_ptr24 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp192 = tl.load(in_ptr1 + (204800 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp200 = tl.load(in_ptr25 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp201 = tl.load(in_ptr1 + (208896 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp209 = tl.load(in_ptr26 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp210 = tl.load(in_ptr1 + (212992 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp218 = tl.load(in_ptr27 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp219 = tl.load(in_ptr1 + (217088 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp227 = tl.load(in_ptr28 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp228 = tl.load(in_ptr1 + (221184 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp236 = tl.load(in_ptr29 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp237 = tl.load(in_ptr1 + (225280 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp245 = tl.load(in_ptr30 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp246 = tl.load(in_ptr1 + (229376 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp3 = tmp1 - tmp2
        tmp4 = tl_math.exp(tmp3)
        tmp6 = tmp4 / tmp5
        tmp7 = tmp0 * tmp6
        tmp8 = tl.broadcast_to(tmp7, [XBLOCK, RBLOCK])
        tmp10 = _tmp9 + tmp8
        _tmp9 = tl.where(rmask & xmask, tmp10, _tmp9)
        tmp13 = tmp12 - tmp2
        tmp14 = tl_math.exp(tmp13)
        tmp15 = tmp14 / tmp5
        tmp16 = tmp11 * tmp15
        tmp17 = tl.broadcast_to(tmp16, [XBLOCK, RBLOCK])
        tmp19 = _tmp18 + tmp17
        _tmp18 = tl.where(rmask & xmask, tmp19, _tmp18)
        tmp22 = tmp21 - tmp2
        tmp23 = tl_math.exp(tmp22)
        tmp24 = tmp23 / tmp5
        tmp25 = tmp20 * tmp24
        tmp26 = tl.broadcast_to(tmp25, [XBLOCK, RBLOCK])
        tmp28 = _tmp27 + tmp26
        _tmp27 = tl.where(rmask & xmask, tmp28, _tmp27)
        tmp31 = tmp30 - tmp2
        tmp32 = tl_math.exp(tmp31)
        tmp33 = tmp32 / tmp5
        tmp34 = tmp29 * tmp33
        tmp35 = tl.broadcast_to(tmp34, [XBLOCK, RBLOCK])
        tmp37 = _tmp36 + tmp35
        _tmp36 = tl.where(rmask & xmask, tmp37, _tmp36)
        tmp40 = tmp39 - tmp2
        tmp41 = tl_math.exp(tmp40)
        tmp42 = tmp41 / tmp5
        tmp43 = tmp38 * tmp42
        tmp44 = tl.broadcast_to(tmp43, [XBLOCK, RBLOCK])
        tmp46 = _tmp45 + tmp44
        _tmp45 = tl.where(rmask & xmask, tmp46, _tmp45)
        tmp49 = tmp48 - tmp2
        tmp50 = tl_math.exp(tmp49)
        tmp51 = tmp50 / tmp5
        tmp52 = tmp47 * tmp51
        tmp53 = tl.broadcast_to(tmp52, [XBLOCK, RBLOCK])
        tmp55 = _tmp54 + tmp53
        _tmp54 = tl.where(rmask & xmask, tmp55, _tmp54)
        tmp58 = tmp57 - tmp2
        tmp59 = tl_math.exp(tmp58)
        tmp60 = tmp59 / tmp5
        tmp61 = tmp56 * tmp60
        tmp62 = tl.broadcast_to(tmp61, [XBLOCK, RBLOCK])
        tmp64 = _tmp63 + tmp62
        _tmp63 = tl.where(rmask & xmask, tmp64, _tmp63)
        tmp67 = tmp66 - tmp2
        tmp68 = tl_math.exp(tmp67)
        tmp69 = tmp68 / tmp5
        tmp70 = tmp65 * tmp69
        tmp71 = tl.broadcast_to(tmp70, [XBLOCK, RBLOCK])
        tmp73 = _tmp72 + tmp71
        _tmp72 = tl.where(rmask & xmask, tmp73, _tmp72)
        tmp76 = tmp75 - tmp2
        tmp77 = tl_math.exp(tmp76)
        tmp78 = tmp77 / tmp5
        tmp79 = tmp74 * tmp78
        tmp80 = tl.broadcast_to(tmp79, [XBLOCK, RBLOCK])
        tmp82 = _tmp81 + tmp80
        _tmp81 = tl.where(rmask & xmask, tmp82, _tmp81)
        tmp85 = tmp84 - tmp2
        tmp86 = tl_math.exp(tmp85)
        tmp87 = tmp86 / tmp5
        tmp88 = tmp83 * tmp87
        tmp89 = tl.broadcast_to(tmp88, [XBLOCK, RBLOCK])
        tmp91 = _tmp90 + tmp89
        _tmp90 = tl.where(rmask & xmask, tmp91, _tmp90)
        tmp94 = tmp93 - tmp2
        tmp95 = tl_math.exp(tmp94)
        tmp96 = tmp95 / tmp5
        tmp97 = tmp92 * tmp96
        tmp98 = tl.broadcast_to(tmp97, [XBLOCK, RBLOCK])
        tmp100 = _tmp99 + tmp98
        _tmp99 = tl.where(rmask & xmask, tmp100, _tmp99)
        tmp103 = tmp102 - tmp2
        tmp104 = tl_math.exp(tmp103)
        tmp105 = tmp104 / tmp5
        tmp106 = tmp101 * tmp105
        tmp107 = tl.broadcast_to(tmp106, [XBLOCK, RBLOCK])
        tmp109 = _tmp108 + tmp107
        _tmp108 = tl.where(rmask & xmask, tmp109, _tmp108)
        tmp112 = tmp111 - tmp2
        tmp113 = tl_math.exp(tmp112)
        tmp114 = tmp113 / tmp5
        tmp115 = tmp110 * tmp114
        tmp116 = tl.broadcast_to(tmp115, [XBLOCK, RBLOCK])
        tmp118 = _tmp117 + tmp116
        _tmp117 = tl.where(rmask & xmask, tmp118, _tmp117)
        tmp121 = tmp120 - tmp2
        tmp122 = tl_math.exp(tmp121)
        tmp123 = tmp122 / tmp5
        tmp124 = tmp119 * tmp123
        tmp125 = tl.broadcast_to(tmp124, [XBLOCK, RBLOCK])
        tmp127 = _tmp126 + tmp125
        _tmp126 = tl.where(rmask & xmask, tmp127, _tmp126)
        tmp130 = tmp129 - tmp2
        tmp131 = tl_math.exp(tmp130)
        tmp132 = tmp131 / tmp5
        tmp133 = tmp128 * tmp132
        tmp134 = tl.broadcast_to(tmp133, [XBLOCK, RBLOCK])
        tmp136 = _tmp135 + tmp134
        _tmp135 = tl.where(rmask & xmask, tmp136, _tmp135)
        tmp139 = tmp138 - tmp2
        tmp140 = tl_math.exp(tmp139)
        tmp141 = tmp140 / tmp5
        tmp142 = tmp137 * tmp141
        tmp143 = tl.broadcast_to(tmp142, [XBLOCK, RBLOCK])
        tmp145 = _tmp144 + tmp143
        _tmp144 = tl.where(rmask & xmask, tmp145, _tmp144)
        tmp148 = tmp147 - tmp2
        tmp149 = tl_math.exp(tmp148)
        tmp150 = tmp149 / tmp5
        tmp151 = tmp146 * tmp150
        tmp152 = tl.broadcast_to(tmp151, [XBLOCK, RBLOCK])
        tmp154 = _tmp153 + tmp152
        _tmp153 = tl.where(rmask & xmask, tmp154, _tmp153)
        tmp157 = tmp156 - tmp2
        tmp158 = tl_math.exp(tmp157)
        tmp159 = tmp158 / tmp5
        tmp160 = tmp155 * tmp159
        tmp161 = tl.broadcast_to(tmp160, [XBLOCK, RBLOCK])
        tmp163 = _tmp162 + tmp161
        _tmp162 = tl.where(rmask & xmask, tmp163, _tmp162)
        tmp166 = tmp165 - tmp2
        tmp167 = tl_math.exp(tmp166)
        tmp168 = tmp167 / tmp5
        tmp169 = tmp164 * tmp168
        tmp170 = tl.broadcast_to(tmp169, [XBLOCK, RBLOCK])
        tmp172 = _tmp171 + tmp170
        _tmp171 = tl.where(rmask & xmask, tmp172, _tmp171)
        tmp175 = tmp174 - tmp2
        tmp176 = tl_math.exp(tmp175)
        tmp177 = tmp176 / tmp5
        tmp178 = tmp173 * tmp177
        tmp179 = tl.broadcast_to(tmp178, [XBLOCK, RBLOCK])
        tmp181 = _tmp180 + tmp179
        _tmp180 = tl.where(rmask & xmask, tmp181, _tmp180)
        tmp184 = tmp183 - tmp2
        tmp185 = tl_math.exp(tmp184)
        tmp186 = tmp185 / tmp5
        tmp187 = tmp182 * tmp186
        tmp188 = tl.broadcast_to(tmp187, [XBLOCK, RBLOCK])
        tmp190 = _tmp189 + tmp188
        _tmp189 = tl.where(rmask & xmask, tmp190, _tmp189)
        tmp193 = tmp192 - tmp2
        tmp194 = tl_math.exp(tmp193)
        tmp195 = tmp194 / tmp5
        tmp196 = tmp191 * tmp195
        tmp197 = tl.broadcast_to(tmp196, [XBLOCK, RBLOCK])
        tmp199 = _tmp198 + tmp197
        _tmp198 = tl.where(rmask & xmask, tmp199, _tmp198)
        tmp202 = tmp201 - tmp2
        tmp203 = tl_math.exp(tmp202)
        tmp204 = tmp203 / tmp5
        tmp205 = tmp200 * tmp204
        tmp206 = tl.broadcast_to(tmp205, [XBLOCK, RBLOCK])
        tmp208 = _tmp207 + tmp206
        _tmp207 = tl.where(rmask & xmask, tmp208, _tmp207)
        tmp211 = tmp210 - tmp2
        tmp212 = tl_math.exp(tmp211)
        tmp213 = tmp212 / tmp5
        tmp214 = tmp209 * tmp213
        tmp215 = tl.broadcast_to(tmp214, [XBLOCK, RBLOCK])
        tmp217 = _tmp216 + tmp215
        _tmp216 = tl.where(rmask & xmask, tmp217, _tmp216)
        tmp220 = tmp219 - tmp2
        tmp221 = tl_math.exp(tmp220)
        tmp222 = tmp221 / tmp5
        tmp223 = tmp218 * tmp222
        tmp224 = tl.broadcast_to(tmp223, [XBLOCK, RBLOCK])
        tmp226 = _tmp225 + tmp224
        _tmp225 = tl.where(rmask & xmask, tmp226, _tmp225)
        tmp229 = tmp228 - tmp2
        tmp230 = tl_math.exp(tmp229)
        tmp231 = tmp230 / tmp5
        tmp232 = tmp227 * tmp231
        tmp233 = tl.broadcast_to(tmp232, [XBLOCK, RBLOCK])
        tmp235 = _tmp234 + tmp233
        _tmp234 = tl.where(rmask & xmask, tmp235, _tmp234)
        tmp238 = tmp237 - tmp2
        tmp239 = tl_math.exp(tmp238)
        tmp240 = tmp239 / tmp5
        tmp241 = tmp236 * tmp240
        tmp242 = tl.broadcast_to(tmp241, [XBLOCK, RBLOCK])
        tmp244 = _tmp243 + tmp242
        _tmp243 = tl.where(rmask & xmask, tmp244, _tmp243)
        tmp247 = tmp246 - tmp2
        tmp248 = tl_math.exp(tmp247)
        tmp249 = tmp248 / tmp5
        tmp250 = tmp245 * tmp249
        tmp251 = tl.broadcast_to(tmp250, [XBLOCK, RBLOCK])
        tmp253 = _tmp252 + tmp251
        _tmp252 = tl.where(rmask & xmask, tmp253, _tmp252)
    tmp9 = tl.sum(_tmp9, 1)[:, None]
    tl.store(out_ptr0 + x3, tmp9, xmask)
    tmp18 = tl.sum(_tmp18, 1)[:, None]
    tl.store(out_ptr1 + x3, tmp18, xmask)
    tmp27 = tl.sum(_tmp27, 1)[:, None]
    tl.store(out_ptr2 + x3, tmp27, xmask)
    tmp36 = tl.sum(_tmp36, 1)[:, None]
    tl.store(out_ptr3 + x3, tmp36, xmask)
    tmp45 = tl.sum(_tmp45, 1)[:, None]
    tl.store(out_ptr4 + x3, tmp45, xmask)
    tmp54 = tl.sum(_tmp54, 1)[:, None]
    tl.store(out_ptr5 + x3, tmp54, xmask)
    tmp63 = tl.sum(_tmp63, 1)[:, None]
    tl.store(out_ptr6 + x3, tmp63, xmask)
    tmp72 = tl.sum(_tmp72, 1)[:, None]
    tl.store(out_ptr7 + x3, tmp72, xmask)
    tmp81 = tl.sum(_tmp81, 1)[:, None]
    tl.store(out_ptr8 + x3, tmp81, xmask)
    tmp90 = tl.sum(_tmp90, 1)[:, None]
    tl.store(out_ptr9 + x3, tmp90, xmask)
    tmp99 = tl.sum(_tmp99, 1)[:, None]
    tl.store(out_ptr10 + x3, tmp99, xmask)
    tmp108 = tl.sum(_tmp108, 1)[:, None]
    tl.store(out_ptr11 + x3, tmp108, xmask)
    tmp117 = tl.sum(_tmp117, 1)[:, None]
    tl.store(out_ptr12 + x3, tmp117, xmask)
    tmp126 = tl.sum(_tmp126, 1)[:, None]
    tl.store(out_ptr13 + x3, tmp126, xmask)
    tmp135 = tl.sum(_tmp135, 1)[:, None]
    tl.store(out_ptr14 + x3, tmp135, xmask)
    tmp144 = tl.sum(_tmp144, 1)[:, None]
    tl.store(out_ptr15 + x3, tmp144, xmask)
    tmp153 = tl.sum(_tmp153, 1)[:, None]
    tl.store(out_ptr16 + x3, tmp153, xmask)
    tmp162 = tl.sum(_tmp162, 1)[:, None]
    tl.store(out_ptr17 + x3, tmp162, xmask)
    tmp171 = tl.sum(_tmp171, 1)[:, None]
    tl.store(out_ptr18 + x3, tmp171, xmask)
    tmp180 = tl.sum(_tmp180, 1)[:, None]
    tl.store(out_ptr19 + x3, tmp180, xmask)
    tmp189 = tl.sum(_tmp189, 1)[:, None]
    tl.store(out_ptr20 + x3, tmp189, xmask)
    tmp198 = tl.sum(_tmp198, 1)[:, None]
    tl.store(out_ptr21 + x3, tmp198, xmask)
    tmp207 = tl.sum(_tmp207, 1)[:, None]
    tl.store(out_ptr22 + x3, tmp207, xmask)
    tmp216 = tl.sum(_tmp216, 1)[:, None]
    tl.store(out_ptr23 + x3, tmp216, xmask)
    tmp225 = tl.sum(_tmp225, 1)[:, None]
    tl.store(out_ptr24 + x3, tmp225, xmask)
    tmp234 = tl.sum(_tmp234, 1)[:, None]
    tl.store(out_ptr25 + x3, tmp234, xmask)
    tmp243 = tl.sum(_tmp243, 1)[:, None]
    tl.store(out_ptr26 + x3, tmp243, xmask)
    tmp252 = tl.sum(_tmp252, 1)[:, None]
    tl.store(out_ptr27 + x3, tmp252, xmask)


@triton.jit
def triton_red_fused_mul_sum_5(in_ptr0, in_ptr1, in_ptr2, in_ptr3, in_ptr4,
    in_ptr5, in_ptr6, in_ptr7, in_ptr8, in_ptr9, out_ptr0, out_ptr1,
    out_ptr2, out_ptr3, out_ptr4, out_ptr5, out_ptr6, xnumel, rnumel,
    XBLOCK: tl.constexpr, RBLOCK: tl.constexpr):
    xnumel = 512
    rnumel = 4096
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    rbase = tl.arange(0, RBLOCK)[None, :]
    x3 = xindex
    x1 = xindex // 128
    _tmp9 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp18 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp27 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp36 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp45 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp54 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    _tmp63 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    for roffset in range(0, rnumel, RBLOCK):
        rindex = roffset + rbase
        rmask = rindex < rnumel
        r2 = rindex
        tmp0 = tl.load(in_ptr0 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp1 = tl.load(in_ptr1 + (233472 + r2 + 262144 * x1), rmask & xmask,
            eviction_policy='evict_last', other=0.0)
        tmp2 = tl.load(in_ptr2 + (r2 + 4096 * x1), rmask & xmask,
            eviction_policy='evict_last', other=0.0)
        tmp5 = tl.load(in_ptr3 + (r2 + 4096 * x1), rmask & xmask,
            eviction_policy='evict_last', other=0.0)
        tmp11 = tl.load(in_ptr4 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp12 = tl.load(in_ptr1 + (237568 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp20 = tl.load(in_ptr5 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp21 = tl.load(in_ptr1 + (241664 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp29 = tl.load(in_ptr6 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp30 = tl.load(in_ptr1 + (245760 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp38 = tl.load(in_ptr7 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp39 = tl.load(in_ptr1 + (249856 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp47 = tl.load(in_ptr8 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp48 = tl.load(in_ptr1 + (253952 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp56 = tl.load(in_ptr9 + (r2 + 4096 * x3), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp57 = tl.load(in_ptr1 + (258048 + r2 + 262144 * x1), rmask &
            xmask, eviction_policy='evict_last', other=0.0)
        tmp3 = tmp1 - tmp2
        tmp4 = tl_math.exp(tmp3)
        tmp6 = tmp4 / tmp5
        tmp7 = tmp0 * tmp6
        tmp8 = tl.broadcast_to(tmp7, [XBLOCK, RBLOCK])
        tmp10 = _tmp9 + tmp8
        _tmp9 = tl.where(rmask & xmask, tmp10, _tmp9)
        tmp13 = tmp12 - tmp2
        tmp14 = tl_math.exp(tmp13)
        tmp15 = tmp14 / tmp5
        tmp16 = tmp11 * tmp15
        tmp17 = tl.broadcast_to(tmp16, [XBLOCK, RBLOCK])
        tmp19 = _tmp18 + tmp17
        _tmp18 = tl.where(rmask & xmask, tmp19, _tmp18)
        tmp22 = tmp21 - tmp2
        tmp23 = tl_math.exp(tmp22)
        tmp24 = tmp23 / tmp5
        tmp25 = tmp20 * tmp24
        tmp26 = tl.broadcast_to(tmp25, [XBLOCK, RBLOCK])
        tmp28 = _tmp27 + tmp26
        _tmp27 = tl.where(rmask & xmask, tmp28, _tmp27)
        tmp31 = tmp30 - tmp2
        tmp32 = tl_math.exp(tmp31)
        tmp33 = tmp32 / tmp5
        tmp34 = tmp29 * tmp33
        tmp35 = tl.broadcast_to(tmp34, [XBLOCK, RBLOCK])
        tmp37 = _tmp36 + tmp35
        _tmp36 = tl.where(rmask & xmask, tmp37, _tmp36)
        tmp40 = tmp39 - tmp2
        tmp41 = tl_math.exp(tmp40)
        tmp42 = tmp41 / tmp5
        tmp43 = tmp38 * tmp42
        tmp44 = tl.broadcast_to(tmp43, [XBLOCK, RBLOCK])
        tmp46 = _tmp45 + tmp44
        _tmp45 = tl.where(rmask & xmask, tmp46, _tmp45)
        tmp49 = tmp48 - tmp2
        tmp50 = tl_math.exp(tmp49)
        tmp51 = tmp50 / tmp5
        tmp52 = tmp47 * tmp51
        tmp53 = tl.broadcast_to(tmp52, [XBLOCK, RBLOCK])
        tmp55 = _tmp54 + tmp53
        _tmp54 = tl.where(rmask & xmask, tmp55, _tmp54)
        tmp58 = tmp57 - tmp2
        tmp59 = tl_math.exp(tmp58)
        tmp60 = tmp59 / tmp5
        tmp61 = tmp56 * tmp60
        tmp62 = tl.broadcast_to(tmp61, [XBLOCK, RBLOCK])
        tmp64 = _tmp63 + tmp62
        _tmp63 = tl.where(rmask & xmask, tmp64, _tmp63)
    tmp9 = tl.sum(_tmp9, 1)[:, None]
    tl.store(out_ptr0 + x3, tmp9, xmask)
    tmp18 = tl.sum(_tmp18, 1)[:, None]
    tl.store(out_ptr1 + x3, tmp18, xmask)
    tmp27 = tl.sum(_tmp27, 1)[:, None]
    tl.store(out_ptr2 + x3, tmp27, xmask)
    tmp36 = tl.sum(_tmp36, 1)[:, None]
    tl.store(out_ptr3 + x3, tmp36, xmask)
    tmp45 = tl.sum(_tmp45, 1)[:, None]
    tl.store(out_ptr4 + x3, tmp45, xmask)
    tmp54 = tl.sum(_tmp54, 1)[:, None]
    tl.store(out_ptr5 + x3, tmp54, xmask)
    tmp63 = tl.sum(_tmp63, 1)[:, None]
    tl.store(out_ptr6 + x3, tmp63, xmask)


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


@triton.jit
def triton_red_fused_div_linalg_vector_norm_7(in_out_ptr0, in_ptr0, in_ptr1,
    out_ptr0, xnumel, rnumel, XBLOCK: tl.constexpr, RBLOCK: tl.constexpr):
    xnumel = 4
    rnumel = 8192
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    rbase = tl.arange(0, RBLOCK)[None, :]
    x0 = xindex
    _tmp7 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    for roffset in range(0, rnumel, RBLOCK):
        rindex = roffset + rbase
        rmask = rindex < rnumel
        r1 = rindex
        tmp0 = tl.load(in_ptr0 + (r1 + 8192 * x0), rmask & xmask,
            eviction_policy='evict_last', other=0.0)
        tmp1 = tl.load(in_ptr1 + (64 * x0 + r1 // 128), rmask & xmask,
            eviction_policy='evict_last', other=0.0)
        tmp2 = 1e-12
        tmp3 = triton_helpers.maximum(tmp1, tmp2)
        tmp4 = tmp0 / tmp3
        tmp5 = tmp4 * tmp4
        tmp6 = tl.broadcast_to(tmp5, [XBLOCK, RBLOCK])
        tmp8 = _tmp7 + tmp6
        _tmp7 = tl.where(rmask & xmask, tmp8, _tmp7)
    tmp7 = tl.sum(_tmp7, 1)[:, None]
    tmp9 = libdevice.sqrt(tmp7)
    tl.debug_barrier()
    tl.store(in_out_ptr0 + x0, tmp9, xmask)
    for roffset in range(0, rnumel, RBLOCK):
        rindex = roffset + rbase
        rmask = rindex < rnumel
        r1 = rindex
        tmp10 = tl.load(in_ptr0 + (r1 + 8192 * x0), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp11 = tl.load(in_ptr1 + (64 * x0 + r1 // 128), rmask & xmask,
            eviction_policy='evict_last', other=0.0)
        tmp12 = 1e-12
        tmp13 = triton_helpers.maximum(tmp11, tmp12)
        tmp14 = tmp10 / tmp13
        tmp15 = triton_helpers.maximum(tmp9, tmp12)
        tmp16 = tmp14 / tmp15
        tl.store(out_ptr0 + (r1 + 8192 * x0), tmp16, rmask & xmask)


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


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

    def __init__(self, num_clusters=64, dim=128, normalize_input=True,
        vladv2=False):
        """
        Args:
            num_clusters : int
                The number of clusters
            dim : int
                Dimension of descriptors
            alpha : float
                Parameter of initialization. Larger value is harder assignment.
            normalize_input : bool
                If true, descriptor-wise L2 normalization is applied to input.
            vladv2 : bool
                If true, use vladv2 otherwise use vladv1
        """
        super(NetVLADNew, self).__init__()
        self.num_clusters = num_clusters
        self.dim = dim
        self.alpha = 0
        self.vladv2 = vladv2
        self.normalize_input = normalize_input
        self.conv = nn.Conv2d(dim, num_clusters, kernel_size=(1, 1), bias=
            vladv2)
        self.centroids = nn.Parameter(torch.rand(num_clusters, dim))

    def init_params(self, clsts, traindescs):
        if self.vladv2 is False:
            clstsAssign = clsts / np.linalg.norm(clsts, axis=1, keepdims=True)
            dots = np.dot(clstsAssign, traindescs.T)
            dots.sort(0)
            dots = dots[::-1, :]
            self.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(self.alpha *
                clstsAssign).unsqueeze(2).unsqueeze(3))
            self.conv.bias = None
        else:
            knn = NearestNeighbors(n_jobs=-1)
            knn.fit(traindescs)
            del traindescs
            dsSq = np.square(knn.kneighbors(clsts, 2)[1])
            del knn
            self.alpha = (-np.log(0.01) / np.mean(dsSq[:, 1] - dsSq[:, 0])
                ).item()
            self.centroids = nn.Parameter(torch.from_numpy(clsts))
            del clsts, dsSq
            self.conv.weight = nn.Parameter((2.0 * self.alpha * self.
                centroids).unsqueeze(-1).unsqueeze(-1))
            self.conv.bias = nn.Parameter(-self.alpha * self.centroids.norm
                (dim=1))

    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]
