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
import torch.utils.data
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_0(in_ptr0, out_ptr0, ynumel, xnumel, YBLOCK: tl.
    constexpr, XBLOCK: tl.constexpr):
    ynumel = 192
    xnumel = 9
    yoffset = tl.program_id(1) * YBLOCK
    yindex = yoffset + tl.arange(0, YBLOCK)[None, :]
    ymask = yindex < ynumel
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    x2 = xindex
    y3 = yindex
    y0 = yindex % 3
    y1 = yindex // 3
    tmp0 = tl.load(in_ptr0 + (x2 + 9 * y3), xmask & ymask, eviction_policy=
        'evict_last')
    tl.store(out_ptr0 + (y0 + 3 * x2 + 27 * y1), tmp0, xmask & ymask)


@triton.jit
def triton_poi_fused_1(in_ptr0, out_ptr0, ynumel, xnumel, YBLOCK: tl.
    constexpr, XBLOCK: tl.constexpr):
    ynumel = 12
    yoffset = tl.program_id(1) * YBLOCK
    yindex = yoffset + tl.arange(0, YBLOCK)[None, :]
    ymask = yindex < ynumel
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    tl.full([XBLOCK, YBLOCK], True, tl.int1)
    x2 = xindex
    y3 = yindex
    y0 = yindex % 3
    y1 = yindex // 3
    tmp0 = tl.load(in_ptr0 + (x2 + 4096 * y3), ymask, eviction_policy=
        'evict_last')
    tl.store(out_ptr0 + (y0 + 3 * x2 + 12288 * y1), tmp0, ymask)


@triton.jit
def triton_poi_fused_2(in_ptr0, out_ptr0, ynumel, xnumel, YBLOCK: tl.
    constexpr, XBLOCK: tl.constexpr):
    xnumel = 9
    yoffset = tl.program_id(1) * YBLOCK
    yindex = yoffset + tl.arange(0, YBLOCK)[None, :]
    tl.full([XBLOCK, YBLOCK], True, tl.int1)
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    x2 = xindex
    y3 = yindex
    y0 = yindex % 64
    y1 = yindex // 64
    tmp0 = tl.load(in_ptr0 + (x2 + 9 * y3), xmask, eviction_policy='evict_last'
        )
    tl.store(out_ptr0 + (y0 + 64 * x2 + 576 * y1), tmp0, xmask)


@triton.jit
def triton_poi_fused_3(in_ptr0, out_ptr0, ynumel, xnumel, YBLOCK: tl.
    constexpr, XBLOCK: tl.constexpr):
    xnumel = 9
    yoffset = tl.program_id(1) * YBLOCK
    yindex = yoffset + tl.arange(0, YBLOCK)[None, :]
    tl.full([XBLOCK, YBLOCK], True, tl.int1)
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    x2 = xindex
    y3 = yindex
    y0 = yindex % 128
    y1 = yindex // 128
    tmp0 = tl.load(in_ptr0 + (x2 + 9 * y3), xmask, eviction_policy='evict_last'
        )
    tl.store(out_ptr0 + (y0 + 128 * x2 + 1152 * y1), tmp0, xmask)


