Some tests in test_torchinductor.py fail locally
Labels: triaged, oncall: pt2, module: inductor

### 🐛 Describe the bug

```
FAILED test/inductor/test_torchinductor.py::CudaTests::test_convolution1_cuda - AssertionError: Tensor-likes are not close!
FAILED test/inductor/test_torchinductor.py::CudaTests::test_linear_packed_cuda - AssertionError: Tensor-likes are not close!
FAILED test/inductor/test_torchinductor.py::CudaReproTests::test_input_channels_last - AssertionError: False is not true
```

Full logs:

<details>

```
============================= test session starts ==============================
platform linux -- Python 3.9.16, pytest-7.2.1, pluggy-1.0.0 -- /home/ezyang/local/b/pytorch-env/bin/python
cachedir: .pytest_cache
benchmark: 4.0.0 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/data/users/ezyang/b/pytorch/.hypothesis/examples')
rootdir: /data/users/ezyang/b/pytorch, configfile: pytest.ini
plugins: benchmark-4.0.0, hydra-core-1.1.2, hypothesis-6.62.1, csv-3.0.0
collecting ... collected 751 items / 748 deselected / 3 selected

test/inductor/test_torchinductor.py::CudaTests::test_convolution1_cuda FAILED [ 33%]
test/inductor/test_torchinductor.py::CudaTests::test_linear_packed_cuda FAILED [ 66%]
test/inductor/test_torchinductor.py::CudaReproTests::test_input_channels_last FAILED [100%]

=================================== FAILURES ===================================
_______________________ CudaTests.test_convolution1_cuda _______________________
Traceback (most recent call last):
  File "/data/users/ezyang/b/pytorch/test/inductor/test_torchinductor.py", line 2133, in test_convolution1
    self.common(
  File "/home/ezyang/local/b/pytorch-env/lib/python3.9/unittest/mock.py", line 1336, in patched
    return func(*newargs, **newkeywargs)
  File "/data/users/ezyang/b/pytorch/test/inductor/test_torchinductor.py", line 475, in check_model_cuda
    check_model(
  File "/home/ezyang/local/b/pytorch-env/lib/python3.9/unittest/mock.py", line 1336, in patched
    return func(*newargs, **newkeywargs)
  File "/data/users/ezyang/b/pytorch/test/inductor/test_torchinductor.py", line 363, in check_model
    self.assertEqual(
  File "/data/users/ezyang/b/pytorch/torch/testing/_internal/common_utils.py", line 2934, in assertEqual
    assert_equal(
  File "/data/users/ezyang/b/pytorch/torch/testing/_comparison.py", line 1244, in assert_equal
    raise error_metas[0].to_error(msg)
AssertionError: Tensor-likes are not close!

Mismatched elements: 32 / 2352 (1.4%)
Greatest absolute difference: 0.00048828125 at index (0, 0, 8, 7) (up to 6e-05 allowed)
Greatest relative difference: 0.054365733113673806 at index (0, 1, 4, 1) (up to 0.001 allowed)

The failure occurred for item [0]
----------------------------- Captured stdout call -----------------------------

from ctypes import c_void_p, c_long
import torch
import random
from torch import empty_strided, as_strided, device
from torch._inductor.codecache import AsyncCompile
from torch._inductor.select_algorithm import extern_kernels

aten = torch.ops.aten
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
async_compile = AsyncCompile()

import triton
import triton.language as tl
from torch._inductor.triton_ops.autotune import grid
from torch._C import _cuda_getCurrentRawStream as get_cuda_stream


triton_fused_le_relu_0 = async_compile.triton('''
import triton
import triton.language as tl
from torch._inductor.ir import ReductionHint
from torch._inductor.ir import TileHint
from torch._inductor.triton_ops.autotune import pointwise
from torch._inductor.utils import instance_descriptor

@pointwise(size_hints=[4096], filename=__file__, meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*i1', 3: 'i32'}, 'device': 0, 'constants': {}, 'mutated_arg_names': ['in_out_ptr0'], 'configs': [instance_descriptor(divisible_by_16=(0, 1, 2, 3), equal_to_1=())]})
@triton.jit
def triton_(in_out_ptr0, in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 2352
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x3 = xindex
    x1 = (xindex // 196) % 6
    tmp0 = tl.load(in_out_ptr0 + (x3), xmask)
    tmp1 = tl.load(in_ptr0 + (x1), xmask)
    tmp2 = tmp0 + tmp1
    tmp3 = tl.where(0 != 0, 0, tl.where(0 > tmp2, 0, tmp2))
    tmp4 = 0.0
    tmp5 = tmp3 <= tmp4
    tl.store(in_out_ptr0 + (x3 + tl.zeros([XBLOCK], tl.int32)), tmp3, xmask)
    tl.store(out_ptr0 + (x3 + tl.zeros([XBLOCK], tl.int32)), tmp5, xmask)
''')


async_compile.wait(globals())
del async_compile

def call(args):
    primals_1, primals_2, primals_3 = args
    args.clear()
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0) # no-op to ensure context
        buf0 = aten.convolution(primals_3, primals_1, None, (1, 1), (0, 0), (1, 1), False, (0, 0), 1)
        assert_size_stride(buf0, (2, 6, 14, 14), (1176, 196, 14, 1))
        buf1 = as_strided(buf0, (2, 6, 14, 14), (1176, 196, 14, 1)); del buf0  # reuse
        buf2 = empty_strided((2, 6, 14, 14), (1176, 196, 14, 1), device='cuda', dtype=torch.bool)
        stream0 = get_cuda_stream(0)
        triton_fused_le_relu_0.run(buf1, primals_2, buf2, 2352, grid=grid(2352), stream=stream0)
        del primals_2
        return (buf1, primals_1, primals_3, buf2, )


if __name__ == "__main__":
    from torch._dynamo.testing import rand_strided
    from torch._inductor.utils import print_performance
    primals_1 = rand_strided((6, 5, 3, 3), (45, 9, 3, 1), device='cuda:0', dtype=torch.float32)
    primals_2 = rand_strided((6, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_3 = rand_strided((2, 5, 16, 16), (1280, 256, 16, 1), device='cuda:0', dtype=torch.float32)
    print_performance(lambda: call([primals_1, primals_2, primals_3]))


from ctypes import c_void_p, c_long
import torch
import random
from torch import empty_strided, as_strided, device
from torch._inductor.codecache import AsyncCompile
from torch._inductor.select_algorithm import extern_kernels

aten = torch.ops.aten
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
async_compile = AsyncCompile()

import triton
import triton.language as tl
from torch._inductor.triton_ops.autotune import grid
from torch._C import _cuda_getCurrentRawStream as get_cuda_stream


triton_fused_le_relu_0 = async_compile.triton('''
import triton
import triton.language as tl
from torch._inductor.ir import ReductionHint
from torch._inductor.ir import TileHint
from torch._inductor.triton_ops.autotune import pointwise
from torch._inductor.utils import instance_descriptor

@pointwise(size_hints=[4096], filename=__file__, meta={'signature': {0: '*fp16', 1: '*fp16', 2: '*i1', 3: 'i32'}, 'device': 0, 'constants': {}, 'mutated_arg_names': ['in_out_ptr0'], 'configs': [instance_descriptor(divisible_by_16=(0, 1, 2, 3), equal_to_1=())]})
@triton.jit
def triton_(in_out_ptr0, in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 2352
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x3 = xindex
    x1 = (xindex // 196) % 6
    tmp0 = tl.load(in_out_ptr0 + (x3), xmask).to(tl.float32)
    tmp1 = tl.load(in_ptr0 + (x1), xmask).to(tl.float32)
    tmp2 = tmp0 + tmp1
    tmp3 = tl.where(0 != 0, 0, tl.where(0 > tmp2, 0, tmp2))
    tmp4 = 0.0
    tmp5 = tmp3 <= tmp4
    tl.store(in_out_ptr0 + (x3 + tl.zeros([XBLOCK], tl.int32)), tmp3, xmask)
    tl.store(out_ptr0 + (x3 + tl.zeros([XBLOCK], tl.int32)), tmp5, xmask)
''')


async_compile.wait(globals())
del async_compile

def call(args):
    primals_1, primals_2, primals_3 = args
    args.clear()
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0) # no-op to ensure context
        buf0 = aten.convolution(primals_3, primals_1, None, (1, 1), (0, 0), (1, 1), False, (0, 0), 1)
        assert_size_stride(buf0, (2, 6, 14, 14), (1176, 196, 14, 1))
        buf1 = as_strided(buf0, (2, 6, 14, 14), (1176, 196, 14, 1)); del buf0  # reuse
        buf2 = empty_strided((2, 6, 14, 14), (1176, 196, 14, 1), device='cuda', dtype=torch.bool)
        stream0 = get_cuda_stream(0)
        triton_fused_le_relu_0.run(buf1, primals_2, buf2, 2352, grid=grid(2352), stream=stream0)
        del primals_2
        return (buf1, primals_1, primals_3, buf2, )


if __name__ == "__main__":
    from torch._dynamo.testing import rand_strided
    from torch._inductor.utils import print_performance
    primals_1 = rand_strided((6, 5, 3, 3), (45, 9, 3, 1), device='cuda:0', dtype=torch.float16)
    primals_2 = rand_strided((6, ), (1, ), device='cuda:0', dtype=torch.float16)
    primals_3 = rand_strided((2, 5, 16, 16), (1280, 256, 16, 1), device='cuda:0', dtype=torch.float16)
    print_performance(lambda: call([primals_1, primals_2, primals_3]))

----------------------------- Captured stderr call -----------------------------
/data/users/ezyang/b/pytorch/torch/backends/cudnn/__init__.py:93: UserWarning: PyTorch was compiled without cuDNN/MIOpen support. To use cuDNN/MIOpen, rebuild PyTorch making sure the library is visible to the build system.
  warnings.warn(
/data/users/ezyang/b/pytorch/test/inductor/test_torchinductor.py:265: UserWarning: TypedStorage is deprecated. It will be removed in the future and UntypedStorage will be the only storage class. This should only matter to you if you are using storages directly.  To access UntypedStorage directly, use tensor.untyped_storage() instead of tensor.storage()
  buffer = torch.as_strided(x, (x.storage().size(),), (1,), 0).clone()
/data/users/ezyang/b/pytorch/test/inductor/test_torchinductor.py:265: UserWarning: TypedStorage is deprecated. It will be removed in the future and UntypedStorage will be the only storage class. This should only matter to you if you are using storages directly.  To access UntypedStorage directly, use tensor.untyped_storage() instead of tensor.storage()
  buffer = torch.as_strided(x, (x.storage().size(),), (1,), 0).clone()
------------------------------ Captured log call -------------------------------
INFO     torch._inductor.compile_fx:logging.py:121 Step 3: torchinductor compiling FORWARDS graph 0
INFO     torch._inductor.compile_fx:logging.py:121 Step 3: torchinductor done compiling FORWARDS graph 0
INFO     torch._inductor.compile_fx:logging.py:121 Step 3: torchinductor compiling FORWARDS graph 1
INFO     torch._inductor.compile_fx:logging.py:121 Step 3: torchinductor done compiling FORWARDS graph 1
______________________ CudaTests.test_linear_packed_cuda _______________________
Traceback (most recent call last):
  File "/data/users/ezyang/b/pytorch/test/inductor/test_torchinductor.py", line 1872, in test_linear_packed
    self.common(
  File "/home/ezyang/local/b/pytorch-env/lib/python3.9/unittest/mock.py", line 1336, in patched
    return func(*newargs, **newkeywargs)
  File "/data/users/ezyang/b/pytorch/test/inductor/test_torchinductor.py", line 475, in check_model_cuda
    check_model(
  File "/home/ezyang/local/b/pytorch-env/lib/python3.9/unittest/mock.py", line 1336, in patched
    return func(*newargs, **newkeywargs)
  File "/data/users/ezyang/b/pytorch/test/inductor/test_torchinductor.py", line 363, in check_model
    self.assertEqual(
  File "/data/users/ezyang/b/pytorch/torch/testing/_internal/common_utils.py", line 2934, in assertEqual
    assert_equal(
  File "/data/users/ezyang/b/pytorch/torch/testing/_comparison.py", line 1244, in assert_equal
    raise error_metas[0].to_error(msg)
AssertionError: Tensor-likes are not close!

Mismatched elements: 13 / 180 (7.2%)
Greatest absolute difference: 0.000244140625 at index (0, 0, 15) (up to 1e-05 allowed)
Greatest relative difference: 0.06147772137619854 at index (0, 0, 29) (up to 0.001 allowed)
----------------------------- Captured stdout call -----------------------------

from ctypes import c_void_p, c_long
import torch
import random
from torch import empty_strided, as_strided, device
from torch._inductor.codecache import AsyncCompile
from torch._inductor.select_algorithm import extern_kernels

aten = torch.ops.aten
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
async_compile = AsyncCompile()

import triton
import triton.language as tl
from torch._inductor.triton_ops.autotune import grid
from torch._C import _cuda_getCurrentRawStream as get_cuda_stream


async_compile.wait(globals())
del async_compile

def call(args):
    arg0_1, arg1_1, arg2_1 = args
    args.clear()
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0) # no-op to ensure context
        buf0 = empty_strided((6, 30), (30, 1), device='cuda', dtype=torch.float32)
        extern_kernels.addmm(arg1_1, as_strided(arg2_1, (6, 10), (10, 1)), as_strided(arg0_1, (10, 30), (1, 10)), alpha=1, beta=1, out=buf0)
        del arg0_1
        del arg1_1
        del arg2_1
        return (as_strided(buf0, (2, 3, 30), (90, 30, 1)), )


if __name__ == "__main__":
    from torch._dynamo.testing import rand_strided
    from torch._inductor.utils import print_performance
    arg0_1 = rand_strided((30, 10), (10, 1), device='cuda:0', dtype=torch.float32)
    arg1_1 = rand_strided((30, ), (1, ), device='cuda:0', dtype=torch.float32)
    arg2_1 = rand_strided((2, 3, 10), (30, 10, 1), device='cuda:0', dtype=torch.float32)
    print_performance(lambda: call([arg0_1, arg1_1, arg2_1]))


from ctypes import c_void_p, c_long
import torch
import random
from torch import empty_strided, as_strided, device
from torch._inductor.codecache import AsyncCompile
from torch._inductor.select_algorithm import extern_kernels

aten = torch.ops.aten
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
async_compile = AsyncCompile()

import triton
import triton.language as tl
from torch._inductor.triton_ops.autotune import grid
from torch._C import _cuda_getCurrentRawStream as get_cuda_stream


async_compile.wait(globals())
del async_compile

def call(args):
    arg0_1, arg1_1, arg2_1 = args
    args.clear()
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0) # no-op to ensure context
        buf0 = empty_strided((6, 30), (30, 1), device='cuda', dtype=torch.float16)
        extern_kernels.addmm(arg1_1, as_strided(arg2_1, (6, 10), (10, 1)), as_strided(arg0_1, (10, 30), (1, 10)), alpha=1, beta=1, out=buf0)
        del arg0_1
        del arg1_1
        del arg2_1
        return (as_strided(buf0, (2, 3, 30), (90, 30, 1)), )


if __name__ == "__main__":
    from torch._dynamo.testing import rand_strided
    from torch._inductor.utils import print_performance
    arg0_1 = rand_strided((30, 10), (10, 1), device='cuda:0', dtype=torch.float16)
    arg1_1 = rand_strided((30, ), (1, ), device='cuda:0', dtype=torch.float16)
    arg2_1 = rand_strided((2, 3, 10), (30, 10, 1), device='cuda:0', dtype=torch.float16)
    print_performance(lambda: call([arg0_1, arg1_1, arg2_1]))

----------------------------- Captured stderr call -----------------------------
/data/users/ezyang/b/pytorch/test/inductor/test_torchinductor.py:265: UserWarning: TypedStorage is deprecated. It will be removed in the future and UntypedStorage will be the only storage class. This should only matter to you if you are using storages directly.  To access UntypedStorage directly, use tensor.untyped_storage() instead of tensor.storage()
  buffer = torch.as_strided(x, (x.storage().size(),), (1,), 0).clone()
/data/users/ezyang/b/pytorch/test/inductor/test_torchinductor.py:265: UserWarning: TypedStorage is deprecated. It will be removed in the future and UntypedStorage will be the only storage class. This should only matter to you if you are using storages directly.  To access UntypedStorage directly, use tensor.untyped_storage() instead of tensor.storage()
  buffer = torch.as_strided(x, (x.storage().size(),), (1,), 0).clone()
------------------------------ Captured log call -------------------------------
INFO     torch._inductor.compile_fx:logging.py:121 Step 3: torchinductor compiling FORWARDS graph 2
INFO     torch._inductor.compile_fx:logging.py:121 Step 3: torchinductor done compiling FORWARDS graph 2
INFO     torch._inductor.compile_fx:logging.py:121 Step 3: torchinductor compiling FORWARDS graph 3
INFO     torch._inductor.compile_fx:logging.py:121 Step 3: torchinductor done compiling FORWARDS graph 3
___________________ CudaReproTests.test_input_channels_last ____________________
Traceback (most recent call last):
  File "/data/users/ezyang/b/pytorch/test/inductor/test_torchinductor.py", line 5881, in test_input_channels_last
    self.assertTrue(
  File "/home/ezyang/local/b/pytorch-env/lib/python3.9/unittest/case.py", line 688, in assertTrue
    raise self.failureException(msg)
AssertionError: False is not true
----------------------------- Captured stdout call -----------------------------

from ctypes import c_void_p, c_long
import torch
import random
from torch import empty_strided, as_strided, device
from torch._inductor.codecache import AsyncCompile
from torch._inductor.select_algorithm import extern_kernels

aten = torch.ops.aten
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
async_compile = AsyncCompile()

import triton
import triton.language as tl
from torch._inductor.triton_ops.autotune import grid
from torch._C import _cuda_getCurrentRawStream as get_cuda_stream


triton_fused_convolution_0 = async_compile.triton('''
import triton
import triton.language as tl
from torch._inductor.ir import ReductionHint
from torch._inductor.ir import TileHint
from torch._inductor.triton_ops.autotune import pointwise
from torch._inductor.utils import instance_descriptor

@pointwise(size_hints=[8, 256], tile_hint=TileHint.SQUARE,filename=__file__, meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32', 3: 'i32'}, 'device': 0, 'constants': {}, 'mutated_arg_names': [], 'configs': [instance_descriptor(divisible_by_16=(0, 1, 3), equal_to_1=())]})
@triton.jit
def triton_(in_ptr0, out_ptr0, xnumel, ynumel, XBLOCK : tl.constexpr, YBLOCK : tl.constexpr):
    xnumel = 6
    ynumel = 256
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    yoffset = tl.program_id(1) * YBLOCK
    yindex = yoffset + tl.arange(0, YBLOCK)[None, :]
    ymask = yindex < ynumel
    x0 = xindex % 3
    x1 = (xindex // 3)
    y2 = yindex
    x3 = xindex
    tmp0 = tl.load(in_ptr0 + (x0 + (3*y2) + (768*x1)), xmask & ymask)
    tl.store(out_ptr0 + (y2 + (256*x3) + tl.zeros([XBLOCK, YBLOCK], tl.int32)), tmp0, xmask & ymask)
''')


triton_fused_convolution_1 = async_compile.triton('''
import triton
import triton.language as tl
from torch._inductor.ir import ReductionHint
from torch._inductor.ir import TileHint
from torch._inductor.triton_ops.autotune import pointwise
from torch._inductor.utils import instance_descriptor

@pointwise(size_hints=[2048], filename=__file__, meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32'}, 'device': 0, 'constants': {}, 'mutated_arg_names': ['in_out_ptr0'], 'configs': [instance_descriptor(divisible_by_16=(0, 1, 2), equal_to_1=())]})
@triton.jit
def triton_(in_out_ptr0, in_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 1536
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x3 = xindex
    x1 = (xindex // 256) % 3
    tmp0 = tl.load(in_out_ptr0 + (x3), xmask)
    tmp1 = tl.load(in_ptr0 + (x1), xmask)
    tmp2 = tmp0 + tmp1
    tl.store(in_out_ptr0 + (x3 + tl.zeros([XBLOCK], tl.int32)), tmp2, xmask)
''')


async_compile.wait(globals())
del async_compile

def call(args):
    primals_1, primals_2, primals_3 = args
    args.clear()
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0) # no-op to ensure context
        buf0 = empty_strided((2, 3, 16, 16), (768, 256, 16, 1), device='cuda', dtype=torch.float32)
        stream0 = get_cuda_stream(0)
        triton_fused_convolution_0.run(primals_3, buf0, 6, 256, grid=grid(6, 256), stream=stream0)
        buf1 = aten.convolution(buf0, primals_1, None, (1, 1), (0, 0), (1, 1), False, (0, 0), 1)
        assert_size_stride(buf1, (2, 3, 16, 16), (768, 256, 16, 1))
        del buf0
        buf2 = as_strided(buf1, (2, 3, 16, 16), (768, 256, 16, 1)); del buf1  # reuse
        triton_fused_convolution_1.run(buf2, primals_2, 1536, grid=grid(1536), stream=stream0)
        del primals_2
        return (buf2, primals_1, primals_3, )


if __name__ == "__main__":
    from torch._dynamo.testing import rand_strided
    from torch._inductor.utils import print_performance
    primals_1 = rand_strided((3, 3, 1, 1), (3, 1, 1, 1), device='cuda:0', dtype=torch.float32)
    primals_2 = rand_strided((3, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_3 = rand_strided((2, 3, 16, 16), (768, 1, 48, 3), device='cuda:0', dtype=torch.float32)
    print_performance(lambda: call([primals_1, primals_2, primals_3]))


from ctypes import c_void_p, c_long
import torch
import random
from torch import empty_strided, as_strided, device
from torch._inductor.codecache import AsyncCompile
from torch._inductor.select_algorithm import extern_kernels

aten = torch.ops.aten
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
async_compile = AsyncCompile()

import triton
import triton.language as tl
from torch._inductor.triton_ops.autotune import grid
from torch._C import _cuda_getCurrentRawStream as get_cuda_stream


triton_fused_convolution_0 = async_compile.triton('''
import triton
import triton.language as tl
from torch._inductor.ir import ReductionHint
from torch._inductor.ir import TileHint
from torch._inductor.triton_ops.autotune import pointwise
from torch._inductor.utils import instance_descriptor

@pointwise(size_hints=[8, 256], tile_hint=TileHint.SQUARE,filename=__file__, meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32', 3: 'i32'}, 'device': 0, 'constants': {}, 'mutated_arg_names': [], 'configs': [instance_descriptor(divisible_by_16=(0, 1, 3), equal_to_1=())]})
@triton.jit
def triton_(in_ptr0, out_ptr0, xnumel, ynumel, XBLOCK : tl.constexpr, YBLOCK : tl.constexpr):
    xnumel = 6
    ynumel = 256
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    yoffset = tl.program_id(1) * YBLOCK
    yindex = yoffset + tl.arange(0, YBLOCK)[None, :]
    ymask = yindex < ynumel
    x0 = xindex % 3
    x1 = (xindex // 3)
    y2 = yindex
    x3 = xindex
    tmp0 = tl.load(in_ptr0 + (x0 + (3*y2) + (768*x1)), xmask & ymask)
    tl.store(out_ptr0 + (y2 + (256*x3) + tl.zeros([XBLOCK, YBLOCK], tl.int32)), tmp0, xmask & ymask)
''')


triton_fused_convolution_1 = async_compile.triton('''
import triton
import triton.language as tl
from torch._inductor.ir import ReductionHint
from torch._inductor.ir import TileHint
from torch._inductor.triton_ops.autotune import pointwise
from torch._inductor.utils import instance_descriptor

@pointwise(size_hints=[2048], filename=__file__, meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32'}, 'device': 0, 'constants': {}, 'mutated_arg_names': ['in_out_ptr0'], 'configs': [instance_descriptor(divisible_by_16=(0, 1, 2), equal_to_1=())]})
@triton.jit
def triton_(in_out_ptr0, in_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 1536
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x3 = xindex
    x1 = (xindex // 256) % 3
    tmp0 = tl.load(in_out_ptr0 + (x3), xmask)
    tmp1 = tl.load(in_ptr0 + (x1), xmask)
    tmp2 = tmp0 + tmp1
    tl.store(in_out_ptr0 + (x3 + tl.zeros([XBLOCK], tl.int32)), tmp2, xmask)
''')


async_compile.wait(globals())
del async_compile

def call(args):
    primals_1, primals_2, primals_3 = args
    args.clear()
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0) # no-op to ensure context
        buf0 = empty_strided((2, 3, 16, 16), (768, 256, 16, 1), device='cuda', dtype=torch.float32)
        stream0 = get_cuda_stream(0)
        triton_fused_convolution_0.run(primals_3, buf0, 6, 256, grid=grid(6, 256), stream=stream0)
        buf1 = aten.convolution(buf0, primals_1, None, (1, 1), (0, 0), (1, 1), False, (0, 0), 1)
        assert_size_stride(buf1, (2, 3, 16, 16), (768, 256, 16, 1))
        del buf0
        buf2 = as_strided(buf1, (2, 3, 16, 16), (768, 256, 16, 1)); del buf1  # reuse
        triton_fused_convolution_1.run(buf2, primals_2, 1536, grid=grid(1536), stream=stream0)
        del primals_2
        return (buf2, primals_1, primals_3, )


if __name__ == "__main__":
    from torch._dynamo.testing import rand_strided
    from torch._inductor.utils import print_performance
    primals_1 = rand_strided((3, 3, 1, 1), (3, 1, 1, 1), device='cuda:0', dtype=torch.float32)
    primals_2 = rand_strided((3, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_3 = rand_strided((2, 3, 16, 16), (768, 1, 48, 3), device='cuda:0', dtype=torch.float32)
    print_performance(lambda: call([primals_1, primals_2, primals_3]))

----------------------------- Captured stderr call -----------------------------
/data/users/ezyang/b/pytorch/test/inductor/test_torchinductor.py:265: UserWarning: TypedStorage is deprecated. It will be removed in the future and UntypedStorage will be the only storage class. This should only matter to you if you are using storages directly.  To access UntypedStorage directly, use tensor.untyped_storage() instead of tensor.storage()
  buffer = torch.as_strided(x, (x.storage().size(),), (1,), 0).clone()
------------------------------ Captured log call -------------------------------
INFO     torch._inductor.compile_fx:logging.py:121 Step 3: torchinductor compiling FORWARDS graph 4
INFO     torch._inductor.compile_fx:logging.py:121 Step 3: torchinductor done compiling FORWARDS graph 4
INFO     torch._inductor.compile_fx:logging.py:121 Step 3: torchinductor compiling FORWARDS graph 5
INFO     torch._inductor.compile_fx:logging.py:121 Step 3: torchinductor done compiling FORWARDS graph 5
=========================== short test summary info ============================
FAILED test/inductor/test_torchinductor.py::CudaTests::test_convolution1_cuda
FAILED test/inductor/test_torchinductor.py::CudaTests::test_linear_packed_cuda
FAILED test/inductor/test_torchinductor.py::CudaReproTests::test_input_channels_last
====================== 3 failed, 748 deselected in 12.28s ======================
```
</details>

This is on a fairly normal source build of PyTorch on a Meta A100 devgpu. NVIDIA PG509-210, driver and runtime is CUDA 11.4

Also, this test incorrectly fails when built without cudnn (but the "fix" for this is to build with cudnn lol)

```
FAILED test/inductor/test_torchinductor.py::CudaTests::test_cudnn_rnn_cuda - RuntimeError: _cudnn_rnn: ATen not compiled with cuDNN support
```

### Versions

master

cc @soumith @msaroufim @wconstab @ngimel @bdhirsh @mlazos @voznesenskym @yanboliang @penguinwu @anijain2305 @EikanWang @jgong5 @Guobing-Chen @chunyuan-w @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @peterbell10 @desertfire