# AOT ID: ['17_inference'] from ctypes import c_void_p, c_long 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 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 alloc_from_pool = torch.ops.inductor._alloc_from_pool reinterpret_tensor = torch.ops.inductor._reinterpret_tensor async_compile = AsyncCompile() # kernel path: /tmp/torchinductor_root/ku/ckuw2pb6xppwriylr4asbjhuoeppnmirwo7rvm43nlo5u7k7pf6m.py # Source Nodes: [conv2d_2, r, relu], Original ATen: [aten._to_copy, aten.convolution, aten.relu] # conv2d_2 => convert_element_type_10, convert_element_type_8, convert_element_type_9, convolution_2 # r => convert_element_type, convert_element_type_1, convert_element_type_2, convolution # relu => relu triton_poi_fused__to_copy_convolution_relu_0 = async_compile.triton('triton_', ''' 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=[16777216], filename=__file__, triton_meta={'signature': {0: '*fp32', 1: '*fp16', 2: '*fp16', 3: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=89, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=1536, multi_processor_count=58), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3), equal_to_1=())]}, inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused__to_copy_convolution_relu_0', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 1, 'num_reduction': 0, 'backend_hash': '72c34bdb145549777ca2f0838f26abe42bb446cf528c78d229508b5a55e67a78', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': False, '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_(in_ptr0, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr): xoffset = tl.program_id(0) * XBLOCK xindex = xoffset + tl.arange(0, XBLOCK)[:] xmask = xindex < xnumel x0 = xindex tmp0 = tl.load(in_ptr0 + (x0), xmask) tmp1 = tl.full([1], 0, tl.int32) tmp2 = triton_helpers.maximum(tmp1, tmp0) tmp3 = tmp2.to(tl.float32) tmp4 = tmp0.to(tl.float32) tl.store(out_ptr0 + (x0), tmp3, xmask) tl.store(out_ptr1 + (x0), tmp4, xmask) ''', device_str='cuda') import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid, split_scan_grid, start_graph, end_graph from torch._C import _cuda_getCurrentRawStream as get_raw_stream # kernel path: /tmp/torchinductor_root/a7/ca75zbvmbjnstwvccjc4vtlcm5vnr42q3mrq6jpqof73qtjvfb6j.py # Source Nodes: [r, relu], Original ATen: [aten._to_copy, aten.convolution, aten.relu] # r => convert_element_type, convert_element_type_1, convert_element_type_2, convolution # relu => relu triton_poi_fused__to_copy_convolution_relu_1 = async_compile.triton('triton_', ''' 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=[1048576], filename=__file__, triton_meta={'signature': {0: '*fp32', 1: '*fp16', 2: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=89, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=1536, multi_processor_count=58), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2), equal_to_1=())]}, inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused__to_copy_convolution_relu_1', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 1, 'num_reduction': 0, 'backend_hash': '72c34bdb145549777ca2f0838f26abe42bb446cf528c78d229508b5a55e67a78', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': False, '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_(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): xnumel = 589824 xoffset = tl.program_id(0) * XBLOCK xindex = xoffset + tl.arange(0, XBLOCK)[:] xmask = xindex < xnumel x0 = xindex tmp0 = tl.load(in_ptr0 + (x0), None) tmp1 = tmp0.to(tl.float32) tl.store(out_ptr0 + (x0), tmp1, None) ''', device_str='cuda') # kernel path: /tmp/torchinductor_root/qx/cqxpfv7cmuudq4jif3yzob2xcbc5ep2tsnlv2fniclvolbbhvnvw.py # Source Nodes: [r, relu], Original ATen: [aten._to_copy, aten.convolution, aten.relu] # r => convert_element_type, convert_element_type_1, convert_element_type_2, convolution # relu => relu triton_poi_fused__to_copy_convolution_relu_2 = async_compile.triton('triton_', ''' 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=[128], filename=__file__, triton_meta={'signature': {0: '*fp32', 1: '*fp16', 2: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=89, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=1536, multi_processor_count=58), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2), equal_to_1=())]}, inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused__to_copy_convolution_relu_2', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 1, 'num_reduction': 0, 'backend_hash': '72c34bdb145549777ca2f0838f26abe42bb446cf528c78d229508b5a55e67a78', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': False, '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_(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): xnumel = 128 xoffset = tl.program_id(0) * XBLOCK xindex = xoffset + tl.arange(0, XBLOCK)[:] xmask = xindex < xnumel x0 = xindex tmp0 = tl.load(in_ptr0 + (x0), xmask) tmp1 = tmp0.to(tl.float32) tl.store(out_ptr0 + (x0), tmp1, xmask) ''', device_str='cuda') # kernel path: /tmp/torchinductor_root/ch/cchjvz2axmthp7tzqt5yx2mgth65ekugd52xucscdzfybkven3aq.py # Source Nodes: [r_1], Original ATen: [aten.native_group_norm] # r_1 => var_mean triton_red_fused_native_group_norm_3 = async_compile.triton('triton_', ''' import triton import triton.language as tl from triton.compiler.compiler import AttrsDescriptor from torch._inductor.runtime import triton_helpers, triton_heuristics from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, instance_descriptor, DeviceProperties @triton_heuristics.reduction( size_hints=[512, 8192], reduction_hint=ReductionHint.INNER, filename=__file__, triton_meta={'signature': {0: '*fp16', 1: '*fp16', 2: '*fp32', 3: '*fp32', 4: '*fp32', 5: 'i32', 6: 'i32', 7: 'i32', 8: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=89, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=1536, multi_processor_count=58), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 4), equal_to_1=())]}, inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_red_fused_native_group_norm_3', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 2, 'num_reduction': 3, 'backend_hash': '72c34bdb145549777ca2f0838f26abe42bb446cf528c78d229508b5a55e67a78', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': False, '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_(in_ptr0, in_ptr1, out_ptr0, out_ptr1, out_ptr2, ks0, ks1, xnumel, rnumel, XBLOCK : tl.constexpr, RBLOCK : tl.constexpr): xnumel = 296 xoffset = tl.program_id(0) * XBLOCK xindex = xoffset + tl.arange(0, XBLOCK)[:, None] xmask = xindex < xnumel rbase = tl.arange(0, RBLOCK)[None, :] x0 = xindex % 37 x1 = (xindex // 37) tmp18_mean = tl.zeros([XBLOCK, RBLOCK], tl.float32) tmp18_m2 = tl.zeros([XBLOCK, RBLOCK], tl.float32) tmp18_weight = tl.zeros([XBLOCK, RBLOCK], tl.float32) x3 = xindex for roffset in range(0, rnumel, RBLOCK): rindex = roffset + rbase rmask = rindex < rnumel r2 = rindex tmp0 = r2 + (x0*((36 + (16*ks0*ks1)) // 37)) tmp1 = 16*ks0*ks1 tmp2 = tmp0 < tmp1 tmp3 = tl.load(in_ptr0 + ((16*ks0*ks1*x1) + ((r2 + (x0*((36 + (16*ks0*ks1)) // 37))) % (16*ks0*ks1))), rmask & tmp2 & xmask, eviction_policy='evict_last', other=0.0).to(tl.float32) tmp4 = tl.load(in_ptr1 + ((16*x1) + (((r2 + (x0*((36 + (16*ks0*ks1)) // 37))) // (ks0*ks1)) % 16)), rmask & tmp2 & xmask, eviction_policy='evict_last', other=0.0).to(tl.float32) tmp5 = tmp3 + tmp4 tmp6 = tmp5.to(tl.float32) tmp7 = tl.full(tmp6.shape, 0, tmp6.dtype) tmp8 = tl.where(tmp2, tmp6, tmp7) tmp9 = 0.0 tmp10 = tl.full(tmp9.shape, 0, tmp9.dtype) tmp11 = tl.where(tmp2, tmp9, tmp10) tmp12 = 1.0 tmp13 = tl.full(tmp12.shape, 0, tmp12.dtype) tmp14 = tl.where(tmp2, tmp12, tmp13) tmp15 = tl.broadcast_to(tmp8, [XBLOCK, RBLOCK]) tmp16 = tl.broadcast_to(tmp11, [XBLOCK, RBLOCK]) tmp17 = tl.broadcast_to(tmp14, [XBLOCK, RBLOCK]) tmp18_mean_next, tmp18_m2_next, tmp18_weight_next = triton_helpers.welford_combine( tmp18_mean, tmp18_m2, tmp18_weight, tmp15, tmp16, tmp17 ) tmp18_mean = tl.where(rmask & xmask, tmp18_mean_next, tmp18_mean) tmp18_m2 = tl.where(rmask & xmask, tmp18_m2_next, tmp18_m2) tmp18_weight = tl.where(rmask & xmask, tmp18_weight_next, tmp18_weight) tmp18_tmp, tmp19_tmp, tmp20_tmp = triton_helpers.welford( tmp18_mean, tmp18_m2, tmp18_weight, 1 ) tmp18 = tmp18_tmp[:, None] tmp19 = tmp19_tmp[:, None] tmp20 = tmp20_tmp[:, None] tl.store(out_ptr0 + (x3), tmp18, xmask) tl.store(out_ptr1 + (x3), tmp19, xmask) tl.store(out_ptr2 + (x3), tmp20, xmask) ''', device_str='cuda') # kernel path: /tmp/torchinductor_root/d2/cd27vanxzwh2sxa5riyv3knt3unkgj7hbkixnml7htk5kcywpgdf.py # Source Nodes: [r_1], Original ATen: [aten.native_group_norm] # r_1 => var_mean triton_per_fused_native_group_norm_4 = async_compile.triton('triton_', ''' import triton import triton.language as tl from triton.compiler.compiler import AttrsDescriptor from torch._inductor.runtime import triton_helpers, triton_heuristics from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, instance_descriptor, DeviceProperties @triton_heuristics.persistent_reduction( size_hints=[8, 64], reduction_hint=ReductionHint.INNER, filename=__file__, triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: '*fp32', 5: 'i32', 6: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=89, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=1536, multi_processor_count=58), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 4), equal_to_1=())]}, inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_per_fused_native_group_norm_4', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 3, 'num_reduction': 2, 'backend_hash': '72c34bdb145549777ca2f0838f26abe42bb446cf528c78d229508b5a55e67a78', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': False, '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_(in_ptr0, in_ptr1, in_ptr2, out_ptr0, out_ptr1, xnumel, rnumel, XBLOCK : tl.constexpr): xnumel = 8 rnumel = 37 RBLOCK: tl.constexpr = 64 xoffset = tl.program_id(0) * XBLOCK xindex = xoffset + tl.arange(0, XBLOCK)[:, None] xmask = xindex < xnumel rindex = tl.arange(0, RBLOCK)[None, :] roffset = 0 rmask = rindex < rnumel r1 = rindex x0 = xindex tmp0 = tl.load(in_ptr0 + (r1 + (37*x0)), rmask & xmask, other=0.0) tmp1 = tl.load(in_ptr1 + (r1 + (37*x0)), rmask & xmask, other=0.0) tmp2 = tl.load(in_ptr2 + (r1 + (37*x0)), rmask & 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(rmask & xmask, tmp3, 0) tmp8 = tl.where(rmask & xmask, tmp4, 0) tmp9 = tl.where(rmask & 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 + (x0), tmp13, xmask) tl.store(out_ptr1 + (x0), tmp14, xmask) ''', device_str='cuda') # kernel path: /tmp/torchinductor_root/54/c54ghnhwsvzhhiwtnlrnbqec566wsg7l6q5wplzwmki6lntw2ffd.py # Source Nodes: [r_1, r_2, relu_1], Original ATen: [aten._to_copy, aten.convolution, aten.native_group_norm, aten.relu] # r_1 => add_1, mul_2 # r_2 => convert_element_type_4, convert_element_type_5, convert_element_type_6, convolution_1 # relu_1 => relu_1 triton_poi_fused__to_copy_convolution_native_group_norm_relu_5 = async_compile.triton('triton_', ''' 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=[4194304], filename=__file__, triton_meta={'signature': {0: '*fp16', 1: '*fp16', 2: '*fp32', 3: '*fp32', 4: '*fp32', 5: '*fp32', 6: 'i32', 7: 'i32', 8: 'i32', 9: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=89, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=1536, multi_processor_count=58), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 4, 5, 9), equal_to_1=())]}, inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused__to_copy_convolution_native_group_norm_relu_5', 'mutated_arg_names': ['in_out_ptr0'], 'no_x_dim': False, 'num_load': 6, 'num_reduction': 0, 'backend_hash': '72c34bdb145549777ca2f0838f26abe42bb446cf528c78d229508b5a55e67a78', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': False, '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_(in_out_ptr0, in_ptr0, in_ptr1, in_ptr2, in_ptr3, in_ptr4, ks0, ks1, ks2, xnumel, XBLOCK : tl.constexpr): xoffset = tl.program_id(0) * XBLOCK xindex = xoffset + tl.arange(0, XBLOCK)[:] xmask = xindex < xnumel x2 = xindex x1 = (xindex // ks0) tmp0 = tl.load(in_out_ptr0 + (x2), xmask, eviction_policy='evict_last').to(tl.float32) tmp1 = tl.load(in_ptr0 + (x1), xmask, eviction_policy='evict_last').to(tl.float32) tmp4 = tl.load(in_ptr1 + ((x1 // 16)), xmask, eviction_policy='evict_last') tmp6 = tl.load(in_ptr2 + ((x1 // 16)), xmask, eviction_policy='evict_last') tmp14 = tl.load(in_ptr3 + (x1), xmask, eviction_policy='evict_last') tmp16 = tl.load(in_ptr4 + (x1), xmask, eviction_policy='evict_last') tmp2 = tmp0 + tmp1 tmp3 = tmp2.to(tl.float32) tmp5 = tmp3 - tmp4 tmp7 = 16*ks1*ks2 tmp8 = tmp7.to(tl.float32) tmp9 = tmp6 / tmp8 tmp10 = 1e-05 tmp11 = tmp9 + tmp10 tmp12 = libdevice.rsqrt(tmp11) tmp13 = tmp5 * tmp12 tmp15 = tmp13 * tmp14 tmp17 = tmp15 + tmp16 tmp18 = tl.full([1], 0, tl.int32) tmp19 = triton_helpers.maximum(tmp18, tmp17) tmp20 = tmp19.to(tl.float32) tl.store(in_out_ptr0 + (x2), tmp20, xmask) ''', device_str='cuda') # kernel path: /tmp/torchinductor_root/j3/cj3a5jopizd5pkxfcaz5mrugehe6lrcnljtbhoohau5sywn6csml.py # Source Nodes: [r_1, r_2, relu_1], Original ATen: [aten._to_copy, aten.convolution, aten.native_group_norm, aten.relu] # r_1 => add_1, mul_2 # r_2 => convert_element_type_4, convert_element_type_5, convert_element_type_6, convolution_1 # relu_1 => relu_1 triton_poi_fused__to_copy_convolution_native_group_norm_relu_6 = async_compile.triton('triton_', ''' 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=[262144], filename=__file__, triton_meta={'signature': {0: '*fp32', 1: '*fp16', 2: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=89, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=1536, multi_processor_count=58), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2), equal_to_1=())]}, inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused__to_copy_convolution_native_group_norm_relu_6', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 1, 'num_reduction': 0, 'backend_hash': '72c34bdb145549777ca2f0838f26abe42bb446cf528c78d229508b5a55e67a78', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': False, '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_(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr): xnumel = 147456 xoffset = tl.program_id(0) * XBLOCK xindex = xoffset + tl.arange(0, XBLOCK)[:] xmask = xindex < xnumel x0 = xindex tmp0 = tl.load(in_ptr0 + (x0), None) tmp1 = tmp0.to(tl.float32) tl.store(out_ptr0 + (x0), tmp1, None) ''', device_str='cuda') # kernel path: /tmp/torchinductor_root/ar/car5lpi3m4euwuvbhzmkra3pzdssvbskion3zanlj27gcxokniia.py # Source Nodes: [r_3], Original ATen: [aten.native_group_norm] # r_3 => var_mean_1 triton_red_fused_native_group_norm_7 = async_compile.triton('triton_', ''' import triton import triton.language as tl from triton.compiler.compiler import AttrsDescriptor from torch._inductor.runtime import triton_helpers, triton_heuristics from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, instance_descriptor, DeviceProperties @triton_heuristics.reduction( size_hints=[512, 8192], reduction_hint=ReductionHint.INNER, filename=__file__, triton_meta={'signature': {0: '*fp16', 1: '*fp16', 2: '*fp32', 3: '*fp32', 4: '*fp32', 5: 'i32', 6: 'i32', 7: 'i32', 8: 'i32', 9: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=89, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=1536, multi_processor_count=58), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 4), equal_to_1=())]}, inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_red_fused_native_group_norm_7', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 2, 'num_reduction': 3, 'backend_hash': '72c34bdb145549777ca2f0838f26abe42bb446cf528c78d229508b5a55e67a78', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': False, '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_(in_ptr0, in_ptr1, out_ptr0, out_ptr1, out_ptr2, ks0, ks1, ks2, xnumel, rnumel, XBLOCK : tl.constexpr, RBLOCK : tl.constexpr): xnumel = 296 xoffset = tl.program_id(0) * XBLOCK xindex = xoffset + tl.arange(0, XBLOCK)[:, None] xmask = xindex < xnumel rbase = tl.arange(0, RBLOCK)[None, :] x0 = xindex % 37 x1 = (xindex // 37) tmp18_mean = tl.zeros([XBLOCK, RBLOCK], tl.float32) tmp18_m2 = tl.zeros([XBLOCK, RBLOCK], tl.float32) tmp18_weight = tl.zeros([XBLOCK, RBLOCK], tl.float32) x3 = xindex for roffset in range(0, rnumel, RBLOCK): rindex = roffset + rbase rmask = rindex < rnumel r2 = rindex tmp0 = r2 + (x0*((36 + (16*ks0*ks1)) // 37)) tmp1 = 16*ks0*ks1 tmp2 = tmp0 < tmp1 tmp3 = tl.load(in_ptr0 + ((16*ks0*ks1*x1) + ((r2 + (x0*((36 + (16*ks0*ks1)) // 37))) % (16*ks0*ks1))), rmask & tmp2 & xmask, eviction_policy='evict_last', other=0.0).to(tl.float32) tmp4 = tl.load(in_ptr1 + ((16*x1) + (((r2 + (x0*((36 + (16*ks0*ks1)) // 37))) // ks2) % 16)), rmask & tmp2 & xmask, eviction_policy='evict_last', other=0.0).to(tl.float32) tmp5 = tmp3 + tmp4 tmp6 = tmp5.to(tl.float32) tmp7 = tl.full(tmp6.shape, 0, tmp6.dtype) tmp8 = tl.where(tmp2, tmp6, tmp7) tmp9 = 0.0 tmp10 = tl.full(tmp9.shape, 0, tmp9.dtype) tmp11 = tl.where(tmp2, tmp9, tmp10) tmp12 = 1.0 tmp13 = tl.full(tmp12.shape, 0, tmp12.dtype) tmp14 = tl.where(tmp2, tmp12, tmp13) tmp15 = tl.broadcast_to(tmp8, [XBLOCK, RBLOCK]) tmp16 = tl.broadcast_to(tmp11, [XBLOCK, RBLOCK]) tmp17 = tl.broadcast_to(tmp14, [XBLOCK, RBLOCK]) tmp18_mean_next, tmp18_m2_next, tmp18_weight_next = triton_helpers.welford_combine( tmp18_mean, tmp18_m2, tmp18_weight, tmp15, tmp16, tmp17 ) tmp18_mean = tl.where(rmask & xmask, tmp18_mean_next, tmp18_mean) tmp18_m2 = tl.where(rmask & xmask, tmp18_m2_next, tmp18_m2) tmp18_weight = tl.where(rmask & xmask, tmp18_weight_next, tmp18_weight) tmp18_tmp, tmp19_tmp, tmp20_tmp = triton_helpers.welford( tmp18_mean, tmp18_m2, tmp18_weight, 1 ) tmp18 = tmp18_tmp[:, None] tmp19 = tmp19_tmp[:, None] tmp20 = tmp20_tmp[:, None] tl.store(out_ptr0 + (x3), tmp18, xmask) tl.store(out_ptr1 + (x3), tmp19, xmask) tl.store(out_ptr2 + (x3), tmp20, xmask) ''', device_str='cuda') # kernel path: /tmp/torchinductor_root/ba/cbadikz5gz4r743qkhukouj4zklkhibfo4ccqvnahuukyljmrwbk.py # Source Nodes: [add, r_3, r_4, relu_2, x], Original ATen: [aten._to_copy, aten.add, aten.convolution, aten.native_group_norm, aten.relu] # add => add_6 # r_3 => add_3, mul_5 # r_4 => convert_element_type_12, convert_element_type_13, convert_element_type_14, convolution_3 # relu_2 => relu_2 # x => add_5, mul_8 triton_poi_fused__to_copy_add_convolution_native_group_norm_relu_8 = async_compile.triton('triton_', ''' 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=[4194304], filename=__file__, triton_meta={'signature': {0: '*fp16', 1: '*fp16', 2: '*fp32', 3: '*fp32', 4: '*fp32', 5: '*fp32', 6: '*fp16', 7: '*fp16', 8: '*fp32', 9: '*fp32', 10: '*fp32', 11: '*fp32', 12: '*fp32', 13: '*fp16', 14: 'i32', 15: 'i32', 16: 'i32', 17: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=89, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=1536, multi_processor_count=58), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 17), equal_to_1=())]}, inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused__to_copy_add_convolution_native_group_norm_relu_8', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 12, 'num_reduction': 0, 'backend_hash': '72c34bdb145549777ca2f0838f26abe42bb446cf528c78d229508b5a55e67a78', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': False, '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_(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, out_ptr1, ks0, ks1, ks2, xnumel, XBLOCK : tl.constexpr): xoffset = tl.program_id(0) * XBLOCK xindex = xoffset + tl.arange(0, XBLOCK)[:] xmask = xindex < xnumel x2 = xindex x1 = (xindex // ks0) tmp0 = tl.load(in_ptr0 + (x2), xmask, eviction_policy='evict_last').to(tl.float32) tmp1 = tl.load(in_ptr1 + (x1), xmask, eviction_policy='evict_last').to(tl.float32) tmp4 = tl.load(in_ptr2 + ((x1 // 16)), xmask, eviction_policy='evict_last') tmp6 = tl.load(in_ptr3 + ((x1 // 16)), xmask, eviction_policy='evict_last') tmp14 = tl.load(in_ptr4 + (x1), xmask, eviction_policy='evict_last') tmp16 = tl.load(in_ptr5 + (x1), xmask, eviction_policy='evict_last') tmp18 = tl.load(in_ptr6 + (x2), xmask, eviction_policy='evict_last').to(tl.float32) tmp19 = tl.load(in_ptr7 + (x1), xmask, eviction_policy='evict_last').to(tl.float32) tmp22 = tl.load(in_ptr8 + ((x1 // 16)), xmask, eviction_policy='evict_last') tmp24 = tl.load(in_ptr9 + ((x1 // 16)), xmask, eviction_policy='evict_last') tmp29 = tl.load(in_ptr10 + (x1), xmask, eviction_policy='evict_last') tmp31 = tl.load(in_ptr11 + (x1), xmask, eviction_policy='evict_last') tmp2 = tmp0 + tmp1 tmp3 = tmp2.to(tl.float32) tmp5 = tmp3 - tmp4 tmp7 = 16*ks1*ks2 tmp8 = tmp7.to(tl.float32) tmp9 = tmp6 / tmp8 tmp10 = 1e-05 tmp11 = tmp9 + tmp10 tmp12 = libdevice.rsqrt(tmp11) tmp13 = tmp5 * tmp12 tmp15 = tmp13 * tmp14 tmp17 = tmp15 + tmp16 tmp20 = tmp18 + tmp19 tmp21 = tmp20.to(tl.float32) tmp23 = tmp21 - tmp22 tmp25 = tmp24 / tmp8 tmp26 = tmp25 + tmp10 tmp27 = libdevice.rsqrt(tmp26) tmp28 = tmp23 * tmp27 tmp30 = tmp28 * tmp29 tmp32 = tmp30 + tmp31 tmp33 = tmp17 + tmp32 tmp34 = tl.full([1], 0, tl.int32) tmp35 = triton_helpers.maximum(tmp34, tmp33) tmp36 = tmp35.to(tl.float32) tl.store(out_ptr0 + (x2), tmp33, xmask) tl.store(out_ptr1 + (x2), tmp36, xmask) ''', device_str='cuda') # kernel path: /tmp/torchinductor_root/j2/cj2tqsdv4zx2lxfsskz3c6awb4eyxlq6k3o3uwstfnzwzrqjw35l.py # Source Nodes: [add_1, r_7], Original ATen: [aten.add, aten.native_group_norm] # add_1 => add_11 # r_7 => add_10, mul_14 triton_poi_fused_add_native_group_norm_9 = async_compile.triton('triton_', ''' 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=[4194304], filename=__file__, triton_meta={'signature': {0: '*fp32', 1: '*fp16', 2: '*fp16', 3: '*fp32', 4: '*fp32', 5: '*fp32', 6: '*fp32', 7: 'i32', 8: 'i32', 9: 'i32', 10: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=89, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=1536, multi_processor_count=58), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 4, 5, 6, 10), equal_to_1=())]}, inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_native_group_norm_9', 'mutated_arg_names': ['in_out_ptr0'], 'no_x_dim': False, 'num_load': 7, 'num_reduction': 0, 'backend_hash': '72c34bdb145549777ca2f0838f26abe42bb446cf528c78d229508b5a55e67a78', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': False, '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_(in_out_ptr0, in_ptr0, in_ptr1, in_ptr2, in_ptr3, in_ptr4, in_ptr5, ks0, ks1, ks2, xnumel, XBLOCK : tl.constexpr): xoffset = tl.program_id(0) * XBLOCK xindex = xoffset + tl.arange(0, XBLOCK)[:] xmask = xindex < xnumel x2 = xindex x1 = (xindex // ks0) tmp0 = tl.load(in_out_ptr0 + (x2), xmask, eviction_policy='evict_last') tmp1 = tl.load(in_ptr0 + (x2), xmask, eviction_policy='evict_last').to(tl.float32) tmp2 = tl.load(in_ptr1 + (x1), xmask, eviction_policy='evict_last').to(tl.float32) tmp5 = tl.load(in_ptr2 + ((x1 // 16)), xmask, eviction_policy='evict_last') tmp7 = tl.load(in_ptr3 + ((x1 // 16)), xmask, eviction_policy='evict_last') tmp15 = tl.load(in_ptr4 + (x1), xmask, eviction_policy='evict_last') tmp17 = tl.load(in_ptr5 + (x1), xmask, eviction_policy='evict_last') tmp3 = tmp1 + tmp2 tmp4 = tmp3.to(tl.float32) tmp6 = tmp4 - tmp5 tmp8 = 16*ks1*ks2 tmp9 = tmp8.to(tl.float32) tmp10 = tmp7 / tmp9 tmp11 = 1e-05 tmp12 = tmp10 + tmp11 tmp13 = libdevice.rsqrt(tmp12) tmp14 = tmp6 * tmp13 tmp16 = tmp14 * tmp15 tmp18 = tmp16 + tmp17 tmp19 = tmp0 + tmp18 tl.store(in_out_ptr0 + (x2), tmp19, xmask) ''', device_str='cuda') async_compile.wait(globals()) del async_compile def call(args): arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1, arg7_1, arg8_1, arg9_1, arg10_1, arg11_1, arg12_1, arg13_1, arg14_1, arg15_1, arg16_1, arg17_1, arg18_1, arg19_1, arg20_1, arg21_1, arg22_1 = args args.clear() s1 = arg0_1 s2 = arg1_1 assert_size_stride(arg2_1, (1, 512, s1, s2), (512*s1*s2, s1*s2, s2, 1)) assert_size_stride(arg3_1, (128, 512, 3, 3), (4608, 9, 3, 1)) assert_size_stride(arg4_1, (128, ), (1, )) assert_size_stride(arg5_1, (128, ), (1, )) assert_size_stride(arg6_1, (128, ), (1, )) assert_size_stride(arg7_1, (128, 128, 3, 3), (1152, 9, 3, 1)) assert_size_stride(arg8_1, (128, ), (1, )) assert_size_stride(arg9_1, (128, ), (1, )) assert_size_stride(arg10_1, (128, ), (1, )) assert_size_stride(arg11_1, (128, 512, 3, 3), (4608, 9, 3, 1)) assert_size_stride(arg12_1, (128, ), (1, )) assert_size_stride(arg13_1, (128, ), (1, )) assert_size_stride(arg14_1, (128, ), (1, )) assert_size_stride(arg15_1, (128, 128, 3, 3), (1152, 9, 3, 1)) assert_size_stride(arg16_1, (128, ), (1, )) assert_size_stride(arg17_1, (128, ), (1, )) assert_size_stride(arg18_1, (128, ), (1, )) assert_size_stride(arg19_1, (128, 128, 3, 3), (1152, 9, 3, 1)) assert_size_stride(arg20_1, (128, ), (1, )) assert_size_stride(arg21_1, (128, ), (1, )) assert_size_stride(arg22_1, (128, ), (1, )) with torch.cuda._DeviceGuard(0): torch.cuda.set_device(0) buf0 = empty_strided_cuda((1, 512, s1, s2), (512*s1*s2, s1*s2, s2, 1), torch.float16) buf20 = empty_strided_cuda((1, 512, s1, s2), (512*s1*s2, s1*s2, s2, 1), torch.float16) # Source Nodes: [conv2d_2, r, relu], Original ATen: [aten._to_copy, aten.convolution, aten.relu] triton_poi_fused__to_copy_convolution_relu_0_xnumel = 512*s1*s2 stream0 = get_raw_stream(0) triton_poi_fused__to_copy_convolution_relu_0.run(arg2_1, buf0, buf20, triton_poi_fused__to_copy_convolution_relu_0_xnumel, grid=grid(triton_poi_fused__to_copy_convolution_relu_0_xnumel), stream=stream0) del arg2_1 buf1 = empty_strided_cuda((128, 512, 3, 3), (4608, 9, 3, 1), torch.float16) # Source Nodes: [r, relu], Original ATen: [aten._to_copy, aten.convolution, aten.relu] triton_poi_fused__to_copy_convolution_relu_1.run(arg3_1, buf1, 589824, grid=grid(589824), stream=stream0) del arg3_1 buf2 = empty_strided_cuda((128, ), (1, ), torch.float16) # Source Nodes: [r, relu], Original ATen: [aten._to_copy, aten.convolution, aten.relu] triton_poi_fused__to_copy_convolution_relu_2.run(arg4_1, buf2, 128, grid=grid(128), stream=stream0) del arg4_1 # Source Nodes: [r, relu], Original ATen: [aten._to_copy, aten.convolution, aten.relu] buf3 = extern_kernels.convolution(buf0, buf1, stride=(1, 1), padding=(1, 1), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None) assert_size_stride(buf3, (1, 128, s1, s2), (128*s1*s2, s1*s2, s2, 1)) del buf0 buf4 = empty_strided_cuda((1, 8, 1, 1, 37), (296, 37, 296, 296, 1), torch.float32) buf5 = empty_strided_cuda((1, 8, 1, 1, 37), (296, 37, 296, 296, 1), torch.float32) buf6 = empty_strided_cuda((1, 8, 1, 1, 37), (296, 37, 296, 296, 1), torch.float32) # Source Nodes: [r_1], Original ATen: [aten.native_group_norm] triton_red_fused_native_group_norm_3_rnumel = ((36 + (16*s1*s2)) // 37) triton_red_fused_native_group_norm_3.run(buf3, buf2, buf4, buf5, buf6, s1, s2, 296, triton_red_fused_native_group_norm_3_rnumel, grid=grid(296), stream=stream0) buf7 = empty_strided_cuda((1, 8, 1, 1), (8, 1, 8, 8), torch.float32) buf8 = empty_strided_cuda((1, 8, 1, 1), (8, 1, 8, 8), torch.float32) # Source Nodes: [r_1], Original ATen: [aten.native_group_norm] triton_per_fused_native_group_norm_4.run(buf4, buf5, buf6, buf7, buf8, 8, 37, grid=grid(8), stream=stream0) ps0 = s1*s2 buf10 = buf3; del buf3 # reuse # Source Nodes: [r_1, r_2, relu_1], Original ATen: [aten._to_copy, aten.convolution, aten.native_group_norm, aten.relu] triton_poi_fused__to_copy_convolution_native_group_norm_relu_5_xnumel = 128*s1*s2 triton_poi_fused__to_copy_convolution_native_group_norm_relu_5.run(buf10, buf2, buf7, buf8, arg5_1, arg6_1, ps0, s1, s2, triton_poi_fused__to_copy_convolution_native_group_norm_relu_5_xnumel, grid=grid(triton_poi_fused__to_copy_convolution_native_group_norm_relu_5_xnumel), stream=stream0) del arg5_1 del arg6_1 buf11 = empty_strided_cuda((128, 128, 3, 3), (1152, 9, 3, 1), torch.float16) # Source Nodes: [r_1, r_2, relu_1], Original ATen: [aten._to_copy, aten.convolution, aten.native_group_norm, aten.relu] triton_poi_fused__to_copy_convolution_native_group_norm_relu_6.run(arg7_1, buf11, 147456, grid=grid(147456), stream=stream0) del arg7_1 buf12 = buf2; del buf2 # reuse # Source Nodes: [r_1, r_2, relu_1], Original ATen: [aten._to_copy, aten.convolution, aten.native_group_norm, aten.relu] triton_poi_fused__to_copy_convolution_relu_2.run(arg8_1, buf12, 128, grid=grid(128), stream=stream0) del arg8_1 # Source Nodes: [r_1, r_2, relu_1], Original ATen: [aten._to_copy, aten.convolution, aten.native_group_norm, aten.relu] buf13 = extern_kernels.convolution(buf10, buf11, stride=(1, 1), padding=(1, 1), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None) assert_size_stride(buf13, (1, 128, s1, s2), (128*s1*s2, s1*s2, s2, 1)) buf14 = buf6; del buf6 # reuse buf15 = buf5; del buf5 # reuse buf16 = buf4; del buf4 # reuse # Source Nodes: [r_3], Original ATen: [aten.native_group_norm] triton_red_fused_native_group_norm_7_rnumel = ((36 + (16*s1*s2)) // 37) triton_red_fused_native_group_norm_7.run(buf13, buf12, buf14, buf15, buf16, s1, s2, ps0, 296, triton_red_fused_native_group_norm_7_rnumel, grid=grid(296), stream=stream0) buf17 = buf8; del buf8 # reuse buf18 = buf7; del buf7 # reuse # Source Nodes: [r_3], Original ATen: [aten.native_group_norm] triton_per_fused_native_group_norm_4.run(buf14, buf15, buf16, buf17, buf18, 8, 37, grid=grid(8), stream=stream0) buf21 = buf1; del buf1 # reuse # Source Nodes: [conv2d_2], Original ATen: [aten._to_copy, aten.convolution] triton_poi_fused__to_copy_convolution_relu_1.run(arg11_1, buf21, 589824, grid=grid(589824), stream=stream0) del arg11_1 buf22 = empty_strided_cuda((128, ), (1, ), torch.float16) # Source Nodes: [conv2d_2], Original ATen: [aten._to_copy, aten.convolution] triton_poi_fused__to_copy_convolution_relu_2.run(arg12_1, buf22, 128, grid=grid(128), stream=stream0) del arg12_1 # Source Nodes: [conv2d_2], Original ATen: [aten._to_copy, aten.convolution] buf23 = extern_kernels.convolution(buf20, buf21, stride=(1, 1), padding=(1, 1), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None) assert_size_stride(buf23, (1, 128, s1, s2), (128*s1*s2, s1*s2, s2, 1)) del buf20 del buf21 buf24 = buf16; del buf16 # reuse buf25 = buf15; del buf15 # reuse buf26 = buf14; del buf14 # reuse # Source Nodes: [x], Original ATen: [aten.native_group_norm] triton_red_fused_native_group_norm_7_rnumel = ((36 + (16*s1*s2)) // 37) triton_red_fused_native_group_norm_7.run(buf23, buf22, buf24, buf25, buf26, s1, s2, ps0, 296, triton_red_fused_native_group_norm_7_rnumel, grid=grid(296), stream=stream0) buf27 = empty_strided_cuda((1, 8, 1, 1), (8, 1, 8, 8), torch.float32) buf28 = empty_strided_cuda((1, 8, 1, 1), (8, 1, 8, 8), torch.float32) # Source Nodes: [x], Original ATen: [aten.native_group_norm] triton_per_fused_native_group_norm_4.run(buf24, buf25, buf26, buf27, buf28, 8, 37, grid=grid(8), stream=stream0) buf30 = empty_strided_cuda((1, 128, s1, s2), (128*s1*s2, s1*s2, s2, 1), torch.float32) buf31 = buf10; del buf10 # reuse # Source Nodes: [add, r_3, r_4, relu_2, x], Original ATen: [aten._to_copy, aten.add, aten.convolution, aten.native_group_norm, aten.relu] triton_poi_fused__to_copy_add_convolution_native_group_norm_relu_8_xnumel = 128*s1*s2 triton_poi_fused__to_copy_add_convolution_native_group_norm_relu_8.run(buf23, buf22, buf27, buf28, arg13_1, arg14_1, buf13, buf12, buf17, buf18, arg9_1, arg10_1, buf30, buf31, ps0, s1, s2, triton_poi_fused__to_copy_add_convolution_native_group_norm_relu_8_xnumel, grid=grid(triton_poi_fused__to_copy_add_convolution_native_group_norm_relu_8_xnumel), stream=stream0) del arg10_1 del arg13_1 del arg14_1 del arg9_1 del buf12 del buf13 del buf17 del buf18 del buf23 buf32 = buf11; del buf11 # reuse # Source Nodes: [r_4, relu_2], Original ATen: [aten._to_copy, aten.convolution, aten.relu] triton_poi_fused__to_copy_convolution_native_group_norm_relu_6.run(arg15_1, buf32, 147456, grid=grid(147456), stream=stream0) del arg15_1 buf33 = buf22; del buf22 # reuse # Source Nodes: [r_4, relu_2], Original ATen: [aten._to_copy, aten.convolution, aten.relu] triton_poi_fused__to_copy_convolution_relu_2.run(arg16_1, buf33, 128, grid=grid(128), stream=stream0) del arg16_1 # Source Nodes: [r_4, relu_2], Original ATen: [aten._to_copy, aten.convolution, aten.relu] buf34 = extern_kernels.convolution(buf31, buf32, stride=(1, 1), padding=(1, 1), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None) assert_size_stride(buf34, (1, 128, s1, s2), (128*s1*s2, s1*s2, s2, 1)) del buf31 buf35 = buf26; del buf26 # reuse buf36 = buf25; del buf25 # reuse buf37 = buf24; del buf24 # reuse # Source Nodes: [r_5], Original ATen: [aten.native_group_norm] triton_red_fused_native_group_norm_7_rnumel = ((36 + (16*s1*s2)) // 37) triton_red_fused_native_group_norm_7.run(buf34, buf33, buf35, buf36, buf37, s1, s2, ps0, 296, triton_red_fused_native_group_norm_7_rnumel, grid=grid(296), stream=stream0) buf38 = buf28; del buf28 # reuse buf39 = buf27; del buf27 # reuse # Source Nodes: [r_5], Original ATen: [aten.native_group_norm] triton_per_fused_native_group_norm_4.run(buf35, buf36, buf37, buf38, buf39, 8, 37, grid=grid(8), stream=stream0) buf41 = buf34; del buf34 # reuse # Source Nodes: [r_5, r_6, relu_3], Original ATen: [aten._to_copy, aten.convolution, aten.native_group_norm, aten.relu] triton_poi_fused__to_copy_convolution_native_group_norm_relu_5_xnumel = 128*s1*s2 triton_poi_fused__to_copy_convolution_native_group_norm_relu_5.run(buf41, buf33, buf38, buf39, arg17_1, arg18_1, ps0, s1, s2, triton_poi_fused__to_copy_convolution_native_group_norm_relu_5_xnumel, grid=grid(triton_poi_fused__to_copy_convolution_native_group_norm_relu_5_xnumel), stream=stream0) del arg17_1 del arg18_1 buf42 = buf32; del buf32 # reuse # Source Nodes: [r_5, r_6, relu_3], Original ATen: [aten._to_copy, aten.convolution, aten.native_group_norm, aten.relu] triton_poi_fused__to_copy_convolution_native_group_norm_relu_6.run(arg19_1, buf42, 147456, grid=grid(147456), stream=stream0) del arg19_1 buf43 = buf33; del buf33 # reuse # Source Nodes: [r_5, r_6, relu_3], Original ATen: [aten._to_copy, aten.convolution, aten.native_group_norm, aten.relu] triton_poi_fused__to_copy_convolution_relu_2.run(arg20_1, buf43, 128, grid=grid(128), stream=stream0) del arg20_1 # Source Nodes: [r_5, r_6, relu_3], Original ATen: [aten._to_copy, aten.convolution, aten.native_group_norm, aten.relu] buf44 = extern_kernels.convolution(buf41, buf42, stride=(1, 1), padding=(1, 1), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None) assert_size_stride(buf44, (1, 128, s1, s2), (128*s1*s2, s1*s2, s2, 1)) del buf41 del buf42 buf45 = buf37; del buf37 # reuse buf46 = buf36; del buf36 # reuse buf47 = buf35; del buf35 # reuse # Source Nodes: [r_7], Original ATen: [aten.native_group_norm] triton_red_fused_native_group_norm_7_rnumel = ((36 + (16*s1*s2)) // 37) triton_red_fused_native_group_norm_7.run(buf44, buf43, buf45, buf46, buf47, s1, s2, ps0, 296, triton_red_fused_native_group_norm_7_rnumel, grid=grid(296), stream=stream0) buf48 = buf39; del buf39 # reuse buf49 = buf38; del buf38 # reuse # Source Nodes: [r_7], Original ATen: [aten.native_group_norm] triton_per_fused_native_group_norm_4.run(buf45, buf46, buf47, buf48, buf49, 8, 37, grid=grid(8), stream=stream0) del buf45 del buf46 del buf47 buf51 = buf30; del buf30 # reuse # Source Nodes: [add_1, r_7], Original ATen: [aten.add, aten.native_group_norm] triton_poi_fused_add_native_group_norm_9_xnumel = 128*s1*s2 triton_poi_fused_add_native_group_norm_9.run(buf51, buf44, buf43, buf48, buf49, arg21_1, arg22_1, ps0, s1, s2, triton_poi_fused_add_native_group_norm_9_xnumel, grid=grid(triton_poi_fused_add_native_group_norm_9_xnumel), stream=stream0) del arg21_1 del arg22_1 del buf43 del buf44 del buf48 del buf49 return (buf51, ) def benchmark_compiled_module(times=10, repeat=10): from torch._dynamo.testing import rand_strided from torch._inductor.utils import print_performance arg0_1 = 136 arg1_1 = 136 arg2_1 = rand_strided((1, 512, 136, 136), (9469952, 18496, 136, 1), device='cuda:0', dtype=torch.float32) arg3_1 = rand_strided((128, 512, 3, 3), (4608, 9, 3, 1), device='cuda:0', dtype=torch.float32) arg4_1 = rand_strided((128, ), (1, ), device='cuda:0', dtype=torch.float32) arg5_1 = rand_strided((128, ), (1, ), device='cuda:0', dtype=torch.float32) arg6_1 = rand_strided((128, ), (1, ), device='cuda:0', dtype=torch.float32) arg7_1 = rand_strided((128, 128, 3, 3), (1152, 9, 3, 1), device='cuda:0', dtype=torch.float32) arg8_1 = rand_strided((128, ), (1, ), device='cuda:0', dtype=torch.float32) arg9_1 = rand_strided((128, ), (1, ), device='cuda:0', dtype=torch.float32) arg10_1 = rand_strided((128, ), (1, ), device='cuda:0', dtype=torch.float32) arg11_1 = rand_strided((128, 512, 3, 3), (4608, 9, 3, 1), device='cuda:0', dtype=torch.float32) arg12_1 = rand_strided((128, ), (1, ), device='cuda:0', dtype=torch.float32) arg13_1 = rand_strided((128, ), (1, ), device='cuda:0', dtype=torch.float32) arg14_1 = rand_strided((128, ), (1, ), device='cuda:0', dtype=torch.float32) arg15_1 = rand_strided((128, 128, 3, 3), (1152, 9, 3, 1), device='cuda:0', dtype=torch.float32) arg16_1 = rand_strided((128, ), (1, ), device='cuda:0', dtype=torch.float32) arg17_1 = rand_strided((128, ), (1, ), device='cuda:0', dtype=torch.float32) arg18_1 = rand_strided((128, ), (1, ), device='cuda:0', dtype=torch.float32) arg19_1 = rand_strided((128, 128, 3, 3), (1152, 9, 3, 1), device='cuda:0', dtype=torch.float32) arg20_1 = rand_strided((128, ), (1, ), device='cuda:0', dtype=torch.float32) arg21_1 = rand_strided((128, ), (1, ), device='cuda:0', dtype=torch.float32) arg22_1 = rand_strided((128, ), (1, ), device='cuda:0', dtype=torch.float32) fn = lambda: call([arg0_1, arg1_1, arg2_1, arg3_1, arg4_1, arg5_1, arg6_1, arg7_1, arg8_1, arg9_1, arg10_1, arg11_1, arg12_1, arg13_1, arg14_1, arg15_1, arg16_1, arg17_1, arg18_1, arg19_1, arg20_1, arg21_1, arg22_1]) 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)