# 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_6/inductor_cache/yq/cyqwuw423ez77uwf6w3fslnus3cyx2u725lvad5i2ijxlswjt456.py
# Topologically Sorted Source Nodes: [matmul, matmul_2, matmul_4, matmul_6, matmul_8, matmul_10, matmul_12, matmul_14, matmul_16, matmul_18, matmul_20, matmul_22, matmul_24, matmul_26, matmul_28, matmul_30], Original ATen: [aten.mv]
# Source node to ATen node mapping:
#   matmul => mul, sum_1
#   matmul_10 => mul_8, sum_6
#   matmul_12 => mul_9, sum_7
#   matmul_14 => mul_10, sum_8
#   matmul_16 => mul_14, sum_9
#   matmul_18 => mul_15, sum_10
#   matmul_2 => mul_1, sum_2
#   matmul_20 => mul_16, sum_11
#   matmul_22 => mul_17, sum_12
#   matmul_24 => mul_21, sum_13
#   matmul_26 => mul_22, sum_14
#   matmul_28 => mul_23, sum_15
#   matmul_30 => mul_24, sum_16
#   matmul_4 => mul_2, sum_3
#   matmul_6 => mul_3, sum_4
#   matmul_8 => mul_7, sum_5
# Graph fragment:
#   %mul : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%primals_3, %select), kwargs = {})
#   %sum_1 : [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 = (%primals_7, %select), kwargs = {})
#   %sum_2 : [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 = (%primals_10, %select), kwargs = {})
#   %sum_3 : [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 = (%primals_13, %select), kwargs = {})
#   %sum_4 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_3, [1]), kwargs = {})
#   %mul_7 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%primals_3, %select_4), kwargs = {})
#   %sum_5 : [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 = (%primals_7, %select_4), kwargs = {})
#   %sum_6 : [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 = (%primals_10, %select_4), kwargs = {})
#   %sum_7 : [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 = (%primals_13, %select_4), kwargs = {})
#   %sum_8 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_10, [1]), kwargs = {})
#   %mul_14 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%primals_3, %select_8), kwargs = {})
#   %sum_9 : [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 = (%primals_7, %select_8), kwargs = {})
#   %sum_10 : [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 = (%primals_10, %select_8), kwargs = {})
#   %sum_11 : [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 = (%primals_13, %select_8), kwargs = {})
#   %sum_12 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_17, [1]), kwargs = {})
#   %mul_21 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%primals_3, %select_12), kwargs = {})
#   %sum_13 : [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 = (%primals_7, %select_12), kwargs = {})
#   %sum_14 : [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 = (%primals_10, %select_12), kwargs = {})
#   %sum_15 : [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 = (%primals_13, %select_12), kwargs = {})
#   %sum_16 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_24, [1]), kwargs = {})
triton_poi_fused_mv_0 = async_compile.triton('triton_poi_fused_mv_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.pointwise(
    size_hints=[4], 
    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: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mv_0', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 32, '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_mv_0(in_ptr0, in_ptr1, in_ptr2, in_ptr3, in_ptr4, out_ptr0, out_ptr1, out_ptr2, out_ptr3, out_ptr4, out_ptr5, out_ptr6, out_ptr7, out_ptr8, out_ptr9, out_ptr10, out_ptr11, out_ptr12, out_ptr13, out_ptr14, out_ptr15, xnumel, XBLOCK : tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + (4*x0), xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr1 + (0))
    tmp2 = tl.broadcast_to(tmp1, [XBLOCK])
    tmp4 = tl.load(in_ptr0 + (1 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr1 + (4))
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK])
    tmp9 = tl.load(in_ptr0 + (2 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp10 = tl.load(in_ptr1 + (8))
    tmp11 = tl.broadcast_to(tmp10, [XBLOCK])
    tmp14 = tl.load(in_ptr0 + (3 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp15 = tl.load(in_ptr1 + (12))
    tmp16 = tl.broadcast_to(tmp15, [XBLOCK])
    tmp19 = tl.load(in_ptr1 + (1))
    tmp20 = tl.broadcast_to(tmp19, [XBLOCK])
    tmp22 = tl.load(in_ptr1 + (5))
    tmp23 = tl.broadcast_to(tmp22, [XBLOCK])
    tmp26 = tl.load(in_ptr1 + (9))
    tmp27 = tl.broadcast_to(tmp26, [XBLOCK])
    tmp30 = tl.load(in_ptr1 + (13))
    tmp31 = tl.broadcast_to(tmp30, [XBLOCK])
    tmp34 = tl.load(in_ptr1 + (2))
    tmp35 = tl.broadcast_to(tmp34, [XBLOCK])
    tmp37 = tl.load(in_ptr1 + (6))
    tmp38 = tl.broadcast_to(tmp37, [XBLOCK])
    tmp41 = tl.load(in_ptr1 + (10))
    tmp42 = tl.broadcast_to(tmp41, [XBLOCK])
    tmp45 = tl.load(in_ptr1 + (14))
    tmp46 = tl.broadcast_to(tmp45, [XBLOCK])
    tmp49 = tl.load(in_ptr1 + (3))
    tmp50 = tl.broadcast_to(tmp49, [XBLOCK])
    tmp52 = tl.load(in_ptr1 + (7))
    tmp53 = tl.broadcast_to(tmp52, [XBLOCK])
    tmp56 = tl.load(in_ptr1 + (11))
    tmp57 = tl.broadcast_to(tmp56, [XBLOCK])
    tmp60 = tl.load(in_ptr1 + (15))
    tmp61 = tl.broadcast_to(tmp60, [XBLOCK])
    tmp64 = tl.load(in_ptr2 + (4*x0), xmask, eviction_policy='evict_last')
    tmp66 = tl.load(in_ptr2 + (1 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp69 = tl.load(in_ptr2 + (2 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp72 = tl.load(in_ptr2 + (3 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp96 = tl.load(in_ptr3 + (4*x0), xmask, eviction_policy='evict_last')
    tmp98 = tl.load(in_ptr3 + (1 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp101 = tl.load(in_ptr3 + (2 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp104 = tl.load(in_ptr3 + (3 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp128 = tl.load(in_ptr4 + (4*x0), xmask, eviction_policy='evict_last')
    tmp130 = tl.load(in_ptr4 + (1 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp133 = tl.load(in_ptr4 + (2 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp136 = tl.load(in_ptr4 + (3 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp3 = tmp0 * tmp2
    tmp7 = tmp4 * tmp6
    tmp8 = tmp3 + tmp7
    tmp12 = tmp9 * tmp11
    tmp13 = tmp8 + tmp12
    tmp17 = tmp14 * tmp16
    tmp18 = tmp13 + tmp17
    tmp21 = tmp0 * tmp20
    tmp24 = tmp4 * tmp23
    tmp25 = tmp21 + tmp24
    tmp28 = tmp9 * tmp27
    tmp29 = tmp25 + tmp28
    tmp32 = tmp14 * tmp31
    tmp33 = tmp29 + tmp32
    tmp36 = tmp0 * tmp35
    tmp39 = tmp4 * tmp38
    tmp40 = tmp36 + tmp39
    tmp43 = tmp9 * tmp42
    tmp44 = tmp40 + tmp43
    tmp47 = tmp14 * tmp46
    tmp48 = tmp44 + tmp47
    tmp51 = tmp0 * tmp50
    tmp54 = tmp4 * tmp53
    tmp55 = tmp51 + tmp54
    tmp58 = tmp9 * tmp57
    tmp59 = tmp55 + tmp58
    tmp62 = tmp14 * tmp61
    tmp63 = tmp59 + tmp62
    tmp65 = tmp64 * tmp2
    tmp67 = tmp66 * tmp6
    tmp68 = tmp65 + tmp67
    tmp70 = tmp69 * tmp11
    tmp71 = tmp68 + tmp70
    tmp73 = tmp72 * tmp16
    tmp74 = tmp71 + tmp73
    tmp75 = tmp64 * tmp20
    tmp76 = tmp66 * tmp23
    tmp77 = tmp75 + tmp76
    tmp78 = tmp69 * tmp27
    tmp79 = tmp77 + tmp78
    tmp80 = tmp72 * tmp31
    tmp81 = tmp79 + tmp80
    tmp82 = tmp64 * tmp35
    tmp83 = tmp66 * tmp38
    tmp84 = tmp82 + tmp83
    tmp85 = tmp69 * tmp42
    tmp86 = tmp84 + tmp85
    tmp87 = tmp72 * tmp46
    tmp88 = tmp86 + tmp87
    tmp89 = tmp64 * tmp50
    tmp90 = tmp66 * tmp53
    tmp91 = tmp89 + tmp90
    tmp92 = tmp69 * tmp57
    tmp93 = tmp91 + tmp92
    tmp94 = tmp72 * tmp61
    tmp95 = tmp93 + tmp94
    tmp97 = tmp96 * tmp2
    tmp99 = tmp98 * tmp6
    tmp100 = tmp97 + tmp99
    tmp102 = tmp101 * tmp11
    tmp103 = tmp100 + tmp102
    tmp105 = tmp104 * tmp16
    tmp106 = tmp103 + tmp105
    tmp107 = tmp96 * tmp20
    tmp108 = tmp98 * tmp23
    tmp109 = tmp107 + tmp108
    tmp110 = tmp101 * tmp27
    tmp111 = tmp109 + tmp110
    tmp112 = tmp104 * tmp31
    tmp113 = tmp111 + tmp112
    tmp114 = tmp96 * tmp35
    tmp115 = tmp98 * tmp38
    tmp116 = tmp114 + tmp115
    tmp117 = tmp101 * tmp42
    tmp118 = tmp116 + tmp117
    tmp119 = tmp104 * tmp46
    tmp120 = tmp118 + tmp119
    tmp121 = tmp96 * tmp50
    tmp122 = tmp98 * tmp53
    tmp123 = tmp121 + tmp122
    tmp124 = tmp101 * tmp57
    tmp125 = tmp123 + tmp124
    tmp126 = tmp104 * tmp61
    tmp127 = tmp125 + tmp126
    tmp129 = tmp128 * tmp2
    tmp131 = tmp130 * tmp6
    tmp132 = tmp129 + tmp131
    tmp134 = tmp133 * tmp11
    tmp135 = tmp132 + tmp134
    tmp137 = tmp136 * tmp16
    tmp138 = tmp135 + tmp137
    tmp139 = tmp128 * tmp20
    tmp140 = tmp130 * tmp23
    tmp141 = tmp139 + tmp140
    tmp142 = tmp133 * tmp27
    tmp143 = tmp141 + tmp142
    tmp144 = tmp136 * tmp31
    tmp145 = tmp143 + tmp144
    tmp146 = tmp128 * tmp35
    tmp147 = tmp130 * tmp38
    tmp148 = tmp146 + tmp147
    tmp149 = tmp133 * tmp42
    tmp150 = tmp148 + tmp149
    tmp151 = tmp136 * tmp46
    tmp152 = tmp150 + tmp151
    tmp153 = tmp128 * tmp50
    tmp154 = tmp130 * tmp53
    tmp155 = tmp153 + tmp154
    tmp156 = tmp133 * tmp57
    tmp157 = tmp155 + tmp156
    tmp158 = tmp136 * tmp61
    tmp159 = tmp157 + tmp158
    tl.store(out_ptr0 + (x0), tmp18, xmask)
    tl.store(out_ptr1 + (x0), tmp33, xmask)
    tl.store(out_ptr2 + (x0), tmp48, xmask)
    tl.store(out_ptr3 + (x0), tmp63, xmask)
    tl.store(out_ptr4 + (x0), tmp74, xmask)
    tl.store(out_ptr5 + (x0), tmp81, xmask)
    tl.store(out_ptr6 + (x0), tmp88, xmask)
    tl.store(out_ptr7 + (x0), tmp95, xmask)
    tl.store(out_ptr8 + (x0), tmp106, xmask)
    tl.store(out_ptr9 + (x0), tmp113, xmask)
    tl.store(out_ptr10 + (x0), tmp120, xmask)
    tl.store(out_ptr11 + (x0), tmp127, xmask)
    tl.store(out_ptr12 + (x0), tmp138, xmask)
    tl.store(out_ptr13 + (x0), tmp145, xmask)
    tl.store(out_ptr14 + (x0), tmp152, xmask)
    tl.store(out_ptr15 + (x0), tmp159, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/cj/ccj7ibskau5v7hw4pezkintmudm3aq3f4rk77cxss22osizkdxmi.py
# Topologically Sorted Source Nodes: [matmul, add, add_1, g_t, matmul_2, add_2, add_3, i_t, matmul_4, add_4, add_5, f_t, matmul_6, add_6, add_7, o_t, mul, mul_1, c_t, tanh_1, h_t], Original ATen: [aten.mv, aten.add, aten.tanh, aten.sigmoid, aten.mul]
# Source node to ATen node mapping:
#   add => add
#   add_1 => add_1
#   add_2 => add_2
#   add_3 => add_3
#   add_4 => add_4
#   add_5 => add_5
#   add_6 => add_6
#   add_7 => add_7
#   c_t => add_8
#   f_t => sigmoid_1
#   g_t => tanh
#   h_t => mul_6
#   i_t => sigmoid
#   matmul => mul, sum_1
#   matmul_2 => mul_1, sum_2
#   matmul_4 => mul_2, sum_3
#   matmul_6 => mul_3, sum_4
#   mul => mul_4
#   mul_1 => mul_5
#   o_t => sigmoid_2
#   tanh_1 => tanh_1
# Graph fragment:
#   %mul : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%primals_3, %select), kwargs = {})
#   %sum_1 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul, [1]), kwargs = {})
#   %add : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%sum_1, %mm), kwargs = {})
#   %add_1 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%add, %primals_6), kwargs = {})
#   %tanh : [num_users=1] = call_function[target=torch.ops.aten.tanh.default](args = (%add_1,), kwargs = {})
#   %mul_1 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%primals_7, %select), kwargs = {})
#   %sum_2 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_1, [1]), kwargs = {})
#   %add_2 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%sum_2, %mm_1), kwargs = {})
#   %add_3 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%add_2, %primals_9), kwargs = {})
#   %sigmoid : [num_users=1] = call_function[target=torch.ops.aten.sigmoid.default](args = (%add_3,), kwargs = {})
#   %mul_2 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%primals_10, %select), kwargs = {})
#   %sum_3 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_2, [1]), kwargs = {})
#   %add_4 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%sum_3, %mm_2), kwargs = {})
#   %add_5 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%add_4, %primals_12), kwargs = {})
#   %sigmoid_1 : [num_users=1] = call_function[target=torch.ops.aten.sigmoid.default](args = (%add_5,), kwargs = {})
#   %mul_3 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%primals_13, %select), kwargs = {})
#   %sum_4 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_3, [1]), kwargs = {})
#   %add_6 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%sum_4, %mm_3), kwargs = {})
#   %add_7 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%add_6, %primals_15), kwargs = {})
#   %sigmoid_2 : [num_users=1] = call_function[target=torch.ops.aten.sigmoid.default](args = (%add_7,), kwargs = {})
#   %mul_4 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%tanh, %sigmoid), kwargs = {})
#   %mul_5 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%primals_2, %sigmoid_1), kwargs = {})
#   %add_8 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%mul_4, %mul_5), kwargs = {})
#   %tanh_1 : [num_users=1] = call_function[target=torch.ops.aten.tanh.default](args = (%add_8,), kwargs = {})
#   %mul_6 : [num_users=5] = call_function[target=torch.ops.aten.mul.Tensor](args = (%tanh_1, %sigmoid_2), kwargs = {})
triton_poi_fused_add_mul_mv_sigmoid_tanh_1 = async_compile.triton('triton_poi_fused_add_mul_mv_sigmoid_tanh_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=[16], 
    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: '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), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_mul_mv_sigmoid_tanh_1', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 13, '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_add_mul_mv_sigmoid_tanh_1(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, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr):
    xnumel = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 4
    x1 = (xindex // 4)
    x2 = xindex
    tmp0 = tl.load(in_ptr0 + (x0), xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr1 + (x1), xmask, eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr2 + (x1), xmask, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr3 + (x0), xmask, eviction_policy='evict_last')
    tmp7 = tl.load(in_ptr4 + (x1), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr5 + (x1), xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr6 + (x1), xmask, eviction_policy='evict_last')
    tmp14 = tl.load(in_ptr7 + (x0), xmask, eviction_policy='evict_last')
    tmp15 = tl.load(in_ptr8 + (x1), xmask, eviction_policy='evict_last')
    tmp17 = tl.load(in_ptr9 + (x1), xmask, eviction_policy='evict_last')
    tmp23 = tl.load(in_ptr10 + (x0), xmask, eviction_policy='evict_last')
    tmp24 = tl.load(in_ptr11 + (x1), xmask, eviction_policy='evict_last')
    tmp26 = tl.load(in_ptr12 + (x1), xmask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp4 = tmp2 + tmp3
    tmp5 = libdevice.tanh(tmp4)
    tmp8 = tmp6 + tmp7
    tmp10 = tmp8 + tmp9
    tmp11 = tl.sigmoid(tmp10)
    tmp12 = tmp5 * tmp11
    tmp16 = tmp14 + tmp15
    tmp18 = tmp16 + tmp17
    tmp19 = tl.sigmoid(tmp18)
    tmp20 = tmp13 * tmp19
    tmp21 = tmp12 + tmp20
    tmp22 = libdevice.tanh(tmp21)
    tmp25 = tmp23 + tmp24
    tmp27 = tmp25 + tmp26
    tmp28 = tl.sigmoid(tmp27)
    tmp29 = tmp22 * tmp28
    tl.store(out_ptr0 + (x2), tmp21, xmask)
    tl.store(out_ptr1 + (x2), tmp29, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/ky/ckytpgyuy3thu3tnd4vv6dduuwd72dfjt6nprs3fhrpj2mxtjdbm.py
# Topologically Sorted Source Nodes: [matmul_8, add_9, add_10, g_t_1, matmul_10, add_11, add_12, i_t_1, matmul_12, add_13, add_14, f_t_1, matmul_14, add_15, add_16, o_t_1, mul_3, mul_4, c_t_1, tanh_3, h_t_1], Original ATen: [aten.mv, aten.add, aten.tanh, aten.sigmoid, aten.mul]
# Source node to ATen node mapping:
#   add_10 => add_10
#   add_11 => add_11
#   add_12 => add_12
#   add_13 => add_13
#   add_14 => add_14
#   add_15 => add_15
#   add_16 => add_16
#   add_9 => add_9
#   c_t_1 => add_17
#   f_t_1 => sigmoid_4
#   g_t_1 => tanh_2
#   h_t_1 => mul_13
#   i_t_1 => sigmoid_3
#   matmul_10 => mul_8, sum_6
#   matmul_12 => mul_9, sum_7
#   matmul_14 => mul_10, sum_8
#   matmul_8 => mul_7, sum_5
#   mul_3 => mul_11
#   mul_4 => mul_12
#   o_t_1 => sigmoid_5
#   tanh_3 => tanh_3
# Graph fragment:
#   %mul_7 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%primals_3, %select_4), kwargs = {})
#   %sum_5 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_7, [1]), kwargs = {})
#   %add_9 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%sum_5, %mm_4), kwargs = {})
#   %add_10 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%add_9, %primals_6), kwargs = {})
#   %tanh_2 : [num_users=1] = call_function[target=torch.ops.aten.tanh.default](args = (%add_10,), kwargs = {})
#   %mul_8 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%primals_7, %select_4), kwargs = {})
#   %sum_6 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_8, [1]), kwargs = {})
#   %add_11 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%sum_6, %mm_5), kwargs = {})
#   %add_12 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%add_11, %primals_9), kwargs = {})
#   %sigmoid_3 : [num_users=1] = call_function[target=torch.ops.aten.sigmoid.default](args = (%add_12,), kwargs = {})
#   %mul_9 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%primals_10, %select_4), kwargs = {})
#   %sum_7 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_9, [1]), kwargs = {})
#   %add_13 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%sum_7, %mm_6), kwargs = {})
#   %add_14 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%add_13, %primals_12), kwargs = {})
#   %sigmoid_4 : [num_users=1] = call_function[target=torch.ops.aten.sigmoid.default](args = (%add_14,), kwargs = {})
#   %mul_10 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%primals_13, %select_4), kwargs = {})
#   %sum_8 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_10, [1]), kwargs = {})
#   %add_15 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%sum_8, %mm_7), kwargs = {})
#   %add_16 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%add_15, %primals_15), kwargs = {})
#   %sigmoid_5 : [num_users=1] = call_function[target=torch.ops.aten.sigmoid.default](args = (%add_16,), kwargs = {})
#   %mul_11 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%tanh_2, %sigmoid_3), kwargs = {})
#   %mul_12 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%add_8, %sigmoid_4), kwargs = {})
#   %add_17 : [num_users=3] = call_function[target=torch.ops.aten.add.Tensor](args = (%mul_11, %mul_12), kwargs = {})
#   %tanh_3 : [num_users=1] = call_function[target=torch.ops.aten.tanh.default](args = (%add_17,), kwargs = {})
#   %mul_13 : [num_users=5] = call_function[target=torch.ops.aten.mul.Tensor](args = (%tanh_3, %sigmoid_5), kwargs = {})
triton_poi_fused_add_mul_mv_sigmoid_tanh_2 = async_compile.triton('triton_poi_fused_add_mul_mv_sigmoid_tanh_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.pointwise(
    size_hints=[16], 
    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: '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), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_mul_mv_sigmoid_tanh_2', 'mutated_arg_names': ['in_out_ptr0'], 'no_x_dim': False, 'num_load': 13, '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_add_mul_mv_sigmoid_tanh_2(in_out_ptr0, in_ptr0, in_ptr1, in_ptr2, in_ptr3, in_ptr4, in_ptr5, in_ptr6, in_ptr7, in_ptr8, in_ptr9, in_ptr10, in_ptr11, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 4
    x2 = xindex
    x1 = (xindex // 4)
    tmp0 = tl.load(in_ptr0 + (x0), xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr1 + (x2), xmask)
    tmp3 = tl.load(in_ptr2 + (x1), xmask, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr3 + (x0), xmask, eviction_policy='evict_last')
    tmp7 = tl.load(in_ptr4 + (x2), xmask)
    tmp9 = tl.load(in_ptr5 + (x1), xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_out_ptr0 + (x2), xmask)
    tmp14 = tl.load(in_ptr6 + (x0), xmask, eviction_policy='evict_last')
    tmp15 = tl.load(in_ptr7 + (x2), xmask)
    tmp17 = tl.load(in_ptr8 + (x1), xmask, eviction_policy='evict_last')
    tmp23 = tl.load(in_ptr9 + (x0), xmask, eviction_policy='evict_last')
    tmp24 = tl.load(in_ptr10 + (x2), xmask)
    tmp26 = tl.load(in_ptr11 + (x1), xmask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp4 = tmp2 + tmp3
    tmp5 = libdevice.tanh(tmp4)
    tmp8 = tmp6 + tmp7
    tmp10 = tmp8 + tmp9
    tmp11 = tl.sigmoid(tmp10)
    tmp12 = tmp5 * tmp11
    tmp16 = tmp14 + tmp15
    tmp18 = tmp16 + tmp17
    tmp19 = tl.sigmoid(tmp18)
    tmp20 = tmp13 * tmp19
    tmp21 = tmp12 + tmp20
    tmp22 = libdevice.tanh(tmp21)
    tmp25 = tmp23 + tmp24
    tmp27 = tmp25 + tmp26
    tmp28 = tl.sigmoid(tmp27)
    tmp29 = tmp22 * tmp28
    tl.store(in_out_ptr0 + (x2), tmp21, xmask)
    tl.store(out_ptr0 + (x2), tmp29, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/4n/c4n4xwkgnc6bupibp6fgulwliufexzfbh475qho4dizfkudweotu.py
# Topologically Sorted Source Nodes: [matmul_16, add_18, add_19, g_t_2, matmul_18, add_20, add_21, i_t_2, matmul_20, add_22, add_23, f_t_2, matmul_22, add_24, add_25, o_t_2, mul_6, mul_7, c_t_2, tanh_5, h_t_2], Original ATen: [aten.mv, aten.add, aten.tanh, aten.sigmoid, aten.mul]
# Source node to ATen node mapping:
#   add_18 => add_18
#   add_19 => add_19
#   add_20 => add_20
#   add_21 => add_21
#   add_22 => add_22
#   add_23 => add_23
#   add_24 => add_24
#   add_25 => add_25
#   c_t_2 => add_26
#   f_t_2 => sigmoid_7
#   g_t_2 => tanh_4
#   h_t_2 => mul_20
#   i_t_2 => sigmoid_6
#   matmul_16 => mul_14, sum_9
#   matmul_18 => mul_15, sum_10
#   matmul_20 => mul_16, sum_11
#   matmul_22 => mul_17, sum_12
#   mul_6 => mul_18
#   mul_7 => mul_19
#   o_t_2 => sigmoid_8
#   tanh_5 => tanh_5
# Graph fragment:
#   %mul_14 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%primals_3, %select_8), kwargs = {})
#   %sum_9 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_14, [1]), kwargs = {})
#   %add_18 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%sum_9, %mm_8), kwargs = {})
#   %add_19 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%add_18, %primals_6), kwargs = {})
#   %tanh_4 : [num_users=1] = call_function[target=torch.ops.aten.tanh.default](args = (%add_19,), kwargs = {})
#   %mul_15 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%primals_7, %select_8), kwargs = {})
#   %sum_10 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_15, [1]), kwargs = {})
#   %add_20 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%sum_10, %mm_9), kwargs = {})
#   %add_21 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%add_20, %primals_9), kwargs = {})
#   %sigmoid_6 : [num_users=1] = call_function[target=torch.ops.aten.sigmoid.default](args = (%add_21,), kwargs = {})
#   %mul_16 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%primals_10, %select_8), kwargs = {})
#   %sum_11 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_16, [1]), kwargs = {})
#   %add_22 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%sum_11, %mm_10), kwargs = {})
#   %add_23 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%add_22, %primals_12), kwargs = {})
#   %sigmoid_7 : [num_users=1] = call_function[target=torch.ops.aten.sigmoid.default](args = (%add_23,), kwargs = {})
#   %mul_17 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%primals_13, %select_8), kwargs = {})
#   %sum_12 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_17, [1]), kwargs = {})
#   %add_24 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%sum_12, %mm_11), kwargs = {})
#   %add_25 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%add_24, %primals_15), kwargs = {})
#   %sigmoid_8 : [num_users=1] = call_function[target=torch.ops.aten.sigmoid.default](args = (%add_25,), kwargs = {})
#   %mul_18 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%tanh_4, %sigmoid_6), kwargs = {})
#   %mul_19 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%add_17, %sigmoid_7), kwargs = {})
#   %add_26 : [num_users=3] = call_function[target=torch.ops.aten.add.Tensor](args = (%mul_18, %mul_19), kwargs = {})
#   %tanh_5 : [num_users=1] = call_function[target=torch.ops.aten.tanh.default](args = (%add_26,), kwargs = {})
#   %mul_20 : [num_users=5] = call_function[target=torch.ops.aten.mul.Tensor](args = (%tanh_5, %sigmoid_8), kwargs = {})
triton_poi_fused_add_mul_mv_sigmoid_tanh_3 = async_compile.triton('triton_poi_fused_add_mul_mv_sigmoid_tanh_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.pointwise(
    size_hints=[16], 
    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: '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), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_mul_mv_sigmoid_tanh_3', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 13, '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_add_mul_mv_sigmoid_tanh_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, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr):
    xnumel = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 4
    x2 = xindex
    x1 = (xindex // 4)
    tmp0 = tl.load(in_ptr0 + (x0), xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr1 + (x2), xmask)
    tmp3 = tl.load(in_ptr2 + (x1), xmask, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr3 + (x0), xmask, eviction_policy='evict_last')
    tmp7 = tl.load(in_ptr4 + (x2), xmask)
    tmp9 = tl.load(in_ptr5 + (x1), xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr6 + (x2), xmask)
    tmp14 = tl.load(in_ptr7 + (x0), xmask, eviction_policy='evict_last')
    tmp15 = tl.load(in_ptr8 + (x2), xmask)
    tmp17 = tl.load(in_ptr9 + (x1), xmask, eviction_policy='evict_last')
    tmp23 = tl.load(in_ptr10 + (x0), xmask, eviction_policy='evict_last')
    tmp24 = tl.load(in_ptr11 + (x2), xmask)
    tmp26 = tl.load(in_ptr12 + (x1), xmask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp4 = tmp2 + tmp3
    tmp5 = libdevice.tanh(tmp4)
    tmp8 = tmp6 + tmp7
    tmp10 = tmp8 + tmp9
    tmp11 = tl.sigmoid(tmp10)
    tmp12 = tmp5 * tmp11
    tmp16 = tmp14 + tmp15
    tmp18 = tmp16 + tmp17
    tmp19 = tl.sigmoid(tmp18)
    tmp20 = tmp13 * tmp19
    tmp21 = tmp12 + tmp20
    tmp22 = libdevice.tanh(tmp21)
    tmp25 = tmp23 + tmp24
    tmp27 = tmp25 + tmp26
    tmp28 = tl.sigmoid(tmp27)
    tmp29 = tmp22 * tmp28
    tl.store(out_ptr0 + (x2), tmp21, xmask)
    tl.store(out_ptr1 + (x2), tmp29, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/4z/c4zbjn2uiqgzzxararkrcjsoluzfrhtjkkp6borjpdjra3jzima5.py
# Topologically Sorted Source Nodes: [matmul_24, add_27, add_28, g_t_3, matmul_26, add_29, add_30, i_t_3, matmul_28, add_31, add_32, f_t_3, matmul_30, add_33, add_34, o_t_3, mul_9, mul_10, c_t_3, tanh_7, h_t_3], Original ATen: [aten.mv, aten.add, aten.tanh, aten.sigmoid, aten.mul]
# Source node to ATen node mapping:
#   add_27 => add_27
#   add_28 => add_28
#   add_29 => add_29
#   add_30 => add_30
#   add_31 => add_31
#   add_32 => add_32
#   add_33 => add_33
#   add_34 => add_34
#   c_t_3 => add_35
#   f_t_3 => sigmoid_10
#   g_t_3 => tanh_6
#   h_t_3 => mul_27
#   i_t_3 => sigmoid_9
#   matmul_24 => mul_21, sum_13
#   matmul_26 => mul_22, sum_14
#   matmul_28 => mul_23, sum_15
#   matmul_30 => mul_24, sum_16
#   mul_10 => mul_26
#   mul_9 => mul_25
#   o_t_3 => sigmoid_11
#   tanh_7 => tanh_7
# Graph fragment:
#   %mul_21 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%primals_3, %select_12), kwargs = {})
#   %sum_13 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_21, [1]), kwargs = {})
#   %add_27 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%sum_13, %mm_12), kwargs = {})
#   %add_28 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%add_27, %primals_6), kwargs = {})
#   %tanh_6 : [num_users=1] = call_function[target=torch.ops.aten.tanh.default](args = (%add_28,), kwargs = {})
#   %mul_22 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%primals_7, %select_12), kwargs = {})
#   %sum_14 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_22, [1]), kwargs = {})
#   %add_29 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%sum_14, %mm_13), kwargs = {})
#   %add_30 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%add_29, %primals_9), kwargs = {})
#   %sigmoid_9 : [num_users=1] = call_function[target=torch.ops.aten.sigmoid.default](args = (%add_30,), kwargs = {})
#   %mul_23 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%primals_10, %select_12), kwargs = {})
#   %sum_15 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_23, [1]), kwargs = {})
#   %add_31 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%sum_15, %mm_14), kwargs = {})
#   %add_32 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%add_31, %primals_12), kwargs = {})
#   %sigmoid_10 : [num_users=1] = call_function[target=torch.ops.aten.sigmoid.default](args = (%add_32,), kwargs = {})
#   %mul_24 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%primals_13, %select_12), kwargs = {})
#   %sum_16 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_24, [1]), kwargs = {})
#   %add_33 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%sum_16, %mm_15), kwargs = {})
#   %add_34 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%add_33, %primals_15), kwargs = {})
#   %sigmoid_11 : [num_users=1] = call_function[target=torch.ops.aten.sigmoid.default](args = (%add_34,), kwargs = {})
#   %mul_25 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%tanh_6, %sigmoid_9), kwargs = {})
#   %mul_26 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%add_26, %sigmoid_10), kwargs = {})
#   %add_35 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%mul_25, %mul_26), kwargs = {})
#   %tanh_7 : [num_users=2] = call_function[target=torch.ops.aten.tanh.default](args = (%add_35,), kwargs = {})
#   %mul_27 : [num_users=2] = call_function[target=torch.ops.aten.mul.Tensor](args = (%tanh_7, %sigmoid_11), kwargs = {})
triton_poi_fused_add_mul_mv_sigmoid_tanh_4 = async_compile.triton('triton_poi_fused_add_mul_mv_sigmoid_tanh_4', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

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

@triton_heuristics.pointwise(
    size_hints=[16], 
    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: '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), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_mul_mv_sigmoid_tanh_4', 'mutated_arg_names': ['in_out_ptr0'], 'no_x_dim': False, 'num_load': 13, '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_add_mul_mv_sigmoid_tanh_4(in_out_ptr0, in_ptr0, in_ptr1, in_ptr2, in_ptr3, in_ptr4, in_ptr5, in_ptr6, in_ptr7, in_ptr8, in_ptr9, in_ptr10, in_ptr11, in_ptr12, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 4
    x2 = xindex
    x1 = (xindex // 4)
    tmp0 = tl.load(in_ptr0 + (x0), xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr1 + (x2), xmask)
    tmp3 = tl.load(in_ptr2 + (x1), xmask, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr3 + (x0), xmask, eviction_policy='evict_last')
    tmp7 = tl.load(in_ptr4 + (x2), xmask)
    tmp9 = tl.load(in_ptr5 + (x1), xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr6 + (x2), xmask)
    tmp14 = tl.load(in_ptr7 + (x0), xmask, eviction_policy='evict_last')
    tmp15 = tl.load(in_ptr8 + (x2), xmask)
    tmp17 = tl.load(in_ptr9 + (x1), xmask, eviction_policy='evict_last')
    tmp23 = tl.load(in_ptr10 + (x0), xmask, eviction_policy='evict_last')
    tmp24 = tl.load(in_ptr11 + (x2), xmask)
    tmp26 = tl.load(in_ptr12 + (x1), xmask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp4 = tmp2 + tmp3
    tmp5 = libdevice.tanh(tmp4)
    tmp8 = tmp6 + tmp7
    tmp10 = tmp8 + tmp9
    tmp11 = tl.sigmoid(tmp10)
    tmp12 = tmp5 * tmp11
    tmp16 = tmp14 + tmp15
    tmp18 = tmp16 + tmp17
    tmp19 = tl.sigmoid(tmp18)
    tmp20 = tmp13 * tmp19
    tmp21 = tmp12 + tmp20
    tmp22 = libdevice.tanh(tmp21)
    tmp25 = tmp23 + tmp24
    tmp27 = tmp25 + tmp26
    tmp28 = tl.sigmoid(tmp27)
    tmp29 = tmp22 * tmp28
    tl.store(in_out_ptr0 + (x2), tmp22, xmask)
    tl.store(out_ptr0 + (x2), tmp29, xmask)
''', device_str='cuda')


async_compile.wait(globals())
del async_compile

def call(args):
    primals_1, primals_2, primals_3, primals_4, primals_5, primals_6, primals_7, primals_8, primals_9, primals_10, primals_11, primals_12, primals_13, primals_14, primals_15, primals_16, primals_17 = args
    args.clear()
    assert_size_stride(primals_1, (4, 1), (1, 1))
    assert_size_stride(primals_2, (4, 1), (1, 1))
    assert_size_stride(primals_3, (4, 4), (4, 1))
    assert_size_stride(primals_4, (4, 4), (4, 1))
    assert_size_stride(primals_5, (4, 4), (4, 1))
    assert_size_stride(primals_6, (4, 1), (1, 1))
    assert_size_stride(primals_7, (4, 4), (4, 1))
    assert_size_stride(primals_8, (4, 4), (4, 1))
    assert_size_stride(primals_9, (4, 1), (1, 1))
    assert_size_stride(primals_10, (4, 4), (4, 1))
    assert_size_stride(primals_11, (4, 4), (4, 1))
    assert_size_stride(primals_12, (4, 1), (1, 1))
    assert_size_stride(primals_13, (4, 4), (4, 1))
    assert_size_stride(primals_14, (4, 4), (4, 1))
    assert_size_stride(primals_15, (4, 1), (1, 1))
    assert_size_stride(primals_16, (4, 4), (4, 1))
    assert_size_stride(primals_17, (4, 1), (1, 1))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = empty_strided_cuda((4, 1), (1, 1), torch.float32)
        # Topologically Sorted Source Nodes: [matmul_1], Original ATen: [aten.mm]
        extern_kernels.mm(primals_5, primals_1, out=buf0)
        buf1 = empty_strided_cuda((4, ), (1, ), torch.float32)
        buf11 = empty_strided_cuda((4, ), (1, ), torch.float32)
        buf21 = empty_strided_cuda((4, ), (1, ), torch.float32)
        buf31 = empty_strided_cuda((4, ), (1, ), torch.float32)
        buf3 = empty_strided_cuda((4, ), (1, ), torch.float32)
        buf13 = empty_strided_cuda((4, ), (1, ), torch.float32)
        buf23 = empty_strided_cuda((4, ), (1, ), torch.float32)
        buf33 = empty_strided_cuda((4, ), (1, ), torch.float32)
        buf5 = empty_strided_cuda((4, ), (1, ), torch.float32)
        buf15 = empty_strided_cuda((4, ), (1, ), torch.float32)
        buf25 = empty_strided_cuda((4, ), (1, ), torch.float32)
        buf35 = empty_strided_cuda((4, ), (1, ), torch.float32)
        buf7 = empty_strided_cuda((4, ), (1, ), torch.float32)
        buf17 = empty_strided_cuda((4, ), (1, ), torch.float32)
        buf27 = empty_strided_cuda((4, ), (1, ), torch.float32)
        buf37 = empty_strided_cuda((4, ), (1, ), torch.float32)
        # Topologically Sorted Source Nodes: [matmul, matmul_2, matmul_4, matmul_6, matmul_8, matmul_10, matmul_12, matmul_14, matmul_16, matmul_18, matmul_20, matmul_22, matmul_24, matmul_26, matmul_28, matmul_30], Original ATen: [aten.mv]
        stream0 = get_raw_stream(0)
        triton_poi_fused_mv_0.run(primals_3, primals_4, primals_7, primals_10, primals_13, buf1, buf11, buf21, buf31, buf3, buf13, buf23, buf33, buf5, buf15, buf25, buf35, buf7, buf17, buf27, buf37, 4, grid=grid(4), stream=stream0)
        buf2 = empty_strided_cuda((4, 1), (1, 1), torch.float32)
        # Topologically Sorted Source Nodes: [matmul_3], Original ATen: [aten.mm]
        extern_kernels.mm(primals_8, primals_1, out=buf2)
        buf4 = empty_strided_cuda((4, 1), (1, 1), torch.float32)
        # Topologically Sorted Source Nodes: [matmul_5], Original ATen: [aten.mm]
        extern_kernels.mm(primals_11, primals_1, out=buf4)
        buf6 = empty_strided_cuda((4, 1), (1, 1), torch.float32)
        # Topologically Sorted Source Nodes: [matmul_7], Original ATen: [aten.mm]
        extern_kernels.mm(primals_14, primals_1, out=buf6)
        buf8 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        buf9 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [matmul, add, add_1, g_t, matmul_2, add_2, add_3, i_t, matmul_4, add_4, add_5, f_t, matmul_6, add_6, add_7, o_t, mul, mul_1, c_t, tanh_1, h_t], Original ATen: [aten.mv, aten.add, aten.tanh, aten.sigmoid, aten.mul]
        triton_poi_fused_add_mul_mv_sigmoid_tanh_1.run(buf1, buf0, primals_6, buf3, buf2, primals_9, primals_2, buf5, buf4, primals_12, buf7, buf6, primals_15, buf8, buf9, 16, grid=grid(16), stream=stream0)
        del buf1
        del buf3
        del buf5
        del buf7
        buf10 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [matmul_9], Original ATen: [aten.mm]
        extern_kernels.mm(primals_5, buf9, out=buf10)
        buf12 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [matmul_11], Original ATen: [aten.mm]
        extern_kernels.mm(primals_8, buf9, out=buf12)
        buf14 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [matmul_13], Original ATen: [aten.mm]
        extern_kernels.mm(primals_11, buf9, out=buf14)
        buf16 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [matmul_15], Original ATen: [aten.mm]
        extern_kernels.mm(primals_14, buf9, out=buf16)
        buf18 = buf8; del buf8  # reuse
        buf19 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [matmul_8, add_9, add_10, g_t_1, matmul_10, add_11, add_12, i_t_1, matmul_12, add_13, add_14, f_t_1, matmul_14, add_15, add_16, o_t_1, mul_3, mul_4, c_t_1, tanh_3, h_t_1], Original ATen: [aten.mv, aten.add, aten.tanh, aten.sigmoid, aten.mul]
        triton_poi_fused_add_mul_mv_sigmoid_tanh_2.run(buf18, buf11, buf10, primals_6, buf13, buf12, primals_9, buf15, buf14, primals_12, buf17, buf16, primals_15, buf19, 16, grid=grid(16), stream=stream0)
        del buf11
        del buf13
        del buf15
        del buf17
        buf20 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [matmul_17], Original ATen: [aten.mm]
        extern_kernels.mm(primals_5, buf19, out=buf20)
        buf22 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [matmul_19], Original ATen: [aten.mm]
        extern_kernels.mm(primals_8, buf19, out=buf22)
        buf24 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [matmul_21], Original ATen: [aten.mm]
        extern_kernels.mm(primals_11, buf19, out=buf24)
        buf26 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [matmul_23], Original ATen: [aten.mm]
        extern_kernels.mm(primals_14, buf19, out=buf26)
        buf28 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        buf29 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [matmul_16, add_18, add_19, g_t_2, matmul_18, add_20, add_21, i_t_2, matmul_20, add_22, add_23, f_t_2, matmul_22, add_24, add_25, o_t_2, mul_6, mul_7, c_t_2, tanh_5, h_t_2], Original ATen: [aten.mv, aten.add, aten.tanh, aten.sigmoid, aten.mul]
        triton_poi_fused_add_mul_mv_sigmoid_tanh_3.run(buf21, buf20, primals_6, buf23, buf22, primals_9, buf18, buf25, buf24, primals_12, buf27, buf26, primals_15, buf28, buf29, 16, grid=grid(16), stream=stream0)
        del buf21
        del buf23
        del buf25
        del buf27
        buf30 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [matmul_25], Original ATen: [aten.mm]
        extern_kernels.mm(primals_5, buf29, out=buf30)
        buf32 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [matmul_27], Original ATen: [aten.mm]
        extern_kernels.mm(primals_8, buf29, out=buf32)
        buf34 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [matmul_29], Original ATen: [aten.mm]
        extern_kernels.mm(primals_11, buf29, out=buf34)
        buf36 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [matmul_31], Original ATen: [aten.mm]
        extern_kernels.mm(primals_14, buf29, out=buf36)
        buf38 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        buf39 = buf38; del buf38  # reuse
        buf40 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [matmul_24, add_27, add_28, g_t_3, matmul_26, add_29, add_30, i_t_3, matmul_28, add_31, add_32, f_t_3, matmul_30, add_33, add_34, o_t_3, mul_9, mul_10, c_t_3, tanh_7, h_t_3], Original ATen: [aten.mv, aten.add, aten.tanh, aten.sigmoid, aten.mul]
        triton_poi_fused_add_mul_mv_sigmoid_tanh_4.run(buf39, buf31, buf30, primals_6, buf33, buf32, primals_9, buf28, buf35, buf34, primals_12, buf37, buf36, primals_15, buf40, 16, grid=grid(16), stream=stream0)
        del buf31
        del buf33
        del buf35
        del buf37
        buf41 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [matmul_30, add_33, add_34, o_t_3, h_t_3], Original ATen: [aten.mv, aten.add, aten.sigmoid, aten.mul]
        extern_kernels.addmm(primals_17, primals_16, buf40, alpha=1, beta=1, out=buf41)
        del primals_17
    return (reinterpret_tensor(buf41, (4, 4), (1, 4), 0), primals_2, primals_3, primals_4, primals_6, primals_7, primals_9, primals_10, primals_12, primals_13, primals_15, buf0, buf2, buf4, buf6, buf10, buf12, buf14, buf16, buf18, buf20, buf22, buf24, buf26, buf28, buf30, buf32, buf34, buf36, buf39, reinterpret_tensor(primals_16, (4, 4), (1, 4), 0), reinterpret_tensor(buf40, (4, 4), (1, 4), 0), reinterpret_tensor(primals_14, (4, 4), (1, 4), 0), reinterpret_tensor(buf29, (4, 4), (1, 4), 0), reinterpret_tensor(primals_11, (4, 4), (1, 4), 0), reinterpret_tensor(primals_8, (4, 4), (1, 4), 0), reinterpret_tensor(primals_5, (4, 4), (1, 4), 0), reinterpret_tensor(buf19, (4, 4), (1, 4), 0), reinterpret_tensor(buf9, (4, 4), (1, 4), 0), reinterpret_tensor(primals_1, (1, 4), (1, 1), 0), )


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, 1), (1, 1), device='cuda:0', dtype=torch.float32)
    primals_2 = rand_strided((4, 1), (1, 1), device='cuda:0', dtype=torch.float32)
    primals_3 = rand_strided((4, 4), (4, 1), device='cuda:0', dtype=torch.float32)
    primals_4 = rand_strided((4, 4), (4, 1), device='cuda:0', dtype=torch.float32)
    primals_5 = rand_strided((4, 4), (4, 1), device='cuda:0', dtype=torch.float32)
    primals_6 = rand_strided((4, 1), (1, 1), device='cuda:0', dtype=torch.float32)
    primals_7 = rand_strided((4, 4), (4, 1), device='cuda:0', dtype=torch.float32)
    primals_8 = rand_strided((4, 4), (4, 1), device='cuda:0', dtype=torch.float32)
    primals_9 = rand_strided((4, 1), (1, 1), device='cuda:0', dtype=torch.float32)
    primals_10 = rand_strided((4, 4), (4, 1), device='cuda:0', dtype=torch.float32)
    primals_11 = rand_strided((4, 4), (4, 1), device='cuda:0', dtype=torch.float32)
    primals_12 = rand_strided((4, 1), (1, 1), device='cuda:0', dtype=torch.float32)
    primals_13 = rand_strided((4, 4), (4, 1), device='cuda:0', dtype=torch.float32)
    primals_14 = rand_strided((4, 4), (4, 1), device='cuda:0', dtype=torch.float32)
    primals_15 = rand_strided((4, 1), (1, 1), device='cuda:0', dtype=torch.float32)
    primals_16 = rand_strided((4, 4), (4, 1), device='cuda:0', dtype=torch.float32)
    primals_17 = rand_strided((4, 1), (1, 1), device='cuda:0', dtype=torch.float32)
    fn = lambda: call([primals_1, primals_2, primals_3, primals_4, primals_5, primals_6, primals_7, primals_8, primals_9, primals_10, primals_11, primals_12, primals_13, primals_14, primals_15, primals_16, primals_17])
    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 torch.nn as nn


class LSTM(nn.Module):

    def __init__(self, seq_length, input_dim, num_hidden, num_classes,
        batch_size, device='cpu'):
        super(LSTM, self).__init__()
        self.seq_length = seq_length
        self.h_init = nn.Parameter(torch.zeros(num_hidden, 1),
            requires_grad=False)
        self.c_init = nn.Parameter(torch.zeros(num_hidden, 1),
            requires_grad=False)
        self.w_gx = nn.Parameter(nn.init.orthogonal_(torch.Tensor(
            num_hidden, input_dim).normal_(mean=0, std=0.0001)))
        self.w_gh = nn.Parameter(nn.init.orthogonal_(torch.Tensor(
            num_hidden, num_hidden).normal_(mean=0, std=0.0001)))
        self.b_g = nn.Parameter(torch.Tensor(num_hidden, 1).zero_())
        self.w_ix = nn.Parameter(nn.init.orthogonal_(torch.Tensor(
            num_hidden, input_dim).normal_(mean=0, std=0.0001)))
        self.w_ih = nn.Parameter(nn.init.orthogonal_(torch.Tensor(
            num_hidden, num_hidden).normal_(mean=0, std=0.0001)))
        self.b_i = nn.Parameter(torch.Tensor(num_hidden, 1).zero_())
        self.w_fx = nn.Parameter(nn.init.orthogonal_(torch.Tensor(
            num_hidden, input_dim).normal_(mean=0, std=0.0001)))
        self.w_fh = nn.Parameter(nn.init.orthogonal_(torch.Tensor(
            num_hidden, num_hidden).normal_(mean=0, std=0.0001)))
        self.b_f = nn.Parameter(torch.Tensor(num_hidden, 1).zero_())
        self.w_ox = nn.Parameter(nn.init.orthogonal_(torch.Tensor(
            num_hidden, input_dim).normal_(mean=0, std=0.0001)))
        self.w_oh = nn.Parameter(nn.init.orthogonal_(torch.Tensor(
            num_hidden, num_hidden).normal_(mean=0, std=0.0001)))
        self.b_o = nn.Parameter(torch.Tensor(num_hidden, 1).zero_())
        self.w_ph = nn.Parameter(torch.Tensor(num_classes, num_hidden).
            normal_(mean=0, std=0.0001))
        self.b_p = nn.Parameter(torch.Tensor(num_classes, 1).zero_())

    def forward(self, x):
        h_t = self.h_init
        c_t = self.c_init
        tanh = nn.Tanh()
        sigmoid = nn.Sigmoid()
        for step in range(self.seq_length):
            g_t = tanh(self.w_gx @ x[:, step].t() + self.w_gh @ h_t + self.b_g)
            i_t = sigmoid(self.w_ix @ x[:, step].t() + self.w_ih @ h_t +
                self.b_i)
            f_t = sigmoid(self.w_fx @ x[:, step].t() + self.w_fh @ h_t +
                self.b_f)
            o_t = sigmoid(self.w_ox @ x[:, step].t() + self.w_oh @ h_t +
                self.b_o)
            c_t = g_t * i_t + c_t * f_t
            h_t = tanh(c_t) * o_t
        p_t = self.w_ph @ h_t + self.b_p
        return p_t.t()


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


def get_init_inputs():
    return [[], {'seq_length': 4, 'input_dim': 4, 'num_hidden': 4,
        'num_classes': 4, 'batch_size': 4}]

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


@triton.jit
def triton_poi_fused_mv_0(in_ptr0, in_ptr1, in_ptr2, in_ptr3, in_ptr4,
    out_ptr0, out_ptr1, out_ptr2, out_ptr3, out_ptr4, out_ptr5, out_ptr6,
    out_ptr7, out_ptr8, out_ptr9, out_ptr10, out_ptr11, out_ptr12,
    out_ptr13, out_ptr14, out_ptr15, xnumel, XBLOCK: tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr1 + 0)
    tmp2 = tl.broadcast_to(tmp1, [XBLOCK])
    tmp4 = tl.load(in_ptr0 + (1 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr1 + 4)
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK])
    tmp9 = tl.load(in_ptr0 + (2 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp10 = tl.load(in_ptr1 + 8)
    tmp11 = tl.broadcast_to(tmp10, [XBLOCK])
    tmp14 = tl.load(in_ptr0 + (3 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp15 = tl.load(in_ptr1 + 12)
    tmp16 = tl.broadcast_to(tmp15, [XBLOCK])
    tmp19 = tl.load(in_ptr1 + 1)
    tmp20 = tl.broadcast_to(tmp19, [XBLOCK])
    tmp22 = tl.load(in_ptr1 + 5)
    tmp23 = tl.broadcast_to(tmp22, [XBLOCK])
    tmp26 = tl.load(in_ptr1 + 9)
    tmp27 = tl.broadcast_to(tmp26, [XBLOCK])
    tmp30 = tl.load(in_ptr1 + 13)
    tmp31 = tl.broadcast_to(tmp30, [XBLOCK])
    tmp34 = tl.load(in_ptr1 + 2)
    tmp35 = tl.broadcast_to(tmp34, [XBLOCK])
    tmp37 = tl.load(in_ptr1 + 6)
    tmp38 = tl.broadcast_to(tmp37, [XBLOCK])
    tmp41 = tl.load(in_ptr1 + 10)
    tmp42 = tl.broadcast_to(tmp41, [XBLOCK])
    tmp45 = tl.load(in_ptr1 + 14)
    tmp46 = tl.broadcast_to(tmp45, [XBLOCK])
    tmp49 = tl.load(in_ptr1 + 3)
    tmp50 = tl.broadcast_to(tmp49, [XBLOCK])
    tmp52 = tl.load(in_ptr1 + 7)
    tmp53 = tl.broadcast_to(tmp52, [XBLOCK])
    tmp56 = tl.load(in_ptr1 + 11)
    tmp57 = tl.broadcast_to(tmp56, [XBLOCK])
    tmp60 = tl.load(in_ptr1 + 15)
    tmp61 = tl.broadcast_to(tmp60, [XBLOCK])
    tmp64 = tl.load(in_ptr2 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp66 = tl.load(in_ptr2 + (1 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp69 = tl.load(in_ptr2 + (2 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp72 = tl.load(in_ptr2 + (3 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp96 = tl.load(in_ptr3 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp98 = tl.load(in_ptr3 + (1 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp101 = tl.load(in_ptr3 + (2 + 4 * x0), xmask, eviction_policy=
        'evict_last')
    tmp104 = tl.load(in_ptr3 + (3 + 4 * x0), xmask, eviction_policy=
        'evict_last')
    tmp128 = tl.load(in_ptr4 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp130 = tl.load(in_ptr4 + (1 + 4 * x0), xmask, eviction_policy=
        'evict_last')
    tmp133 = tl.load(in_ptr4 + (2 + 4 * x0), xmask, eviction_policy=
        'evict_last')
    tmp136 = tl.load(in_ptr4 + (3 + 4 * x0), xmask, eviction_policy=
        'evict_last')
    tmp3 = tmp0 * tmp2
    tmp7 = tmp4 * tmp6
    tmp8 = tmp3 + tmp7
    tmp12 = tmp9 * tmp11
    tmp13 = tmp8 + tmp12
    tmp17 = tmp14 * tmp16
    tmp18 = tmp13 + tmp17
    tmp21 = tmp0 * tmp20
    tmp24 = tmp4 * tmp23
    tmp25 = tmp21 + tmp24
    tmp28 = tmp9 * tmp27
    tmp29 = tmp25 + tmp28
    tmp32 = tmp14 * tmp31
    tmp33 = tmp29 + tmp32
    tmp36 = tmp0 * tmp35
    tmp39 = tmp4 * tmp38
    tmp40 = tmp36 + tmp39
    tmp43 = tmp9 * tmp42
    tmp44 = tmp40 + tmp43
    tmp47 = tmp14 * tmp46
    tmp48 = tmp44 + tmp47
    tmp51 = tmp0 * tmp50
    tmp54 = tmp4 * tmp53
    tmp55 = tmp51 + tmp54
    tmp58 = tmp9 * tmp57
    tmp59 = tmp55 + tmp58
    tmp62 = tmp14 * tmp61
    tmp63 = tmp59 + tmp62
    tmp65 = tmp64 * tmp2
    tmp67 = tmp66 * tmp6
    tmp68 = tmp65 + tmp67
    tmp70 = tmp69 * tmp11
    tmp71 = tmp68 + tmp70
    tmp73 = tmp72 * tmp16
    tmp74 = tmp71 + tmp73
    tmp75 = tmp64 * tmp20
    tmp76 = tmp66 * tmp23
    tmp77 = tmp75 + tmp76
    tmp78 = tmp69 * tmp27
    tmp79 = tmp77 + tmp78
    tmp80 = tmp72 * tmp31
    tmp81 = tmp79 + tmp80
    tmp82 = tmp64 * tmp35
    tmp83 = tmp66 * tmp38
    tmp84 = tmp82 + tmp83
    tmp85 = tmp69 * tmp42
    tmp86 = tmp84 + tmp85
    tmp87 = tmp72 * tmp46
    tmp88 = tmp86 + tmp87
    tmp89 = tmp64 * tmp50
    tmp90 = tmp66 * tmp53
    tmp91 = tmp89 + tmp90
    tmp92 = tmp69 * tmp57
    tmp93 = tmp91 + tmp92
    tmp94 = tmp72 * tmp61
    tmp95 = tmp93 + tmp94
    tmp97 = tmp96 * tmp2
    tmp99 = tmp98 * tmp6
    tmp100 = tmp97 + tmp99
    tmp102 = tmp101 * tmp11
    tmp103 = tmp100 + tmp102
    tmp105 = tmp104 * tmp16
    tmp106 = tmp103 + tmp105
    tmp107 = tmp96 * tmp20
    tmp108 = tmp98 * tmp23
    tmp109 = tmp107 + tmp108
    tmp110 = tmp101 * tmp27
    tmp111 = tmp109 + tmp110
    tmp112 = tmp104 * tmp31
    tmp113 = tmp111 + tmp112
    tmp114 = tmp96 * tmp35
    tmp115 = tmp98 * tmp38
    tmp116 = tmp114 + tmp115
    tmp117 = tmp101 * tmp42
    tmp118 = tmp116 + tmp117
    tmp119 = tmp104 * tmp46
    tmp120 = tmp118 + tmp119
    tmp121 = tmp96 * tmp50
    tmp122 = tmp98 * tmp53
    tmp123 = tmp121 + tmp122
    tmp124 = tmp101 * tmp57
    tmp125 = tmp123 + tmp124
    tmp126 = tmp104 * tmp61
    tmp127 = tmp125 + tmp126
    tmp129 = tmp128 * tmp2
    tmp131 = tmp130 * tmp6
    tmp132 = tmp129 + tmp131
    tmp134 = tmp133 * tmp11
    tmp135 = tmp132 + tmp134
    tmp137 = tmp136 * tmp16
    tmp138 = tmp135 + tmp137
    tmp139 = tmp128 * tmp20
    tmp140 = tmp130 * tmp23
    tmp141 = tmp139 + tmp140
    tmp142 = tmp133 * tmp27
    tmp143 = tmp141 + tmp142
    tmp144 = tmp136 * tmp31
    tmp145 = tmp143 + tmp144
    tmp146 = tmp128 * tmp35
    tmp147 = tmp130 * tmp38
    tmp148 = tmp146 + tmp147
    tmp149 = tmp133 * tmp42
    tmp150 = tmp148 + tmp149
    tmp151 = tmp136 * tmp46
    tmp152 = tmp150 + tmp151
    tmp153 = tmp128 * tmp50
    tmp154 = tmp130 * tmp53
    tmp155 = tmp153 + tmp154
    tmp156 = tmp133 * tmp57
    tmp157 = tmp155 + tmp156
    tmp158 = tmp136 * tmp61
    tmp159 = tmp157 + tmp158
    tl.store(out_ptr0 + x0, tmp18, xmask)
    tl.store(out_ptr1 + x0, tmp33, xmask)
    tl.store(out_ptr2 + x0, tmp48, xmask)
    tl.store(out_ptr3 + x0, tmp63, xmask)
    tl.store(out_ptr4 + x0, tmp74, xmask)
    tl.store(out_ptr5 + x0, tmp81, xmask)
    tl.store(out_ptr6 + x0, tmp88, xmask)
    tl.store(out_ptr7 + x0, tmp95, xmask)
    tl.store(out_ptr8 + x0, tmp106, xmask)
    tl.store(out_ptr9 + x0, tmp113, xmask)
    tl.store(out_ptr10 + x0, tmp120, xmask)
    tl.store(out_ptr11 + x0, tmp127, xmask)
    tl.store(out_ptr12 + x0, tmp138, xmask)
    tl.store(out_ptr13 + x0, tmp145, xmask)
    tl.store(out_ptr14 + x0, tmp152, xmask)
    tl.store(out_ptr15 + x0, tmp159, xmask)


@triton.jit
def triton_poi_fused_add_mul_mv_sigmoid_tanh_1(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, out_ptr0, out_ptr1, xnumel, XBLOCK: tl.constexpr):
    xnumel = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 4
    x1 = xindex // 4
    x2 = xindex
    tmp0 = tl.load(in_ptr0 + x0, xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr1 + x1, xmask, eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr2 + x1, xmask, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr3 + x0, xmask, eviction_policy='evict_last')
    tmp7 = tl.load(in_ptr4 + x1, xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr5 + x1, xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr6 + x1, xmask, eviction_policy='evict_last')
    tmp14 = tl.load(in_ptr7 + x0, xmask, eviction_policy='evict_last')
    tmp15 = tl.load(in_ptr8 + x1, xmask, eviction_policy='evict_last')
    tmp17 = tl.load(in_ptr9 + x1, xmask, eviction_policy='evict_last')
    tmp23 = tl.load(in_ptr10 + x0, xmask, eviction_policy='evict_last')
    tmp24 = tl.load(in_ptr11 + x1, xmask, eviction_policy='evict_last')
    tmp26 = tl.load(in_ptr12 + x1, xmask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp4 = tmp2 + tmp3
    tmp5 = libdevice.tanh(tmp4)
    tmp8 = tmp6 + tmp7
    tmp10 = tmp8 + tmp9
    tmp11 = tl.sigmoid(tmp10)
    tmp12 = tmp5 * tmp11
    tmp16 = tmp14 + tmp15
    tmp18 = tmp16 + tmp17
    tmp19 = tl.sigmoid(tmp18)
    tmp20 = tmp13 * tmp19
    tmp21 = tmp12 + tmp20
    tmp22 = libdevice.tanh(tmp21)
    tmp25 = tmp23 + tmp24
    tmp27 = tmp25 + tmp26
    tmp28 = tl.sigmoid(tmp27)
    tmp29 = tmp22 * tmp28
    tl.store(out_ptr0 + x2, tmp21, xmask)
    tl.store(out_ptr1 + x2, tmp29, xmask)


@triton.jit
def triton_poi_fused_add_mul_mv_sigmoid_tanh_2(in_out_ptr0, in_ptr0,
    in_ptr1, in_ptr2, in_ptr3, in_ptr4, in_ptr5, in_ptr6, in_ptr7, in_ptr8,
    in_ptr9, in_ptr10, in_ptr11, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 4
    x2 = xindex
    x1 = xindex // 4
    tmp0 = tl.load(in_ptr0 + x0, xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr1 + x2, xmask)
    tmp3 = tl.load(in_ptr2 + x1, xmask, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr3 + x0, xmask, eviction_policy='evict_last')
    tmp7 = tl.load(in_ptr4 + x2, xmask)
    tmp9 = tl.load(in_ptr5 + x1, xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_out_ptr0 + x2, xmask)
    tmp14 = tl.load(in_ptr6 + x0, xmask, eviction_policy='evict_last')
    tmp15 = tl.load(in_ptr7 + x2, xmask)
    tmp17 = tl.load(in_ptr8 + x1, xmask, eviction_policy='evict_last')
    tmp23 = tl.load(in_ptr9 + x0, xmask, eviction_policy='evict_last')
    tmp24 = tl.load(in_ptr10 + x2, xmask)
    tmp26 = tl.load(in_ptr11 + x1, xmask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp4 = tmp2 + tmp3
    tmp5 = libdevice.tanh(tmp4)
    tmp8 = tmp6 + tmp7
    tmp10 = tmp8 + tmp9
    tmp11 = tl.sigmoid(tmp10)
    tmp12 = tmp5 * tmp11
    tmp16 = tmp14 + tmp15
    tmp18 = tmp16 + tmp17
    tmp19 = tl.sigmoid(tmp18)
    tmp20 = tmp13 * tmp19
    tmp21 = tmp12 + tmp20
    tmp22 = libdevice.tanh(tmp21)
    tmp25 = tmp23 + tmp24
    tmp27 = tmp25 + tmp26
    tmp28 = tl.sigmoid(tmp27)
    tmp29 = tmp22 * tmp28
    tl.store(in_out_ptr0 + x2, tmp21, xmask)
    tl.store(out_ptr0 + x2, tmp29, xmask)


@triton.jit
def triton_poi_fused_add_mul_mv_sigmoid_tanh_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, out_ptr0, out_ptr1, xnumel, XBLOCK: tl.constexpr):
    xnumel = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 4
    x2 = xindex
    x1 = xindex // 4
    tmp0 = tl.load(in_ptr0 + x0, xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr1 + x2, xmask)
    tmp3 = tl.load(in_ptr2 + x1, xmask, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr3 + x0, xmask, eviction_policy='evict_last')
    tmp7 = tl.load(in_ptr4 + x2, xmask)
    tmp9 = tl.load(in_ptr5 + x1, xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr6 + x2, xmask)
    tmp14 = tl.load(in_ptr7 + x0, xmask, eviction_policy='evict_last')
    tmp15 = tl.load(in_ptr8 + x2, xmask)
    tmp17 = tl.load(in_ptr9 + x1, xmask, eviction_policy='evict_last')
    tmp23 = tl.load(in_ptr10 + x0, xmask, eviction_policy='evict_last')
    tmp24 = tl.load(in_ptr11 + x2, xmask)
    tmp26 = tl.load(in_ptr12 + x1, xmask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp4 = tmp2 + tmp3
    tmp5 = libdevice.tanh(tmp4)
    tmp8 = tmp6 + tmp7
    tmp10 = tmp8 + tmp9
    tmp11 = tl.sigmoid(tmp10)
    tmp12 = tmp5 * tmp11
    tmp16 = tmp14 + tmp15
    tmp18 = tmp16 + tmp17
    tmp19 = tl.sigmoid(tmp18)
    tmp20 = tmp13 * tmp19
    tmp21 = tmp12 + tmp20
    tmp22 = libdevice.tanh(tmp21)
    tmp25 = tmp23 + tmp24
    tmp27 = tmp25 + tmp26
    tmp28 = tl.sigmoid(tmp27)
    tmp29 = tmp22 * tmp28
    tl.store(out_ptr0 + x2, tmp21, xmask)
    tl.store(out_ptr1 + x2, tmp29, xmask)


@triton.jit
def triton_poi_fused_add_mul_mv_sigmoid_tanh_4(in_out_ptr0, in_ptr0,
    in_ptr1, in_ptr2, in_ptr3, in_ptr4, in_ptr5, in_ptr6, in_ptr7, in_ptr8,
    in_ptr9, in_ptr10, in_ptr11, in_ptr12, out_ptr0, xnumel, XBLOCK: tl.
    constexpr):
    xnumel = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 4
    x2 = xindex
    x1 = xindex // 4
    tmp0 = tl.load(in_ptr0 + x0, xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr1 + x2, xmask)
    tmp3 = tl.load(in_ptr2 + x1, xmask, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr3 + x0, xmask, eviction_policy='evict_last')
    tmp7 = tl.load(in_ptr4 + x2, xmask)
    tmp9 = tl.load(in_ptr5 + x1, xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr6 + x2, xmask)
    tmp14 = tl.load(in_ptr7 + x0, xmask, eviction_policy='evict_last')
    tmp15 = tl.load(in_ptr8 + x2, xmask)
    tmp17 = tl.load(in_ptr9 + x1, xmask, eviction_policy='evict_last')
    tmp23 = tl.load(in_ptr10 + x0, xmask, eviction_policy='evict_last')
    tmp24 = tl.load(in_ptr11 + x2, xmask)
    tmp26 = tl.load(in_ptr12 + x1, xmask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp4 = tmp2 + tmp3
    tmp5 = libdevice.tanh(tmp4)
    tmp8 = tmp6 + tmp7
    tmp10 = tmp8 + tmp9
    tmp11 = tl.sigmoid(tmp10)
    tmp12 = tmp5 * tmp11
    tmp16 = tmp14 + tmp15
    tmp18 = tmp16 + tmp17
    tmp19 = tl.sigmoid(tmp18)
    tmp20 = tmp13 * tmp19
    tmp21 = tmp12 + tmp20
    tmp22 = libdevice.tanh(tmp21)
    tmp25 = tmp23 + tmp24
    tmp27 = tmp25 + tmp26
    tmp28 = tl.sigmoid(tmp27)
    tmp29 = tmp22 * tmp28
    tl.store(in_out_ptr0 + x2, tmp22, xmask)
    tl.store(out_ptr0 + x2, tmp29, xmask)


def call(args):
    (primals_1, primals_2, primals_3, primals_4, primals_5, primals_6,
        primals_7, primals_8, primals_9, primals_10, primals_11, primals_12,
        primals_13, primals_14, primals_15, primals_16, primals_17) = args
    args.clear()
    assert_size_stride(primals_1, (4, 1), (1, 1))
    assert_size_stride(primals_2, (4, 1), (1, 1))
    assert_size_stride(primals_3, (4, 4), (4, 1))
    assert_size_stride(primals_4, (4, 4), (4, 1))
    assert_size_stride(primals_5, (4, 4), (4, 1))
    assert_size_stride(primals_6, (4, 1), (1, 1))
    assert_size_stride(primals_7, (4, 4), (4, 1))
    assert_size_stride(primals_8, (4, 4), (4, 1))
    assert_size_stride(primals_9, (4, 1), (1, 1))
    assert_size_stride(primals_10, (4, 4), (4, 1))
    assert_size_stride(primals_11, (4, 4), (4, 1))
    assert_size_stride(primals_12, (4, 1), (1, 1))
    assert_size_stride(primals_13, (4, 4), (4, 1))
    assert_size_stride(primals_14, (4, 4), (4, 1))
    assert_size_stride(primals_15, (4, 1), (1, 1))
    assert_size_stride(primals_16, (4, 4), (4, 1))
    assert_size_stride(primals_17, (4, 1), (1, 1))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = empty_strided_cuda((4, 1), (1, 1), torch.float32)
        extern_kernels.mm(primals_5, primals_1, out=buf0)
        buf1 = empty_strided_cuda((4,), (1,), torch.float32)
        buf11 = empty_strided_cuda((4,), (1,), torch.float32)
        buf21 = empty_strided_cuda((4,), (1,), torch.float32)
        buf31 = empty_strided_cuda((4,), (1,), torch.float32)
        buf3 = empty_strided_cuda((4,), (1,), torch.float32)
        buf13 = empty_strided_cuda((4,), (1,), torch.float32)
        buf23 = empty_strided_cuda((4,), (1,), torch.float32)
        buf33 = empty_strided_cuda((4,), (1,), torch.float32)
        buf5 = empty_strided_cuda((4,), (1,), torch.float32)
        buf15 = empty_strided_cuda((4,), (1,), torch.float32)
        buf25 = empty_strided_cuda((4,), (1,), torch.float32)
        buf35 = empty_strided_cuda((4,), (1,), torch.float32)
        buf7 = empty_strided_cuda((4,), (1,), torch.float32)
        buf17 = empty_strided_cuda((4,), (1,), torch.float32)
        buf27 = empty_strided_cuda((4,), (1,), torch.float32)
        buf37 = empty_strided_cuda((4,), (1,), torch.float32)
        get_raw_stream(0)
        triton_poi_fused_mv_0[grid(4)](primals_3, primals_4, primals_7,
            primals_10, primals_13, buf1, buf11, buf21, buf31, buf3, buf13,
            buf23, buf33, buf5, buf15, buf25, buf35, buf7, buf17, buf27,
            buf37, 4, XBLOCK=4, num_warps=1, num_stages=1)
        buf2 = empty_strided_cuda((4, 1), (1, 1), torch.float32)
        extern_kernels.mm(primals_8, primals_1, out=buf2)
        buf4 = empty_strided_cuda((4, 1), (1, 1), torch.float32)
        extern_kernels.mm(primals_11, primals_1, out=buf4)
        buf6 = empty_strided_cuda((4, 1), (1, 1), torch.float32)
        extern_kernels.mm(primals_14, primals_1, out=buf6)
        buf8 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        buf9 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        triton_poi_fused_add_mul_mv_sigmoid_tanh_1[grid(16)](buf1, buf0,
            primals_6, buf3, buf2, primals_9, primals_2, buf5, buf4,
            primals_12, buf7, buf6, primals_15, buf8, buf9, 16, XBLOCK=16,
            num_warps=1, num_stages=1)
        del buf1
        del buf3
        del buf5
        del buf7
        buf10 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        extern_kernels.mm(primals_5, buf9, out=buf10)
        buf12 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        extern_kernels.mm(primals_8, buf9, out=buf12)
        buf14 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        extern_kernels.mm(primals_11, buf9, out=buf14)
        buf16 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        extern_kernels.mm(primals_14, buf9, out=buf16)
        buf18 = buf8
        del buf8
        buf19 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        triton_poi_fused_add_mul_mv_sigmoid_tanh_2[grid(16)](buf18, buf11,
            buf10, primals_6, buf13, buf12, primals_9, buf15, buf14,
            primals_12, buf17, buf16, primals_15, buf19, 16, XBLOCK=16,
            num_warps=1, num_stages=1)
        del buf11
        del buf13
        del buf15
        del buf17
        buf20 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        extern_kernels.mm(primals_5, buf19, out=buf20)
        buf22 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        extern_kernels.mm(primals_8, buf19, out=buf22)
        buf24 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        extern_kernels.mm(primals_11, buf19, out=buf24)
        buf26 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        extern_kernels.mm(primals_14, buf19, out=buf26)
        buf28 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        buf29 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        triton_poi_fused_add_mul_mv_sigmoid_tanh_3[grid(16)](buf21, buf20,
            primals_6, buf23, buf22, primals_9, buf18, buf25, buf24,
            primals_12, buf27, buf26, primals_15, buf28, buf29, 16, XBLOCK=
            16, num_warps=1, num_stages=1)
        del buf21
        del buf23
        del buf25
        del buf27
        buf30 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        extern_kernels.mm(primals_5, buf29, out=buf30)
        buf32 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        extern_kernels.mm(primals_8, buf29, out=buf32)
        buf34 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        extern_kernels.mm(primals_11, buf29, out=buf34)
        buf36 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        extern_kernels.mm(primals_14, buf29, out=buf36)
        buf38 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        buf39 = buf38
        del buf38
        buf40 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        triton_poi_fused_add_mul_mv_sigmoid_tanh_4[grid(16)](buf39, buf31,
            buf30, primals_6, buf33, buf32, primals_9, buf28, buf35, buf34,
            primals_12, buf37, buf36, primals_15, buf40, 16, XBLOCK=16,
            num_warps=1, num_stages=1)
        del buf31
        del buf33
        del buf35
        del buf37
        buf41 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        extern_kernels.addmm(primals_17, primals_16, buf40, alpha=1, beta=1,
            out=buf41)
        del primals_17
    return (reinterpret_tensor(buf41, (4, 4), (1, 4), 0), primals_2,
        primals_3, primals_4, primals_6, primals_7, primals_9, primals_10,
        primals_12, primals_13, primals_15, buf0, buf2, buf4, buf6, buf10,
        buf12, buf14, buf16, buf18, buf20, buf22, buf24, buf26, buf28,
        buf30, buf32, buf34, buf36, buf39, reinterpret_tensor(primals_16, (
        4, 4), (1, 4), 0), reinterpret_tensor(buf40, (4, 4), (1, 4), 0),
        reinterpret_tensor(primals_14, (4, 4), (1, 4), 0),
        reinterpret_tensor(buf29, (4, 4), (1, 4), 0), reinterpret_tensor(
        primals_11, (4, 4), (1, 4), 0), reinterpret_tensor(primals_8, (4, 4
        ), (1, 4), 0), reinterpret_tensor(primals_5, (4, 4), (1, 4), 0),
        reinterpret_tensor(buf19, (4, 4), (1, 4), 0), reinterpret_tensor(
        buf9, (4, 4), (1, 4), 0), reinterpret_tensor(primals_1, (1, 4), (1,
        1), 0))


class LSTMNew(nn.Module):

    def __init__(self, seq_length, input_dim, num_hidden, num_classes,
        batch_size, device='cpu'):
        super(LSTMNew, self).__init__()
        self.seq_length = seq_length
        self.h_init = nn.Parameter(torch.zeros(num_hidden, 1),
            requires_grad=False)
        self.c_init = nn.Parameter(torch.zeros(num_hidden, 1),
            requires_grad=False)
        self.w_gx = nn.Parameter(nn.init.orthogonal_(torch.Tensor(
            num_hidden, input_dim).normal_(mean=0, std=0.0001)))
        self.w_gh = nn.Parameter(nn.init.orthogonal_(torch.Tensor(
            num_hidden, num_hidden).normal_(mean=0, std=0.0001)))
        self.b_g = nn.Parameter(torch.Tensor(num_hidden, 1).zero_())
        self.w_ix = nn.Parameter(nn.init.orthogonal_(torch.Tensor(
            num_hidden, input_dim).normal_(mean=0, std=0.0001)))
        self.w_ih = nn.Parameter(nn.init.orthogonal_(torch.Tensor(
            num_hidden, num_hidden).normal_(mean=0, std=0.0001)))
        self.b_i = nn.Parameter(torch.Tensor(num_hidden, 1).zero_())
        self.w_fx = nn.Parameter(nn.init.orthogonal_(torch.Tensor(
            num_hidden, input_dim).normal_(mean=0, std=0.0001)))
        self.w_fh = nn.Parameter(nn.init.orthogonal_(torch.Tensor(
            num_hidden, num_hidden).normal_(mean=0, std=0.0001)))
        self.b_f = nn.Parameter(torch.Tensor(num_hidden, 1).zero_())
        self.w_ox = nn.Parameter(nn.init.orthogonal_(torch.Tensor(
            num_hidden, input_dim).normal_(mean=0, std=0.0001)))
        self.w_oh = nn.Parameter(nn.init.orthogonal_(torch.Tensor(
            num_hidden, num_hidden).normal_(mean=0, std=0.0001)))
        self.b_o = nn.Parameter(torch.Tensor(num_hidden, 1).zero_())
        self.w_ph = nn.Parameter(torch.Tensor(num_classes, num_hidden).
            normal_(mean=0, std=0.0001))
        self.b_p = nn.Parameter(torch.Tensor(num_classes, 1).zero_())

    def forward(self, input_0):
        primals_1 = self.h_init
        primals_2 = self.c_init
        primals_3 = self.w_gx
        primals_4 = self.w_gh
        primals_6 = self.b_g
        primals_5 = self.w_ix
        primals_7 = self.w_ih
        primals_9 = self.b_i
        primals_8 = self.w_fx
        primals_10 = self.w_fh
        primals_12 = self.b_f
        primals_11 = self.w_ox
        primals_13 = self.w_oh
        primals_15 = self.b_o
        primals_14 = self.w_ph
        primals_17 = self.b_p
        primals_16 = input_0
        output = call([primals_1, primals_2, primals_3, primals_4,
            primals_5, primals_6, primals_7, primals_8, primals_9,
            primals_10, primals_11, primals_12, primals_13, primals_14,
            primals_15, primals_16, primals_17])
        return output[0]
