# 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/uu/cuuz64vjdf55nvqzb56xepy4nuom6xkfbga3qduvlkofb2w2rcz5.py
# Topologically Sorted Source Nodes: [conv_transpose2d, embeddings_dec1_1], Original ATen: [aten.convolution, aten.native_group_norm]
# Source node to ATen node mapping:
#   conv_transpose2d => convolution
#   embeddings_dec1_1 => add, add_1, mul_1, rsqrt, var_mean
# Graph fragment:
#   %convolution : [num_users=2] = call_function[target=torch.ops.aten.convolution.default](args = (%primals_1, %primals_2, %primals_3, [2, 2], [3, 7], [1, 1], True, [0, 0], 1), kwargs = {})
#   %var_mean : [num_users=2] = call_function[target=torch.ops.aten.var_mean.correction](args = (%view, [2, 3]), kwargs = {correction: 0, keepdim: True})
#   %add : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%getitem, 1e-05), kwargs = {})
#   %rsqrt : [num_users=2] = call_function[target=torch.ops.aten.rsqrt.default](args = (%add,), kwargs = {})
#   %mul_1 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%view_1, %unsqueeze_5), kwargs = {})
#   %add_1 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%mul_1, %unsqueeze_2), kwargs = {})
triton_red_fused_convolution_native_group_norm_0 = async_compile.triton('triton_red_fused_convolution_native_group_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=[4, 2048],
    reduction_hint=ReductionHint.INNER,
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: '*fp32', 5: '*fp32', 6: '*fp32', 7: 'i32', 8: '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, 8), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_red_fused_convolution_native_group_norm_0', 'mutated_arg_names': ['in_out_ptr0'], 'no_x_dim': False, 'num_load': 5, '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_red_fused_convolution_native_group_norm_0(in_out_ptr0, in_ptr0, in_ptr1, in_ptr2, out_ptr0, out_ptr2, out_ptr3, xnumel, rnumel, XBLOCK : tl.constexpr, RBLOCK : tl.constexpr):
    xnumel = 4
    rnumel = 2048
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    rbase = tl.arange(0, RBLOCK)[None, :]
    x0 = xindex
    tmp6_mean = tl.zeros([XBLOCK, RBLOCK], tl.float32)
    tmp6_m2 = tl.zeros([XBLOCK, RBLOCK], tl.float32)
    tmp6_weight = tl.zeros([XBLOCK, RBLOCK], tl.float32)
    for roffset in range(0, rnumel, RBLOCK):
        rindex = roffset + rbase
        rmask = rindex < rnumel
        r3 = rindex
        r2 = (rindex // 64)
        tmp0 = tl.load(in_out_ptr0 + (r3 + (2048*x0)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp1 = tl.load(in_ptr0 + (r2), rmask, eviction_policy='evict_last', other=0.0)
        tmp2 = tmp0 + tmp1
        tmp3 = tl.full([1, 1], 0, tl.int32)
        tmp4 = triton_helpers.maximum(tmp3, tmp2)
        tmp5 = tl.broadcast_to(tmp4, [XBLOCK, RBLOCK])
        tmp6_mean_next, tmp6_m2_next, tmp6_weight_next = triton_helpers.welford_reduce(
            tmp5, tmp6_mean, tmp6_m2, tmp6_weight, roffset == 0
        )
        tmp6_mean = tl.where(rmask & xmask, tmp6_mean_next, tmp6_mean)
        tmp6_m2 = tl.where(rmask & xmask, tmp6_m2_next, tmp6_m2)
        tmp6_weight = tl.where(rmask & xmask, tmp6_weight_next, tmp6_weight)
        tl.store(in_out_ptr0 + (r3 + (2048*x0)), tmp2, rmask & xmask)
    tmp6_tmp, tmp7_tmp, tmp8_tmp = triton_helpers.welford(
        tmp6_mean, tmp6_m2, tmp6_weight, 1
    )
    tmp6 = tmp6_tmp[:, None]
    tmp7 = tmp7_tmp[:, None]
    tmp8 = tmp8_tmp[:, None]
    tl.store(out_ptr0 + (x0), tmp6, xmask)
    for roffset in range(0, rnumel, RBLOCK):
        rindex = roffset + rbase
        rmask = rindex < rnumel
        r3 = rindex
        r2 = (rindex // 64)
        tmp9 = tl.load(in_out_ptr0 + (r3 + (2048*x0)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp19 = tl.load(in_ptr1 + (r2), rmask, eviction_policy='evict_last', other=0.0)
        tmp21 = tl.load(in_ptr2 + (r2), rmask, eviction_policy='evict_last', other=0.0)
        tmp10 = tl.full([1, 1], 0, tl.int32)
        tmp11 = triton_helpers.maximum(tmp10, tmp9)
        tmp12 = tmp11 - tmp6
        tmp13 = 2048.0
        tmp14 = tmp7 / tmp13
        tmp15 = 1e-05
        tmp16 = tmp14 + tmp15
        tmp17 = libdevice.rsqrt(tmp16)
        tmp18 = tmp12 * tmp17
        tmp20 = tmp18 * tmp19
        tmp22 = tmp20 + tmp21
        tl.store(out_ptr2 + (r3 + (2048*x0)), tmp22, rmask & xmask)
    tmp23 = 2048.0
    tmp24 = tmp7 / tmp23
    tmp25 = 1e-05
    tmp26 = tmp24 + tmp25
    tmp27 = libdevice.rsqrt(tmp26)
    tl.store(out_ptr3 + (x0), tmp27, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_7/inductor_cache/cg/ccgsdqyeo4zmix6ydcqsntzzpkcudckfgtlvl3zmvygaucgkcle5.py
# Topologically Sorted Source Nodes: [conv_transpose2d_1, embeddings_dec2_1], Original ATen: [aten.convolution, aten.native_group_norm]
# Source node to ATen node mapping:
#   conv_transpose2d_1 => convolution_1
#   embeddings_dec2_1 => add_2, add_3, mul_3, rsqrt_1, var_mean_1
# Graph fragment:
#   %convolution_1 : [num_users=2] = call_function[target=torch.ops.aten.convolution.default](args = (%add_1, %primals_6, %primals_7, [2, 2], [3, 7], [1, 1], True, [0, 0], 1), kwargs = {})
#   %var_mean_1 : [num_users=2] = call_function[target=torch.ops.aten.var_mean.correction](args = (%view_2, [2, 3]), kwargs = {correction: 0, keepdim: True})
#   %add_2 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%getitem_2, 1e-05), kwargs = {})
#   %rsqrt_1 : [num_users=2] = call_function[target=torch.ops.aten.rsqrt.default](args = (%add_2,), kwargs = {})
#   %mul_3 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%view_3, %unsqueeze_11), kwargs = {})
#   %add_3 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%mul_3, %unsqueeze_8), kwargs = {})
triton_red_fused_convolution_native_group_norm_1 = async_compile.triton('triton_red_fused_convolution_native_group_norm_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.reduction(
    size_hints=[4, 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: 'i32', 8: '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, 8), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_red_fused_convolution_native_group_norm_1', 'mutated_arg_names': ['in_out_ptr0'], 'no_x_dim': False, 'num_load': 5, '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_red_fused_convolution_native_group_norm_1(in_out_ptr0, in_ptr0, in_ptr1, in_ptr2, out_ptr0, out_ptr2, out_ptr3, xnumel, rnumel, XBLOCK : tl.constexpr, RBLOCK : tl.constexpr):
    xnumel = 4
    rnumel = 4096
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    rbase = tl.arange(0, RBLOCK)[None, :]
    x0 = xindex
    tmp6_mean = tl.zeros([XBLOCK, RBLOCK], tl.float32)
    tmp6_m2 = tl.zeros([XBLOCK, RBLOCK], tl.float32)
    tmp6_weight = tl.zeros([XBLOCK, RBLOCK], tl.float32)
    for roffset in range(0, rnumel, RBLOCK):
        rindex = roffset + rbase
        rmask = rindex < rnumel
        r3 = rindex
        r2 = (rindex // 256)
        tmp0 = tl.load(in_out_ptr0 + (r3 + (4096*x0)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp1 = tl.load(in_ptr0 + (r2), rmask, eviction_policy='evict_last', other=0.0)
        tmp2 = tmp0 + tmp1
        tmp3 = tl.full([1, 1], 0, tl.int32)
        tmp4 = triton_helpers.maximum(tmp3, tmp2)
        tmp5 = tl.broadcast_to(tmp4, [XBLOCK, RBLOCK])
        tmp6_mean_next, tmp6_m2_next, tmp6_weight_next = triton_helpers.welford_reduce(
            tmp5, tmp6_mean, tmp6_m2, tmp6_weight, roffset == 0
        )
        tmp6_mean = tl.where(rmask & xmask, tmp6_mean_next, tmp6_mean)
        tmp6_m2 = tl.where(rmask & xmask, tmp6_m2_next, tmp6_m2)
        tmp6_weight = tl.where(rmask & xmask, tmp6_weight_next, tmp6_weight)
        tl.store(in_out_ptr0 + (r3 + (4096*x0)), tmp2, rmask & xmask)
    tmp6_tmp, tmp7_tmp, tmp8_tmp = triton_helpers.welford(
        tmp6_mean, tmp6_m2, tmp6_weight, 1
    )
    tmp6 = tmp6_tmp[:, None]
    tmp7 = tmp7_tmp[:, None]
    tmp8 = tmp8_tmp[:, None]
    tl.store(out_ptr0 + (x0), tmp6, xmask)
    for roffset in range(0, rnumel, RBLOCK):
        rindex = roffset + rbase
        rmask = rindex < rnumel
        r3 = rindex
        r2 = (rindex // 256)
        tmp9 = tl.load(in_out_ptr0 + (r3 + (4096*x0)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp19 = tl.load(in_ptr1 + (r2), rmask, eviction_policy='evict_last', other=0.0)
        tmp21 = tl.load(in_ptr2 + (r2), rmask, eviction_policy='evict_last', other=0.0)
        tmp10 = tl.full([1, 1], 0, tl.int32)
        tmp11 = triton_helpers.maximum(tmp10, tmp9)
        tmp12 = tmp11 - tmp6
        tmp13 = 4096.0
        tmp14 = tmp7 / tmp13
        tmp15 = 1e-05
        tmp16 = tmp14 + tmp15
        tmp17 = libdevice.rsqrt(tmp16)
        tmp18 = tmp12 * tmp17
        tmp20 = tmp18 * tmp19
        tmp22 = tmp20 + tmp21
        tl.store(out_ptr2 + (r3 + (4096*x0)), tmp22, rmask & xmask)
    tmp23 = 4096.0
    tmp24 = tmp7 / tmp23
    tmp25 = 1e-05
    tmp26 = tmp24 + tmp25
    tmp27 = libdevice.rsqrt(tmp26)
    tl.store(out_ptr3 + (x0), tmp27, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_7/inductor_cache/d3/cd3mqt6cdu46akjjddj4hpzz3bwnl5e4eykk6l22bqe7phvlj5e7.py
# Topologically Sorted Source Nodes: [conv_transpose2d_2, embeddings_dec3_1], Original ATen: [aten.convolution, aten.native_group_norm]
# Source node to ATen node mapping:
#   conv_transpose2d_2 => convolution_2
#   embeddings_dec3_1 => add_4, add_5, mul_5, rsqrt_2, var_mean_2
# Graph fragment:
#   %convolution_2 : [num_users=2] = call_function[target=torch.ops.aten.convolution.default](args = (%add_3, %primals_10, %primals_11, [2, 2], [3, 7], [1, 1], True, [0, 0], 1), kwargs = {})
#   %var_mean_2 : [num_users=2] = call_function[target=torch.ops.aten.var_mean.correction](args = (%view_4, [2, 3]), kwargs = {correction: 0, keepdim: True})
#   %add_4 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%getitem_4, 1e-05), kwargs = {})
#   %rsqrt_2 : [num_users=2] = call_function[target=torch.ops.aten.rsqrt.default](args = (%add_4,), kwargs = {})
#   %mul_5 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%view_5, %unsqueeze_17), kwargs = {})
#   %add_5 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%mul_5, %unsqueeze_14), kwargs = {})
triton_red_fused_convolution_native_group_norm_2 = async_compile.triton('triton_red_fused_convolution_native_group_norm_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.reduction(
    size_hints=[4, 8192],
    reduction_hint=ReductionHint.INNER,
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: '*fp32', 5: '*fp32', 6: '*fp32', 7: 'i32', 8: '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, 8), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_red_fused_convolution_native_group_norm_2', 'mutated_arg_names': ['in_out_ptr0'], 'no_x_dim': False, 'num_load': 5, '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_red_fused_convolution_native_group_norm_2(in_out_ptr0, in_ptr0, in_ptr1, in_ptr2, out_ptr0, out_ptr2, out_ptr3, 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
    tmp6_mean = tl.zeros([XBLOCK, RBLOCK], tl.float32)
    tmp6_m2 = tl.zeros([XBLOCK, RBLOCK], tl.float32)
    tmp6_weight = tl.zeros([XBLOCK, RBLOCK], tl.float32)
    for roffset in range(0, rnumel, RBLOCK):
        rindex = roffset + rbase
        rmask = rindex < rnumel
        r3 = rindex
        r2 = (rindex // 1024)
        tmp0 = tl.load(in_out_ptr0 + (r3 + (8192*x0)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp1 = tl.load(in_ptr0 + (r2), rmask, eviction_policy='evict_last', other=0.0)
        tmp2 = tmp0 + tmp1
        tmp3 = tl.full([1, 1], 0, tl.int32)
        tmp4 = triton_helpers.maximum(tmp3, tmp2)
        tmp5 = tl.broadcast_to(tmp4, [XBLOCK, RBLOCK])
        tmp6_mean_next, tmp6_m2_next, tmp6_weight_next = triton_helpers.welford_reduce(
            tmp5, tmp6_mean, tmp6_m2, tmp6_weight, roffset == 0
        )
        tmp6_mean = tl.where(rmask & xmask, tmp6_mean_next, tmp6_mean)
        tmp6_m2 = tl.where(rmask & xmask, tmp6_m2_next, tmp6_m2)
        tmp6_weight = tl.where(rmask & xmask, tmp6_weight_next, tmp6_weight)
        tl.store(in_out_ptr0 + (r3 + (8192*x0)), tmp2, rmask & xmask)
    tmp6_tmp, tmp7_tmp, tmp8_tmp = triton_helpers.welford(
        tmp6_mean, tmp6_m2, tmp6_weight, 1
    )
    tmp6 = tmp6_tmp[:, None]
    tmp7 = tmp7_tmp[:, None]
    tmp8 = tmp8_tmp[:, None]
    tl.store(out_ptr0 + (x0), tmp6, xmask)
    for roffset in range(0, rnumel, RBLOCK):
        rindex = roffset + rbase
        rmask = rindex < rnumel
        r3 = rindex
        r2 = (rindex // 1024)
        tmp9 = tl.load(in_out_ptr0 + (r3 + (8192*x0)), rmask & xmask, eviction_policy='evict_first', other=0.0)
        tmp19 = tl.load(in_ptr1 + (r2), rmask, eviction_policy='evict_last', other=0.0)
        tmp21 = tl.load(in_ptr2 + (r2), rmask, eviction_policy='evict_last', other=0.0)
        tmp10 = tl.full([1, 1], 0, tl.int32)
        tmp11 = triton_helpers.maximum(tmp10, tmp9)
        tmp12 = tmp11 - tmp6
        tmp13 = 8192.0
        tmp14 = tmp7 / tmp13
        tmp15 = 1e-05
        tmp16 = tmp14 + tmp15
        tmp17 = libdevice.rsqrt(tmp16)
        tmp18 = tmp12 * tmp17
        tmp20 = tmp18 * tmp19
        tmp22 = tmp20 + tmp21
        tl.store(out_ptr2 + (r3 + (8192*x0)), tmp22, rmask & xmask)
    tmp23 = 8192.0
    tmp24 = tmp7 / tmp23
    tmp25 = 1e-05
    tmp26 = tmp24 + tmp25
    tmp27 = libdevice.rsqrt(tmp26)
    tl.store(out_ptr3 + (x0), tmp27, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_7/inductor_cache/np/cnp5v6qpoys2t5j36bmfyjtmatvurxdqxn4fmow6tjvaoq4uzwin.py
# Topologically Sorted Source Nodes: [conv_transpose2d_3, segment], Original ATen: [aten.convolution, aten.sigmoid]
# Source node to ATen node mapping:
#   conv_transpose2d_3 => convolution_3
#   segment => sigmoid
# Graph fragment:
#   %convolution_3 : [num_users=1] = call_function[target=torch.ops.aten.convolution.default](args = (%add_5, %primals_14, %primals_15, [2, 2], [3, 7], [1, 1], True, [0, 0], 1), kwargs = {})
#   %sigmoid : [num_users=1] = call_function[target=torch.ops.aten.sigmoid.default](args = (%convolution_3,), kwargs = {})
triton_poi_fused_convolution_sigmoid_3 = async_compile.triton('triton_poi_fused_convolution_sigmoid_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=[16384], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '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), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_convolution_sigmoid_3', 'mutated_arg_names': ['in_out_ptr0'], 'no_x_dim': False, 'num_load': 2, '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_convolution_sigmoid_3(in_out_ptr0, in_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 16384
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = tl.full([XBLOCK], True, tl.int1)
    x0 = xindex
    tmp0 = tl.load(in_out_ptr0 + (x0), None)
    tmp1 = tl.load(in_ptr0 + (0))
    tmp2 = tl.broadcast_to(tmp1, [XBLOCK])
    tmp3 = tmp0 + tmp2
    tmp4 = tl.sigmoid(tmp3)
    tl.store(in_out_ptr0 + (x0), tmp4, None)
''', 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 = args
    args.clear()
    assert_size_stride(primals_1, (4, 16, 4, 4), (256, 16, 4, 1))
    assert_size_stride(primals_2, (16, 32, 8, 16), (4096, 128, 16, 1))
    assert_size_stride(primals_3, (32, ), (1, ))
    assert_size_stride(primals_4, (32, ), (1, ))
    assert_size_stride(primals_5, (32, ), (1, ))
    assert_size_stride(primals_6, (32, 16, 8, 16), (2048, 128, 16, 1))
    assert_size_stride(primals_7, (16, ), (1, ))
    assert_size_stride(primals_8, (16, ), (1, ))
    assert_size_stride(primals_9, (16, ), (1, ))
    assert_size_stride(primals_10, (16, 8, 8, 16), (1024, 128, 16, 1))
    assert_size_stride(primals_11, (8, ), (1, ))
    assert_size_stride(primals_12, (8, ), (1, ))
    assert_size_stride(primals_13, (8, ), (1, ))
    assert_size_stride(primals_14, (8, 1, 8, 16), (128, 128, 16, 1))
    assert_size_stride(primals_15, (1, ), (1, ))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        # Topologically Sorted Source Nodes: [conv_transpose2d], Original ATen: [aten.convolution]
        buf0 = extern_kernels.convolution(primals_1, primals_2, stride=(2, 2), padding=(3, 7), dilation=(1, 1), transposed=True, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf0, (4, 32, 8, 8), (2048, 64, 8, 1))
        buf1 = buf0; del buf0  # reuse
        buf2 = empty_strided_cuda((4, 1, 1, 1), (1, 4, 4, 4), torch.float32)
        buf5 = empty_strided_cuda((4, 32, 8, 8), (2048, 64, 8, 1), torch.float32)
        buf6 = empty_strided_cuda((4, 1, 1, 1), (1, 4, 4, 4), torch.float32)
        # Topologically Sorted Source Nodes: [conv_transpose2d, embeddings_dec1_1], Original ATen: [aten.convolution, aten.native_group_norm]
        stream0 = get_raw_stream(0)
        triton_red_fused_convolution_native_group_norm_0.run(buf1, primals_3, primals_4, primals_5, buf2, buf5, buf6, 4, 2048, grid=grid(4), stream=stream0)
        del primals_3
        del primals_5
        # Topologically Sorted Source Nodes: [conv_transpose2d_1], Original ATen: [aten.convolution]
        buf7 = extern_kernels.convolution(buf5, primals_6, stride=(2, 2), padding=(3, 7), dilation=(1, 1), transposed=True, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf7, (4, 16, 16, 16), (4096, 256, 16, 1))
        buf8 = buf7; del buf7  # reuse
        buf9 = empty_strided_cuda((4, 1, 1, 1), (1, 4, 4, 4), torch.float32)
        buf12 = empty_strided_cuda((4, 16, 16, 16), (4096, 256, 16, 1), torch.float32)
        buf13 = empty_strided_cuda((4, 1, 1, 1), (1, 4, 4, 4), torch.float32)
        # Topologically Sorted Source Nodes: [conv_transpose2d_1, embeddings_dec2_1], Original ATen: [aten.convolution, aten.native_group_norm]
        triton_red_fused_convolution_native_group_norm_1.run(buf8, primals_7, primals_8, primals_9, buf9, buf12, buf13, 4, 4096, grid=grid(4), stream=stream0)
        del primals_7
        del primals_9
        # Topologically Sorted Source Nodes: [conv_transpose2d_2], Original ATen: [aten.convolution]
        buf14 = extern_kernels.convolution(buf12, primals_10, stride=(2, 2), padding=(3, 7), dilation=(1, 1), transposed=True, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf14, (4, 8, 32, 32), (8192, 1024, 32, 1))
        buf15 = buf14; del buf14  # reuse
        buf16 = empty_strided_cuda((4, 1, 1, 1), (1, 4, 4, 4), torch.float32)
        buf19 = empty_strided_cuda((4, 8, 32, 32), (8192, 1024, 32, 1), torch.float32)
        buf20 = empty_strided_cuda((4, 1, 1, 1), (1, 4, 4, 4), torch.float32)
        # Topologically Sorted Source Nodes: [conv_transpose2d_2, embeddings_dec3_1], Original ATen: [aten.convolution, aten.native_group_norm]
        triton_red_fused_convolution_native_group_norm_2.run(buf15, primals_11, primals_12, primals_13, buf16, buf19, buf20, 4, 8192, grid=grid(4), stream=stream0)
        del primals_11
        del primals_13
        # Topologically Sorted Source Nodes: [conv_transpose2d_3], Original ATen: [aten.convolution]
        buf21 = extern_kernels.convolution(buf19, primals_14, stride=(2, 2), padding=(3, 7), dilation=(1, 1), transposed=True, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf21, (4, 1, 64, 64), (4096, 4096, 64, 1))
        buf22 = buf21; del buf21  # reuse
        # Topologically Sorted Source Nodes: [conv_transpose2d_3, segment], Original ATen: [aten.convolution, aten.sigmoid]
        triton_poi_fused_convolution_sigmoid_3.run(buf22, primals_15, 16384, grid=grid(16384), stream=stream0)
        del primals_15
    return (buf22, primals_1, primals_2, primals_4, primals_6, primals_8, primals_10, primals_12, primals_14, buf1, buf5, reinterpret_tensor(buf2, (4, 1), (1, 1), 0), reinterpret_tensor(buf6, (4, 1), (1, 1), 0), buf8, buf12, reinterpret_tensor(buf9, (4, 1), (1, 1), 0), reinterpret_tensor(buf13, (4, 1), (1, 1), 0), buf15, buf19, reinterpret_tensor(buf16, (4, 1), (1, 1), 0), reinterpret_tensor(buf20, (4, 1), (1, 1), 0), buf22, )


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, 16, 4, 4), (256, 16, 4, 1), device='cuda:0', dtype=torch.float32)
    primals_2 = rand_strided((16, 32, 8, 16), (4096, 128, 16, 1), device='cuda:0', dtype=torch.float32)
    primals_3 = rand_strided((32, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_4 = rand_strided((32, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_5 = rand_strided((32, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_6 = rand_strided((32, 16, 8, 16), (2048, 128, 16, 1), device='cuda:0', dtype=torch.float32)
    primals_7 = rand_strided((16, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_8 = rand_strided((16, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_9 = rand_strided((16, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_10 = rand_strided((16, 8, 8, 16), (1024, 128, 16, 1), device='cuda:0', dtype=torch.float32)
    primals_11 = rand_strided((8, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_12 = rand_strided((8, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_13 = rand_strided((8, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_14 = rand_strided((8, 1, 8, 16), (128, 128, 16, 1), device='cuda:0', dtype=torch.float32)
    primals_15 = rand_strided((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])
    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
import torch.nn.functional as F


class TextureSegmentation(nn.Module):

    def __init__(self):
        super(TextureSegmentation, self).__init__()
        self.decoder_conv1 = nn.ConvTranspose2d(16, 32, kernel_size=(8, 16),
            stride=2, padding=(3, 7))
        self.decoder_conv1.bias.data.zero_()
        self.decoder_conv1.weight.data[:, :, :, :] = 1 / (8 * 8 * 8
            ) + torch.normal(mean=torch.tensor(0.0), std=torch.tensor(0.0001))
        self.decoder_normalization1 = nn.GroupNorm(1, 32, eps=1e-05, affine
            =True)
        self.decoder_conv2 = nn.ConvTranspose2d(32, 16, kernel_size=(8, 16),
            stride=2, padding=(3, 7), output_padding=0, groups=1, bias=True,
            dilation=1)
        self.decoder_conv2.bias.data.zero_()
        self.decoder_conv2.weight.data[:, :, :, :] = 1 / (8 * 8 * 8
            ) + torch.normal(mean=torch.tensor(0.0), std=torch.tensor(0.0001))
        self.decoder_normalization2 = nn.GroupNorm(1, 16, eps=1e-05, affine
            =True)
        self.decoder_conv3 = nn.ConvTranspose2d(16, 8, kernel_size=(8, 16),
            stride=2, padding=(3, 7), output_padding=0, groups=1, bias=True,
            dilation=1)
        self.decoder_conv3.bias.data.zero_()
        self.decoder_conv3.weight.data[:, :, :, :] = 1 / (4 * 8 * 8
            ) + torch.normal(mean=torch.tensor(0.0), std=torch.tensor(0.001))
        self.decoder_normalization3 = nn.GroupNorm(1, 8, eps=1e-05, affine=True
            )
        self.decoder_conv5 = nn.ConvTranspose2d(8, 1, kernel_size=(8, 16),
            stride=2, padding=(3, 7), output_padding=0, groups=1, bias=True,
            dilation=1)
        self.decoder_conv5.bias.data[:] = -(0.5 / 0.24)
        self.decoder_conv5.weight.data[:, :, :, :] = 1 / (8 * 8 * 8 * 0.24
            ) + torch.normal(mean=torch.tensor(0.0), std=torch.tensor(0.001))

    def forward(self, sample):
        embeddings_dec1 = F.relu(self.decoder_conv1(sample, output_size=
            torch.empty(sample.size()[0], 32, sample.size()[2] * 2, sample.
            size()[3] * 2).size()))
        embeddings_dec1 = self.decoder_normalization1(embeddings_dec1)
        embeddings_dec2 = F.relu(self.decoder_conv2(embeddings_dec1,
            output_size=torch.empty(embeddings_dec1.size()[0], 16, 
            embeddings_dec1.size()[2] * 2, embeddings_dec1.size()[3] * 2).
            size()))
        embeddings_dec2 = self.decoder_normalization2(embeddings_dec2)
        embeddings_dec3 = F.relu(self.decoder_conv3(embeddings_dec2,
            output_size=torch.empty(embeddings_dec2.size()[0], 8, 
            embeddings_dec2.size()[2] * 2, embeddings_dec2.size()[3] * 2).
            size()))
        embeddings_dec3 = self.decoder_normalization3(embeddings_dec3)
        segment = F.sigmoid(self.decoder_conv5(embeddings_dec3, output_size
            =torch.empty(embeddings_dec3.size()[0], 1, embeddings_dec3.size
            ()[2] * 2, embeddings_dec3.size()[3] * 2).size()))
        return segment


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


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
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_red_fused_convolution_native_group_norm_0(in_out_ptr0, in_ptr0,
    in_ptr1, in_ptr2, out_ptr0, out_ptr2, out_ptr3, xnumel, rnumel, XBLOCK:
    tl.constexpr, RBLOCK: tl.constexpr):
    xnumel = 4
    rnumel = 2048
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    rbase = tl.arange(0, RBLOCK)[None, :]
    x0 = xindex
    tmp6_mean = tl.zeros([XBLOCK, RBLOCK], tl.float32)
    tmp6_m2 = tl.zeros([XBLOCK, RBLOCK], tl.float32)
    tmp6_weight = tl.zeros([XBLOCK, RBLOCK], tl.float32)
    for roffset in range(0, rnumel, RBLOCK):
        rindex = roffset + rbase
        rmask = rindex < rnumel
        r3 = rindex
        r2 = rindex // 64
        tmp0 = tl.load(in_out_ptr0 + (r3 + 2048 * x0), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp1 = tl.load(in_ptr0 + r2, rmask, eviction_policy='evict_last',
            other=0.0)
        tmp2 = tmp0 + tmp1
        tmp3 = tl.full([1, 1], 0, tl.int32)
        tmp4 = triton_helpers.maximum(tmp3, tmp2)
        tmp5 = tl.broadcast_to(tmp4, [XBLOCK, RBLOCK])
        tmp6_mean_next, tmp6_m2_next, tmp6_weight_next = (triton_helpers.
            welford_reduce(tmp5, tmp6_mean, tmp6_m2, tmp6_weight, roffset == 0)
            )
        tmp6_mean = tl.where(rmask & xmask, tmp6_mean_next, tmp6_mean)
        tmp6_m2 = tl.where(rmask & xmask, tmp6_m2_next, tmp6_m2)
        tmp6_weight = tl.where(rmask & xmask, tmp6_weight_next, tmp6_weight)
        tl.store(in_out_ptr0 + (r3 + 2048 * x0), tmp2, rmask & xmask)
    tmp6_tmp, tmp7_tmp, tmp8_tmp = triton_helpers.welford(tmp6_mean,
        tmp6_m2, tmp6_weight, 1)
    tmp6 = tmp6_tmp[:, None]
    tmp7 = tmp7_tmp[:, None]
    tmp8_tmp[:, None]
    tl.store(out_ptr0 + x0, tmp6, xmask)
    for roffset in range(0, rnumel, RBLOCK):
        rindex = roffset + rbase
        rmask = rindex < rnumel
        r3 = rindex
        r2 = rindex // 64
        tmp9 = tl.load(in_out_ptr0 + (r3 + 2048 * x0), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp19 = tl.load(in_ptr1 + r2, rmask, eviction_policy='evict_last',
            other=0.0)
        tmp21 = tl.load(in_ptr2 + r2, rmask, eviction_policy='evict_last',
            other=0.0)
        tmp10 = tl.full([1, 1], 0, tl.int32)
        tmp11 = triton_helpers.maximum(tmp10, tmp9)
        tmp12 = tmp11 - tmp6
        tmp13 = 2048.0
        tmp14 = tmp7 / tmp13
        tmp15 = 1e-05
        tmp16 = tmp14 + tmp15
        tmp17 = libdevice.rsqrt(tmp16)
        tmp18 = tmp12 * tmp17
        tmp20 = tmp18 * tmp19
        tmp22 = tmp20 + tmp21
        tl.store(out_ptr2 + (r3 + 2048 * x0), tmp22, rmask & xmask)
    tmp23 = 2048.0
    tmp24 = tmp7 / tmp23
    tmp25 = 1e-05
    tmp26 = tmp24 + tmp25
    tmp27 = libdevice.rsqrt(tmp26)
    tl.store(out_ptr3 + x0, tmp27, xmask)


@triton.jit
def triton_red_fused_convolution_native_group_norm_1(in_out_ptr0, in_ptr0,
    in_ptr1, in_ptr2, out_ptr0, out_ptr2, out_ptr3, xnumel, rnumel, XBLOCK:
    tl.constexpr, RBLOCK: tl.constexpr):
    xnumel = 4
    rnumel = 4096
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    rbase = tl.arange(0, RBLOCK)[None, :]
    x0 = xindex
    tmp6_mean = tl.zeros([XBLOCK, RBLOCK], tl.float32)
    tmp6_m2 = tl.zeros([XBLOCK, RBLOCK], tl.float32)
    tmp6_weight = tl.zeros([XBLOCK, RBLOCK], tl.float32)
    for roffset in range(0, rnumel, RBLOCK):
        rindex = roffset + rbase
        rmask = rindex < rnumel
        r3 = rindex
        r2 = rindex // 256
        tmp0 = tl.load(in_out_ptr0 + (r3 + 4096 * x0), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp1 = tl.load(in_ptr0 + r2, rmask, eviction_policy='evict_last',
            other=0.0)
        tmp2 = tmp0 + tmp1
        tmp3 = tl.full([1, 1], 0, tl.int32)
        tmp4 = triton_helpers.maximum(tmp3, tmp2)
        tmp5 = tl.broadcast_to(tmp4, [XBLOCK, RBLOCK])
        tmp6_mean_next, tmp6_m2_next, tmp6_weight_next = (triton_helpers.
            welford_reduce(tmp5, tmp6_mean, tmp6_m2, tmp6_weight, roffset == 0)
            )
        tmp6_mean = tl.where(rmask & xmask, tmp6_mean_next, tmp6_mean)
        tmp6_m2 = tl.where(rmask & xmask, tmp6_m2_next, tmp6_m2)
        tmp6_weight = tl.where(rmask & xmask, tmp6_weight_next, tmp6_weight)
        tl.store(in_out_ptr0 + (r3 + 4096 * x0), tmp2, rmask & xmask)
    tmp6_tmp, tmp7_tmp, tmp8_tmp = triton_helpers.welford(tmp6_mean,
        tmp6_m2, tmp6_weight, 1)
    tmp6 = tmp6_tmp[:, None]
    tmp7 = tmp7_tmp[:, None]
    tmp8_tmp[:, None]
    tl.store(out_ptr0 + x0, tmp6, xmask)
    for roffset in range(0, rnumel, RBLOCK):
        rindex = roffset + rbase
        rmask = rindex < rnumel
        r3 = rindex
        r2 = rindex // 256
        tmp9 = tl.load(in_out_ptr0 + (r3 + 4096 * x0), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp19 = tl.load(in_ptr1 + r2, rmask, eviction_policy='evict_last',
            other=0.0)
        tmp21 = tl.load(in_ptr2 + r2, rmask, eviction_policy='evict_last',
            other=0.0)
        tmp10 = tl.full([1, 1], 0, tl.int32)
        tmp11 = triton_helpers.maximum(tmp10, tmp9)
        tmp12 = tmp11 - tmp6
        tmp13 = 4096.0
        tmp14 = tmp7 / tmp13
        tmp15 = 1e-05
        tmp16 = tmp14 + tmp15
        tmp17 = libdevice.rsqrt(tmp16)
        tmp18 = tmp12 * tmp17
        tmp20 = tmp18 * tmp19
        tmp22 = tmp20 + tmp21
        tl.store(out_ptr2 + (r3 + 4096 * x0), tmp22, rmask & xmask)
    tmp23 = 4096.0
    tmp24 = tmp7 / tmp23
    tmp25 = 1e-05
    tmp26 = tmp24 + tmp25
    tmp27 = libdevice.rsqrt(tmp26)
    tl.store(out_ptr3 + x0, tmp27, xmask)


@triton.jit
def triton_red_fused_convolution_native_group_norm_2(in_out_ptr0, in_ptr0,
    in_ptr1, in_ptr2, out_ptr0, out_ptr2, out_ptr3, 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
    tmp6_mean = tl.zeros([XBLOCK, RBLOCK], tl.float32)
    tmp6_m2 = tl.zeros([XBLOCK, RBLOCK], tl.float32)
    tmp6_weight = tl.zeros([XBLOCK, RBLOCK], tl.float32)
    for roffset in range(0, rnumel, RBLOCK):
        rindex = roffset + rbase
        rmask = rindex < rnumel
        r3 = rindex
        r2 = rindex // 1024
        tmp0 = tl.load(in_out_ptr0 + (r3 + 8192 * x0), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp1 = tl.load(in_ptr0 + r2, rmask, eviction_policy='evict_last',
            other=0.0)
        tmp2 = tmp0 + tmp1
        tmp3 = tl.full([1, 1], 0, tl.int32)
        tmp4 = triton_helpers.maximum(tmp3, tmp2)
        tmp5 = tl.broadcast_to(tmp4, [XBLOCK, RBLOCK])
        tmp6_mean_next, tmp6_m2_next, tmp6_weight_next = (triton_helpers.
            welford_reduce(tmp5, tmp6_mean, tmp6_m2, tmp6_weight, roffset == 0)
            )
        tmp6_mean = tl.where(rmask & xmask, tmp6_mean_next, tmp6_mean)
        tmp6_m2 = tl.where(rmask & xmask, tmp6_m2_next, tmp6_m2)
        tmp6_weight = tl.where(rmask & xmask, tmp6_weight_next, tmp6_weight)
        tl.store(in_out_ptr0 + (r3 + 8192 * x0), tmp2, rmask & xmask)
    tmp6_tmp, tmp7_tmp, tmp8_tmp = triton_helpers.welford(tmp6_mean,
        tmp6_m2, tmp6_weight, 1)
    tmp6 = tmp6_tmp[:, None]
    tmp7 = tmp7_tmp[:, None]
    tmp8_tmp[:, None]
    tl.store(out_ptr0 + x0, tmp6, xmask)
    for roffset in range(0, rnumel, RBLOCK):
        rindex = roffset + rbase
        rmask = rindex < rnumel
        r3 = rindex
        r2 = rindex // 1024
        tmp9 = tl.load(in_out_ptr0 + (r3 + 8192 * x0), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp19 = tl.load(in_ptr1 + r2, rmask, eviction_policy='evict_last',
            other=0.0)
        tmp21 = tl.load(in_ptr2 + r2, rmask, eviction_policy='evict_last',
            other=0.0)
        tmp10 = tl.full([1, 1], 0, tl.int32)
        tmp11 = triton_helpers.maximum(tmp10, tmp9)
        tmp12 = tmp11 - tmp6
        tmp13 = 8192.0
        tmp14 = tmp7 / tmp13
        tmp15 = 1e-05
        tmp16 = tmp14 + tmp15
        tmp17 = libdevice.rsqrt(tmp16)
        tmp18 = tmp12 * tmp17
        tmp20 = tmp18 * tmp19
        tmp22 = tmp20 + tmp21
        tl.store(out_ptr2 + (r3 + 8192 * x0), tmp22, rmask & xmask)
    tmp23 = 8192.0
    tmp24 = tmp7 / tmp23
    tmp25 = 1e-05
    tmp26 = tmp24 + tmp25
    tmp27 = libdevice.rsqrt(tmp26)
    tl.store(out_ptr3 + x0, tmp27, xmask)


@triton.jit
def triton_poi_fused_convolution_sigmoid_3(in_out_ptr0, in_ptr0, xnumel,
    XBLOCK: tl.constexpr):
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    tl.full([XBLOCK], True, tl.int1)
    x0 = xindex
    tmp0 = tl.load(in_out_ptr0 + x0, None)
    tmp1 = tl.load(in_ptr0 + 0)
    tmp2 = tl.broadcast_to(tmp1, [XBLOCK])
    tmp3 = tmp0 + tmp2
    tmp4 = tl.sigmoid(tmp3)
    tl.store(in_out_ptr0 + x0, tmp4, None)


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) = args
    args.clear()
    assert_size_stride(primals_1, (4, 16, 4, 4), (256, 16, 4, 1))
    assert_size_stride(primals_2, (16, 32, 8, 16), (4096, 128, 16, 1))
    assert_size_stride(primals_3, (32,), (1,))
    assert_size_stride(primals_4, (32,), (1,))
    assert_size_stride(primals_5, (32,), (1,))
    assert_size_stride(primals_6, (32, 16, 8, 16), (2048, 128, 16, 1))
    assert_size_stride(primals_7, (16,), (1,))
    assert_size_stride(primals_8, (16,), (1,))
    assert_size_stride(primals_9, (16,), (1,))
    assert_size_stride(primals_10, (16, 8, 8, 16), (1024, 128, 16, 1))
    assert_size_stride(primals_11, (8,), (1,))
    assert_size_stride(primals_12, (8,), (1,))
    assert_size_stride(primals_13, (8,), (1,))
    assert_size_stride(primals_14, (8, 1, 8, 16), (128, 128, 16, 1))
    assert_size_stride(primals_15, (1,), (1,))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = extern_kernels.convolution(primals_1, primals_2, stride=(2, 
            2), padding=(3, 7), dilation=(1, 1), transposed=True,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf0, (4, 32, 8, 8), (2048, 64, 8, 1))
        buf1 = buf0
        del buf0
        buf2 = empty_strided_cuda((4, 1, 1, 1), (1, 4, 4, 4), torch.float32)
        buf5 = empty_strided_cuda((4, 32, 8, 8), (2048, 64, 8, 1), torch.
            float32)
        buf6 = empty_strided_cuda((4, 1, 1, 1), (1, 4, 4, 4), torch.float32)
        get_raw_stream(0)
        triton_red_fused_convolution_native_group_norm_0[grid(4)](buf1,
            primals_3, primals_4, primals_5, buf2, buf5, buf6, 4, 2048,
            XBLOCK=1, RBLOCK=2048, num_warps=16, num_stages=1)
        del primals_3
        del primals_5
        buf7 = extern_kernels.convolution(buf5, primals_6, stride=(2, 2),
            padding=(3, 7), dilation=(1, 1), transposed=True,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf7, (4, 16, 16, 16), (4096, 256, 16, 1))
        buf8 = buf7
        del buf7
        buf9 = empty_strided_cuda((4, 1, 1, 1), (1, 4, 4, 4), torch.float32)
        buf12 = empty_strided_cuda((4, 16, 16, 16), (4096, 256, 16, 1),
            torch.float32)
        buf13 = empty_strided_cuda((4, 1, 1, 1), (1, 4, 4, 4), torch.float32)
        triton_red_fused_convolution_native_group_norm_1[grid(4)](buf8,
            primals_7, primals_8, primals_9, buf9, buf12, buf13, 4, 4096,
            XBLOCK=1, RBLOCK=2048, num_warps=16, num_stages=1)
        del primals_7
        del primals_9
        buf14 = extern_kernels.convolution(buf12, primals_10, stride=(2, 2),
            padding=(3, 7), dilation=(1, 1), transposed=True,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf14, (4, 8, 32, 32), (8192, 1024, 32, 1))
        buf15 = buf14
        del buf14
        buf16 = empty_strided_cuda((4, 1, 1, 1), (1, 4, 4, 4), torch.float32)
        buf19 = empty_strided_cuda((4, 8, 32, 32), (8192, 1024, 32, 1),
            torch.float32)
        buf20 = empty_strided_cuda((4, 1, 1, 1), (1, 4, 4, 4), torch.float32)
        triton_red_fused_convolution_native_group_norm_2[grid(4)](buf15,
            primals_11, primals_12, primals_13, buf16, buf19, buf20, 4, 
            8192, XBLOCK=1, RBLOCK=2048, num_warps=16, num_stages=1)
        del primals_11
        del primals_13
        buf21 = extern_kernels.convolution(buf19, primals_14, stride=(2, 2),
            padding=(3, 7), dilation=(1, 1), transposed=True,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf21, (4, 1, 64, 64), (4096, 4096, 64, 1))
        buf22 = buf21
        del buf21
        triton_poi_fused_convolution_sigmoid_3[grid(16384)](buf22,
            primals_15, 16384, XBLOCK=128, num_warps=4, num_stages=1)
        del primals_15
    return (buf22, primals_1, primals_2, primals_4, primals_6, primals_8,
        primals_10, primals_12, primals_14, buf1, buf5, reinterpret_tensor(
        buf2, (4, 1), (1, 1), 0), reinterpret_tensor(buf6, (4, 1), (1, 1), 
        0), buf8, buf12, reinterpret_tensor(buf9, (4, 1), (1, 1), 0),
        reinterpret_tensor(buf13, (4, 1), (1, 1), 0), buf15, buf19,
        reinterpret_tensor(buf16, (4, 1), (1, 1), 0), reinterpret_tensor(
        buf20, (4, 1), (1, 1), 0), buf22)


class TextureSegmentationNew(nn.Module):

    def __init__(self):
        super(TextureSegmentationNew, self).__init__()
        self.decoder_conv1 = nn.ConvTranspose2d(16, 32, kernel_size=(8, 16),
            stride=2, padding=(3, 7))
        self.decoder_conv1.bias.data.zero_()
        self.decoder_conv1.weight.data[:, :, :, :] = 1 / (8 * 8 * 8
            ) + torch.normal(mean=torch.tensor(0.0), std=torch.tensor(0.0001))
        self.decoder_normalization1 = nn.GroupNorm(1, 32, eps=1e-05, affine
            =True)
        self.decoder_conv2 = nn.ConvTranspose2d(32, 16, kernel_size=(8, 16),
            stride=2, padding=(3, 7), output_padding=0, groups=1, bias=True,
            dilation=1)
        self.decoder_conv2.bias.data.zero_()
        self.decoder_conv2.weight.data[:, :, :, :] = 1 / (8 * 8 * 8
            ) + torch.normal(mean=torch.tensor(0.0), std=torch.tensor(0.0001))
        self.decoder_normalization2 = nn.GroupNorm(1, 16, eps=1e-05, affine
            =True)
        self.decoder_conv3 = nn.ConvTranspose2d(16, 8, kernel_size=(8, 16),
            stride=2, padding=(3, 7), output_padding=0, groups=1, bias=True,
            dilation=1)
        self.decoder_conv3.bias.data.zero_()
        self.decoder_conv3.weight.data[:, :, :, :] = 1 / (4 * 8 * 8
            ) + torch.normal(mean=torch.tensor(0.0), std=torch.tensor(0.001))
        self.decoder_normalization3 = nn.GroupNorm(1, 8, eps=1e-05, affine=True
            )
        self.decoder_conv5 = nn.ConvTranspose2d(8, 1, kernel_size=(8, 16),
            stride=2, padding=(3, 7), output_padding=0, groups=1, bias=True,
            dilation=1)
        self.decoder_conv5.bias.data[:] = -(0.5 / 0.24)
        self.decoder_conv5.weight.data[:, :, :, :] = 1 / (8 * 8 * 8 * 0.24
            ) + torch.normal(mean=torch.tensor(0.0), std=torch.tensor(0.001))

    def forward(self, input_0):
        primals_2 = self.decoder_conv1.weight
        primals_3 = self.decoder_conv1.bias
        primals_4 = self.decoder_normalization1.weight
        primals_5 = self.decoder_normalization1.bias
        primals_6 = self.decoder_conv2.weight
        primals_7 = self.decoder_conv2.bias
        primals_8 = self.decoder_normalization2.weight
        primals_9 = self.decoder_normalization2.bias
        primals_10 = self.decoder_conv3.weight
        primals_11 = self.decoder_conv3.bias
        primals_12 = self.decoder_normalization3.weight
        primals_13 = self.decoder_normalization3.bias
        primals_14 = self.decoder_conv5.weight
        primals_15 = self.decoder_conv5.bias
        primals_1 = 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])
        return output[0]