@triton.jit
def triton_poi_fused_convolution_4(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)
    x2 = xindex
    x0 = xindex % 64
    tmp0 = tl.load(in_out_ptr0 + x2, None)
    tmp1 = tl.load(in_ptr0 + x0, None, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tl.store(in_out_ptr0 + x2, tmp2, None)


@triton.jit
def triton_per_fused_native_group_norm_5(in_ptr0, out_ptr0, out_ptr1,
    out_ptr2, xnumel, rnumel, XBLOCK: tl.constexpr):
    RBLOCK: tl.constexpr = 128
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    tl.full([XBLOCK, RBLOCK], True, tl.int1)
    rindex = tl.arange(0, RBLOCK)[None, :]
    tl.full([XBLOCK, RBLOCK], True, tl.int1)
    r3 = rindex
    x0 = xindex % 32
    x1 = xindex // 32 % 64
    x2 = xindex // 2048
    x4 = xindex
    tmp0 = tl.load(in_ptr0 + (2 * x0 + 64 * ((r3 + 128 * x1) % 4096) + 
        262144 * x2 + (r3 + 128 * x1) // 4096), None, eviction_policy=
        'evict_last')
    tmp1 = tl.full([1, 1], 0, tl.int32)
    tmp2 = triton_helpers.maximum(tmp1, tmp0)
    tmp3 = tl.broadcast_to(tmp2, [XBLOCK, RBLOCK])
    tmp5 = tl.broadcast_to(tmp3, [XBLOCK, RBLOCK])
    tmp7 = tl.sum(tmp5, 1)[:, None]
    tmp8 = tl.full([XBLOCK, 1], 128, tl.int32)
    tmp9 = tmp8.to(tl.float32)
    tmp10 = tmp7 / tmp9
    tmp11 = tmp3 - tmp10
    tmp12 = tmp11 * tmp11
    tmp13 = tl.broadcast_to(tmp12, [XBLOCK, RBLOCK])
    tmp15 = tl.sum(tmp13, 1)[:, None]
    tl.store(out_ptr0 + x4, tmp10, None)
    tl.store(out_ptr1 + x4, tmp15, None)
    tl.store(out_ptr2 + x4, tmp9, None)


@triton.jit
def triton_per_fused_native_group_norm_6(in_ptr0, in_ptr1, in_ptr2,
    out_ptr0, out_ptr1, out_ptr2, xnumel, rnumel, XBLOCK: tl.constexpr):
    xnumel = 128
    RBLOCK: tl.constexpr = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    rindex = tl.arange(0, RBLOCK)[None, :]
    tl.full([XBLOCK, RBLOCK], True, tl.int1)
    r2 = rindex
    x0 = xindex % 32
    x1 = xindex // 32
    x3 = xindex
    tmp0 = tl.load(in_ptr0 + (x0 + 32 * r2 + 2048 * x1), xmask, other=0.0)
    tmp1 = tl.load(in_ptr1 + (x0 + 32 * r2 + 2048 * x1), xmask, other=0.0)
    tmp2 = tl.load(in_ptr2 + (x0 + 32 * r2 + 2048 * x1), xmask, other=0.0)
    tmp3 = tl.broadcast_to(tmp0, [XBLOCK, RBLOCK])
    tmp4 = tl.broadcast_to(tmp1, [XBLOCK, RBLOCK])
    tmp5 = tl.broadcast_to(tmp2, [XBLOCK, RBLOCK])
    tmp7 = tl.where(xmask, tmp3, 0)
    tmp8 = tl.where(xmask, tmp4, 0)
    tmp9 = tl.where(xmask, tmp5, 0)
    tmp10, tmp11, tmp12 = triton_helpers.welford(tmp7, tmp8, tmp9, 1)
    tmp13 = tmp10[:, None]
    tmp14 = tmp11[:, None]
    tmp15 = tmp12[:, None]
    tl.store(out_ptr0 + x3, tmp13, xmask)
    tl.store(out_ptr1 + x3, tmp14, xmask)
    tl.store(out_ptr2 + x3, tmp15, xmask)


@triton.jit
def triton_per_fused_native_group_norm_7(in_ptr0, in_ptr1, in_ptr2,
    out_ptr0, out_ptr1, out_ptr2, xnumel, rnumel, XBLOCK: tl.constexpr):
    xnumel = 32
    RBLOCK: tl.constexpr = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    rindex = tl.arange(0, RBLOCK)[None, :]
    tl.full([XBLOCK, RBLOCK], True, tl.int1)
    r1 = rindex
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + (r1 + 4 * x0), xmask, other=0.0)
    tmp1 = tl.load(in_ptr1 + (r1 + 4 * x0), xmask, other=0.0)
    tmp2 = tl.load(in_ptr2 + (r1 + 4 * x0), xmask, other=0.0)
    tmp3 = tl.broadcast_to(tmp0, [XBLOCK, RBLOCK])
    tmp4 = tl.broadcast_to(tmp1, [XBLOCK, RBLOCK])
    tmp5 = tl.broadcast_to(tmp2, [XBLOCK, RBLOCK])
    tmp7 = tl.where(xmask, tmp3, 0)
    tmp8 = tl.where(xmask, tmp4, 0)
    tmp9 = tl.where(xmask, tmp5, 0)
    tmp10, tmp11, tmp12 = triton_helpers.welford(tmp7, tmp8, tmp9, 1)
    tmp13 = tmp10[:, None]
    tmp14 = tmp11[:, None]
    tmp12[:, None]
    tmp16 = 32768.0
    tmp17 = tmp14 / tmp16
    tmp18 = 1e-05
    tmp19 = tmp17 + tmp18
    tmp20 = libdevice.rsqrt(tmp19)
    tl.store(out_ptr2 + x0, tmp20, xmask)
    tl.store(out_ptr0 + x0, tmp13, xmask)
    tl.store(out_ptr1 + x0, tmp14, xmask)


@triton.jit
def triton_poi_fused_native_group_norm_8(in_ptr0, in_ptr1, in_ptr2, in_ptr3,
    in_ptr4, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    tl.full([XBLOCK], True, tl.int1)
    x3 = xindex
    x0 = xindex % 64
    x2 = xindex // 262144
    tmp0 = tl.load(in_ptr0 + x3, None)
    tmp3 = tl.load(in_ptr1 + (8 * x2 + x0 // 8), None, eviction_policy=
        'evict_last')
    tmp5 = tl.load(in_ptr2 + (8 * x2 + x0 // 8), None, eviction_policy=
        'evict_last')
    tmp12 = tl.load(in_ptr3 + x0, None, eviction_policy='evict_last')
    tmp14 = tl.load(in_ptr4 + x0, None, eviction_policy='evict_last')
    tmp1 = tl.full([1], 0, tl.int32)
    tmp2 = triton_helpers.maximum(tmp1, tmp0)
    tmp4 = tmp2 - tmp3
    tmp6 = 32768.0
    tmp7 = tmp5 / tmp6
    tmp8 = 1e-05
    tmp9 = tmp7 + tmp8
    tmp10 = libdevice.rsqrt(tmp9)
    tmp11 = tmp4 * tmp10
    tmp13 = tmp11 * tmp12
    tmp15 = tmp13 + tmp14
    tl.store(out_ptr0 + x3, tmp15, None)


@triton.jit
def triton_poi_fused_convolution_9(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)
    x2 = xindex
    x0 = xindex % 128
    tmp0 = tl.load(in_out_ptr0 + x2, None)
    tmp1 = tl.load(in_ptr0 + x0, None, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tl.store(in_out_ptr0 + x2, tmp2, None)


@triton.jit
def triton_per_fused_native_group_norm_10(in_ptr0, out_ptr0, out_ptr1,
    out_ptr2, xnumel, rnumel, XBLOCK: tl.constexpr):
    RBLOCK: tl.constexpr = 128
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    tl.full([XBLOCK, RBLOCK], True, tl.int1)
    rindex = tl.arange(0, RBLOCK)[None, :]
    tl.full([XBLOCK, RBLOCK], True, tl.int1)
    r3 = rindex
    x0 = xindex % 16
    x1 = xindex // 16 % 64
    x2 = xindex // 1024
    x4 = xindex
    tmp0 = tl.load(in_ptr0 + (8 * x0 + 128 * ((r3 + 128 * x1) % 1024) + 
        131072 * x2 + (r3 + 128 * x1) // 1024), None, eviction_policy=
        'evict_last')
    tmp1 = tl.full([1, 1], 0, tl.int32)
    tmp2 = triton_helpers.maximum(tmp1, tmp0)
    tmp3 = tl.broadcast_to(tmp2, [XBLOCK, RBLOCK])
    tmp5 = tl.broadcast_to(tmp3, [XBLOCK, RBLOCK])
    tmp7 = tl.sum(tmp5, 1)[:, None]
    tmp8 = tl.full([XBLOCK, 1], 128, tl.int32)
    tmp9 = tmp8.to(tl.float32)
    tmp10 = tmp7 / tmp9
    tmp11 = tmp3 - tmp10
    tmp12 = tmp11 * tmp11
    tmp13 = tl.broadcast_to(tmp12, [XBLOCK, RBLOCK])
    tmp15 = tl.sum(tmp13, 1)[:, None]
    tl.store(out_ptr0 + x4, tmp10, None)
    tl.store(out_ptr1 + x4, tmp15, None)
    tl.store(out_ptr2 + x4, tmp9, None)


@triton.jit
def triton_per_fused_native_group_norm_11(in_ptr0, in_ptr1, in_ptr2,
    out_ptr0, out_ptr1, out_ptr2, xnumel, rnumel, XBLOCK: tl.constexpr):
    xnumel = 64
    RBLOCK: tl.constexpr = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    rindex = tl.arange(0, RBLOCK)[None, :]
    tl.full([XBLOCK, RBLOCK], True, tl.int1)
    r2 = rindex
    x0 = xindex % 16
    x1 = xindex // 16
    x3 = xindex
    tmp0 = tl.load(in_ptr0 + (x0 + 16 * r2 + 1024 * x1), xmask, other=0.0)
    tmp1 = tl.load(in_ptr1 + (x0 + 16 * r2 + 1024 * x1), xmask, other=0.0)
    tmp2 = tl.load(in_ptr2 + (x0 + 16 * r2 + 1024 * x1), xmask, other=0.0)
    tmp3 = tl.broadcast_to(tmp0, [XBLOCK, RBLOCK])
    tmp4 = tl.broadcast_to(tmp1, [XBLOCK, RBLOCK])
    tmp5 = tl.broadcast_to(tmp2, [XBLOCK, RBLOCK])
    tmp7 = tl.where(xmask, tmp3, 0)
    tmp8 = tl.where(xmask, tmp4, 0)
    tmp9 = tl.where(xmask, tmp5, 0)
    tmp10, tmp11, tmp12 = triton_helpers.welford(tmp7, tmp8, tmp9, 1)
    tmp13 = tmp10[:, None]
    tmp14 = tmp11[:, None]
    tmp15 = tmp12[:, None]
    tl.store(out_ptr0 + x3, tmp13, xmask)
    tl.store(out_ptr1 + x3, tmp14, xmask)
    tl.store(out_ptr2 + x3, tmp15, xmask)


@triton.jit
def triton_per_fused_native_group_norm_12(in_ptr0, in_ptr1, in_ptr2,
    out_ptr0, out_ptr1, out_ptr2, xnumel, rnumel, XBLOCK: tl.constexpr):
    xnumel = 32
    RBLOCK: tl.constexpr = 2
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    rindex = tl.arange(0, RBLOCK)[None, :]
    tl.full([XBLOCK, RBLOCK], True, tl.int1)
    r1 = rindex
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + (r1 + 2 * x0), xmask, other=0.0)
    tmp1 = tl.load(in_ptr1 + (r1 + 2 * x0), xmask, other=0.0)
    tmp2 = tl.load(in_ptr2 + (r1 + 2 * x0), xmask, other=0.0)
    tmp3 = tl.broadcast_to(tmp0, [XBLOCK, RBLOCK])
    tmp4 = tl.broadcast_to(tmp1, [XBLOCK, RBLOCK])
    tmp5 = tl.broadcast_to(tmp2, [XBLOCK, RBLOCK])
    tmp7 = tl.where(xmask, tmp3, 0)
    tmp8 = tl.where(xmask, tmp4, 0)
    tmp9 = tl.where(xmask, tmp5, 0)
    tmp10, tmp11, tmp12 = triton_helpers.welford(tmp7, tmp8, tmp9, 1)
    tmp13 = tmp10[:, None]
    tmp14 = tmp11[:, None]
    tmp12[:, None]
    tmp16 = 16384.0
    tmp17 = tmp14 / tmp16
    tmp18 = 1e-05
    tmp19 = tmp17 + tmp18
    tmp20 = libdevice.rsqrt(tmp19)
    tl.store(out_ptr2 + x0, tmp20, xmask)
    tl.store(out_ptr0 + x0, tmp13, xmask)
    tl.store(out_ptr1 + x0, tmp14, xmask)


@triton.jit
def triton_poi_fused_native_group_norm_13(in_ptr0, in_ptr1, in_ptr2,
    in_ptr3, in_ptr4, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    tl.full([XBLOCK], True, tl.int1)
    x3 = xindex
    x0 = xindex % 128
    x2 = xindex // 131072
    tmp0 = tl.load(in_ptr0 + x3, None)
    tmp3 = tl.load(in_ptr1 + (8 * x2 + x0 // 16), None, eviction_policy=
        'evict_last')
    tmp5 = tl.load(in_ptr2 + (8 * x2 + x0 // 16), None, eviction_policy=
        'evict_last')
    tmp12 = tl.load(in_ptr3 + x0, None, eviction_policy='evict_last')
    tmp14 = tl.load(in_ptr4 + x0, None, eviction_policy='evict_last')
    tmp1 = tl.full([1], 0, tl.int32)
    tmp2 = triton_helpers.maximum(tmp1, tmp0)
    tmp4 = tmp2 - tmp3
    tmp6 = 16384.0
    tmp7 = tmp5 / tmp6
    tmp8 = 1e-05
    tmp9 = tmp7 + tmp8
    tmp10 = libdevice.rsqrt(tmp9)
    tmp11 = tmp4 * tmp10
    tmp13 = tmp11 * tmp12
    tmp15 = tmp13 + tmp14
    tl.store(out_ptr0 + x3, tmp15, None)


@triton.jit
def triton_red_fused_mean_native_group_norm_14(in_ptr0, in_ptr1, in_ptr2,
    in_ptr3, in_ptr4, out_ptr0, xnumel, rnumel, XBLOCK: tl.constexpr,
    RBLOCK: tl.constexpr):
    rnumel = 128
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    tl.full([XBLOCK, RBLOCK], True, tl.int1)
    rbase = tl.arange(0, RBLOCK)[None, :]
    x0 = xindex % 128
    x4 = xindex // 128
    x2 = xindex // 1024
    tmp3 = tl.load(in_ptr1 + (8 * x2 + x0 // 16), None, eviction_policy=
        'evict_last')
    tmp5 = tl.load(in_ptr2 + (8 * x2 + x0 // 16), None, eviction_policy=
        'evict_last')
    tmp12 = tl.load(in_ptr3 + x0, None, eviction_policy='evict_last')
    tmp14 = tl.load(in_ptr4 + x0, None, eviction_policy='evict_last')
    _tmp17 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    x5 = xindex
    for roffset in range(0, rnumel, RBLOCK):
        rindex = roffset + rbase
        rmask = rindex < rnumel
        r3 = rindex
        tmp0 = tl.load(in_ptr0 + (x0 + 128 * r3 + 4096 * (r3 % 32 // 32) + 
            16384 * x4), rmask, eviction_policy='evict_last', other=0.0)
        tmp1 = tl.full([1, 1], 0, tl.int32)
        tmp2 = triton_helpers.maximum(tmp1, tmp0)
        tmp4 = tmp2 - tmp3
        tmp6 = 16384.0
        tmp7 = tmp5 / tmp6
        tmp8 = 1e-05
        tmp9 = tmp7 + tmp8
        tmp10 = libdevice.rsqrt(tmp9)
        tmp11 = tmp4 * tmp10
        tmp13 = tmp11 * tmp12
        tmp15 = tmp13 + tmp14
        tmp16 = tl.broadcast_to(tmp15, [XBLOCK, RBLOCK])
        tmp18 = _tmp17 + tmp16
        _tmp17 = tl.where(rmask, tmp18, _tmp17)
    tmp17 = tl.sum(_tmp17, 1)[:, None]
    tl.store(out_ptr0 + x5, tmp17, None)


@triton.jit
def triton_per_fused_mean_native_group_norm_15(in_out_ptr0, in_ptr0, xnumel,
    rnumel, XBLOCK: tl.constexpr):
    xnumel = 512
    RBLOCK: tl.constexpr = 8
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    rindex = tl.arange(0, RBLOCK)[None, :]
    tl.full([XBLOCK, RBLOCK], True, tl.int1)
    r2 = rindex
    x0 = xindex % 128
    x1 = xindex // 128
    x3 = xindex
    tmp0 = tl.load(in_ptr0 + (x0 + 128 * r2 + 1024 * x1), xmask, other=0.0)
    tmp1 = tl.broadcast_to(tmp0, [XBLOCK, RBLOCK])
    tmp3 = tl.where(xmask, tmp1, 0)
    tmp4 = tl.sum(tmp3, 1)[:, None]
    tmp5 = 1024.0
    tmp6 = tmp4 / tmp5
    tl.debug_barrier()
    tl.store(in_out_ptr0 + x3, tmp6, 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, (64, 3, 3, 3), (27, 9, 3, 1))
    assert_size_stride(primals_2, (64,), (1,))
    assert_size_stride(primals_3, (4, 3, 64, 64), (12288, 4096, 64, 1))
    assert_size_stride(primals_4, (64,), (1,))
    assert_size_stride(primals_5, (64,), (1,))
    assert_size_stride(primals_6, (128, 64, 3, 3), (576, 9, 3, 1))
    assert_size_stride(primals_7, (128,), (1,))
    assert_size_stride(primals_8, (128,), (1,))
    assert_size_stride(primals_9, (128,), (1,))
    assert_size_stride(primals_10, (128, 128, 3, 3), (1152, 9, 3, 1))
    assert_size_stride(primals_11, (128,), (1,))
    assert_size_stride(primals_12, (128,), (1,))
    assert_size_stride(primals_13, (128,), (1,))
    assert_size_stride(primals_14, (128, 128, 3, 3), (1152, 9, 3, 1))
    assert_size_stride(primals_15, (128,), (1,))
    assert_size_stride(primals_16, (128,), (1,))
    assert_size_stride(primals_17, (128,), (1,))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = empty_strided_cuda((64, 3, 3, 3), (27, 1, 9, 3), torch.float32)
        get_raw_stream(0)
        triton_poi_fused_0[grid(192, 9)](primals_1, buf0, 192, 9, XBLOCK=16,
            YBLOCK=64, num_warps=4, num_stages=1)
        del primals_1
        buf1 = empty_strided_cuda((4, 3, 64, 64), (12288, 1, 192, 3), torch
            .float32)
        triton_poi_fused_1[grid(12, 4096)](primals_3, buf1, 12, 4096,
            XBLOCK=64, YBLOCK=16, num_warps=4, num_stages=1)
        del primals_3
        buf2 = empty_strided_cuda((128, 64, 3, 3), (576, 1, 192, 64), torch
            .float32)
        triton_poi_fused_2[grid(8192, 9)](primals_6, buf2, 8192, 9, XBLOCK=
            16, YBLOCK=64, num_warps=4, num_stages=1)
        del primals_6
        buf3 = empty_strided_cuda((128, 128, 3, 3), (1152, 1, 384, 128),
            torch.float32)
        triton_poi_fused_3[grid(16384, 9)](primals_10, buf3, 16384, 9,
            XBLOCK=16, YBLOCK=64, num_warps=4, num_stages=1)
        del primals_10
        buf4 = empty_strided_cuda((128, 128, 3, 3), (1152, 1, 384, 128),
            torch.float32)
        triton_poi_fused_3[grid(16384, 9)](primals_14, buf4, 16384, 9,
            XBLOCK=16, YBLOCK=64, num_warps=4, num_stages=1)
        del primals_14
        buf5 = extern_kernels.convolution(buf1, buf0, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf5, (4, 64, 64, 64), (262144, 1, 4096, 64))
        buf6 = buf5
        del buf5
        triton_poi_fused_convolution_4[grid(1048576)](buf6, primals_2, 
            1048576, XBLOCK=1024, num_warps=4, num_stages=1)
        del primals_2
        buf7 = empty_strided_cuda((4, 8, 1, 1, 4, 64), (2048, 4, 8192, 8192,
            1, 32), torch.float32)
        buf8 = empty_strided_cuda((4, 8, 1, 1, 4, 64), (2048, 4, 8192, 8192,
            1, 32), torch.float32)
        buf9 = empty_strided_cuda((4, 8, 1, 1, 4, 64), (2048, 4, 8192, 8192,
            1, 32), torch.float32)
        triton_per_fused_native_group_norm_5[grid(8192)](buf6, buf7, buf8,
            buf9, 8192, 128, XBLOCK=8, num_warps=8, num_stages=1)
        buf10 = empty_strided_cuda((4, 8, 1, 1, 4), (32, 4, 128, 128, 1),
            torch.float32)
        buf11 = empty_strided_cuda((4, 8, 1, 1, 4), (32, 4, 128, 128, 1),
            torch.float32)
        buf12 = empty_strided_cuda((4, 8, 1, 1, 4), (32, 4, 128, 128, 1),
            torch.float32)
        triton_per_fused_native_group_norm_6[grid(128)](buf7, buf8, buf9,
            buf10, buf11, buf12, 128, 64, XBLOCK=1, num_warps=2, num_stages=1)
        del buf7
        del buf8
        del buf9
        buf13 = empty_strided_cuda((4, 8, 1, 1), (8, 1, 32, 32), torch.float32)
        buf14 = empty_strided_cuda((4, 8, 1, 1), (8, 1, 32, 32), torch.float32)
        buf17 = empty_strided_cuda((4, 8, 1, 1), (8, 1, 32, 32), torch.float32)
        triton_per_fused_native_group_norm_7[grid(32)](buf10, buf11, buf12,
            buf13, buf14, buf17, 32, 4, XBLOCK=1, num_warps=2, num_stages=1)
        del buf10
        del buf11
        del buf12
        buf16 = empty_strided_cuda((4, 64, 64, 64), (262144, 1, 4096, 64),
            torch.float32)
        triton_poi_fused_native_group_norm_8[grid(1048576)](buf6, buf13,
            buf14, primals_4, primals_5, buf16, 1048576, XBLOCK=1024,
            num_warps=4, num_stages=1)
        del primals_5
        buf18 = extern_kernels.convolution(buf16, buf2, stride=(2, 2),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf18, (4, 128, 32, 32), (131072, 1, 4096, 128))
        buf19 = buf18
        del buf18
        triton_poi_fused_convolution_9[grid(524288)](buf19, primals_7, 
            524288, XBLOCK=1024, num_warps=4, num_stages=1)
        del primals_7
        buf20 = empty_strided_cuda((4, 8, 1, 1, 2, 64), (1024, 2, 4096, 
            4096, 1, 16), torch.float32)
        buf21 = empty_strided_cuda((4, 8, 1, 1, 2, 64), (1024, 2, 4096, 
            4096, 1, 16), torch.float32)
        buf22 = empty_strided_cuda((4, 8, 1, 1, 2, 64), (1024, 2, 4096, 
            4096, 1, 16), torch.float32)
        triton_per_fused_native_group_norm_10[grid(4096)](buf19, buf20,
            buf21, buf22, 4096, 128, XBLOCK=8, num_warps=8, num_stages=1)
        buf23 = empty_strided_cuda((4, 8, 1, 1, 2), (16, 2, 64, 64, 1),
            torch.float32)
        buf24 = empty_strided_cuda((4, 8, 1, 1, 2), (16, 2, 64, 64, 1),
            torch.float32)
        buf25 = empty_strided_cuda((4, 8, 1, 1, 2), (16, 2, 64, 64, 1),
            torch.float32)
        triton_per_fused_native_group_norm_11[grid(64)](buf20, buf21, buf22,
            buf23, buf24, buf25, 64, 64, XBLOCK=1, num_warps=2, num_stages=1)
        buf26 = buf14
        del buf14
        buf27 = empty_strided_cuda((4, 8, 1, 1), (8, 1, 32, 32), torch.float32)
        buf30 = empty_strided_cuda((4, 8, 1, 1), (8, 1, 32, 32), torch.float32)
        triton_per_fused_native_group_norm_12[grid(32)](buf23, buf24, buf25,
            buf26, buf27, buf30, 32, 2, XBLOCK=1, num_warps=2, num_stages=1)
        buf29 = empty_strided_cuda((4, 128, 32, 32), (131072, 1, 4096, 128),
            torch.float32)
        triton_poi_fused_native_group_norm_13[grid(524288)](buf19, buf26,
            buf27, primals_8, primals_9, buf29, 524288, XBLOCK=512,
            num_warps=8, num_stages=1)
        del primals_9
        buf31 = extern_kernels.convolution(buf29, buf3, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf31, (4, 128, 32, 32), (131072, 1, 4096, 128))
        buf32 = buf31
        del buf31
        triton_poi_fused_convolution_9[grid(524288)](buf32, primals_11, 
            524288, XBLOCK=1024, num_warps=4, num_stages=1)
        del primals_11
        buf33 = buf22
        del buf22
        buf34 = buf21
        del buf21
        buf35 = buf20
        del buf20
        triton_per_fused_native_group_norm_10[grid(4096)](buf32, buf33,
            buf34, buf35, 4096, 128, XBLOCK=8, num_warps=8, num_stages=1)
        buf36 = buf25
        del buf25
        buf37 = buf24
        del buf24
        buf38 = buf23
        del buf23
        triton_per_fused_native_group_norm_11[grid(64)](buf33, buf34, buf35,
            buf36, buf37, buf38, 64, 64, XBLOCK=1, num_warps=2, num_stages=1)
        buf39 = buf27
        del buf27
        buf40 = empty_strided_cuda((4, 8, 1, 1), (8, 1, 32, 32), torch.float32)
        buf43 = empty_strided_cuda((4, 8, 1, 1), (8, 1, 32, 32), torch.float32)
        triton_per_fused_native_group_norm_12[grid(32)](buf36, buf37, buf38,
            buf39, buf40, buf43, 32, 2, XBLOCK=1, num_warps=2, num_stages=1)
        buf42 = empty_strided_cuda((4, 128, 32, 32), (131072, 1, 4096, 128),
            torch.float32)
        triton_poi_fused_native_group_norm_13[grid(524288)](buf32, buf39,
            buf40, primals_12, primals_13, buf42, 524288, XBLOCK=512,
            num_warps=8, num_stages=1)
        del primals_13
        buf44 = extern_kernels.convolution(buf42, buf4, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf44, (4, 128, 32, 32), (131072, 1, 4096, 128))
        buf45 = buf44
        del buf44
        triton_poi_fused_convolution_9[grid(524288)](buf45, primals_15, 
            524288, XBLOCK=1024, num_warps=4, num_stages=1)
        del primals_15
        buf46 = buf35
        del buf35
        buf47 = buf34
        del buf34
        buf48 = buf33
        del buf33
        triton_per_fused_native_group_norm_10[grid(4096)](buf45, buf46,
            buf47, buf48, 4096, 128, XBLOCK=8, num_warps=8, num_stages=1)
        buf49 = buf38
        del buf38
        buf50 = buf37
        del buf37
        buf51 = buf36
        del buf36
        triton_per_fused_native_group_norm_11[grid(64)](buf46, buf47, buf48,
            buf49, buf50, buf51, 64, 64, XBLOCK=1, num_warps=2, num_stages=1)
        del buf46
        del buf47
        buf52 = buf40
        del buf40
        buf53 = empty_strided_cuda((4, 8, 1, 1), (8, 1, 32, 32), torch.float32)
        buf55 = empty_strided_cuda((4, 8, 1, 1), (8, 1, 32, 32), torch.float32)
        triton_per_fused_native_group_norm_12[grid(32)](buf49, buf50, buf51,
            buf52, buf53, buf55, 32, 2, XBLOCK=1, num_warps=2, num_stages=1)
        del buf49
        del buf50
        del buf51
        buf56 = reinterpret_tensor(buf48, (4, 128, 1, 1, 8), (1024, 1, 4096,
            4096, 128), 0)
        del buf48
        triton_red_fused_mean_native_group_norm_14[grid(4096)](buf45, buf52,
            buf53, primals_16, primals_17, buf56, 4096, 128, XBLOCK=64,
            RBLOCK=8, num_warps=4, num_stages=1)
        del buf53
        del primals_17
        buf57 = empty_strided_cuda((4, 128, 1, 1), (128, 1, 512, 512),
            torch.float32)
        buf58 = buf57
        del buf57
        triton_per_fused_mean_native_group_norm_15[grid(512)](buf58, buf56,
            512, 8, XBLOCK=64, num_warps=4, num_stages=1)
        del buf56
    return (reinterpret_tensor(buf58, (4, 128), (128, 1), 0), buf0, buf1,
        primals_4, buf2, primals_8, buf3, primals_12, buf4, primals_16,
        buf6, buf16, reinterpret_tensor(buf13, (4, 8), (8, 1), 0),
        reinterpret_tensor(buf17, (4, 8), (8, 1), 0), buf19, buf29,
        reinterpret_tensor(buf26, (4, 8), (8, 1), 0), reinterpret_tensor(
        buf30, (4, 8), (8, 1), 0), buf32, buf42, reinterpret_tensor(buf39,
        (4, 8), (8, 1), 0), reinterpret_tensor(buf43, (4, 8), (8, 1), 0),
        buf45, reinterpret_tensor(buf52, (4, 8), (8, 1), 0),
        reinterpret_tensor(buf55, (4, 8), (8, 1), 0))


class Color_MNIST_CNNNew(nn.Module):

    def __init__(self):
        super(Color_MNIST_CNNNew, self).__init__()
        self.conv1 = nn.Conv2d(3, 64, 3, 1, padding=1)
        self.conv2 = nn.Conv2d(64, 128, 3, stride=2, padding=1)
        self.conv3 = nn.Conv2d(128, 128, 3, 1, padding=1)
        self.conv4 = nn.Conv2d(128, 128, 3, 1, padding=1)
        self.bn0 = nn.GroupNorm(8, 64)
        self.bn1 = nn.GroupNorm(8, 128)
        self.bn2 = nn.GroupNorm(8, 128)
        self.bn3 = nn.GroupNorm(8, 128)
        self.avgpool = nn.AdaptiveAvgPool2d((1, 1))

    def forward(self, input_0):
        primals_1 = self.conv1.weight
        primals_2 = self.conv1.bias
        primals_6 = self.conv2.weight
        primals_7 = self.conv2.bias
        primals_10 = self.conv3.weight
        primals_8 = self.conv3.bias
        primals_14 = self.conv4.weight
        primals_9 = self.conv4.bias
        primals_4 = self.bn0.weight
        primals_5 = self.bn0.bias
        primals_11 = self.bn1.weight
        primals_12 = self.bn1.bias
        primals_13 = self.bn2.weight
        primals_15 = self.bn2.bias
        primals_16 = self.bn3.weight
        primals_17 = self.bn3.bias
        primals_3 = 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]


Measured latency_ms: 0.022941