Repository: pytorch
Issue: `PYTORCH_TEST_WITH_INDUCTOR=1 python test/test_ops.py -k test_out_{warnings_, *}{_refs_, *}randn_cuda_float32` fails on main
Labels: triaged,module: random,oncall: pt2,module: dynamo

### 🐛 Describe the bug

Fails here: https://github.com/pytorch/pytorch/actions/runs/6138879778/job/16656457699?pr=108982

Also spotted in other PRs: https://github.com/pytorch/pytorch/actions/runs/6131975327/job/16642698215

Reproduced locally running on main:
`PYTORCH_TEST_WITH_INDUCTOR=1 python test/test_ops.py -k test_out__refs_randn_cuda_float32`

```
PYTORCH_TEST_WITH_INDUCTOR=1 python test/test_ops.py -k test_out__refs_randn_cuda_float32
[2023-09-11 07:37:03,048] torch._dynamo.convert_frame: [WARNING] WON'T CONVERT get_rng_state /home/jonch/Desktop/Programming/mlsys/pytorch/torch/random.py line 21 
[2023-09-11 07:37:03,048] torch._dynamo.convert_frame: [WARNING] due to: 
[2023-09-11 07:37:03,048] torch._dynamo.convert_frame: [WARNING] Traceback (most recent call last):
[2023-09-11 07:37:03,048] torch._dynamo.convert_frame: [WARNING]   File "/home/jonch/Desktop/Programming/mlsys/pytorch/torch/_subclasses/meta_utils.py", line 198, in meta_tensor
[2023-09-11 07:37:03,048] torch._dynamo.convert_frame: [WARNING]     assert not torch._C._dispatch_tls_local_exclude_set().has(
[2023-09-11 07:37:03,048] torch._dynamo.convert_frame: [WARNING] AssertionError: 
[2023-09-11 07:37:03,048] torch._dynamo.convert_frame: [WARNING] 
[2023-09-11 07:37:03,048] torch._dynamo.convert_frame: [WARNING] from user code:
[2023-09-11 07:37:03,048] torch._dynamo.convert_frame: [WARNING]    File "/home/jonch/Desktop/Programming/mlsys/pytorch/torch/random.py", line 23, in get_rng_state
[2023-09-11 07:37:03,048] torch._dynamo.convert_frame: [WARNING]     return default_generator.get_state()
[2023-09-11 07:37:03,048] torch._dynamo.convert_frame: [WARNING] 
[2023-09-11 07:37:03,048] torch._dynamo.convert_frame: [WARNING] Set TORCH_LOGS="+dynamo" and TORCHDYNAMO_VERBOSE=1 for more information
[2023-09-11 07:37:03,048] torch._dynamo.convert_frame: [WARNING] 
[2023-09-11 07:37:03,048] torch._dynamo.convert_frame: [WARNING] 
[2023-09-11 07:37:03,076] torch._dynamo.convert_frame: [WARNING] WON'T CONVERT <resume in manual_seed> /home/jonch/Desktop/Programming/mlsys/pytorch/torch/random.py line 43 
[2023-09-11 07:37:03,076] torch._dynamo.convert_frame: [WARNING] due to: 
[2023-09-11 07:37:03,076] torch._dynamo.convert_frame: [WARNING] Traceback (most recent call last):
[2023-09-11 07:37:03,076] torch._dynamo.convert_frame: [WARNING]   File "/home/jonch/Desktop/Programming/mlsys/pytorch/torch/_dynamo/utils.py", line 1411, in run_node
[2023-09-11 07:37:03,076] torch._dynamo.convert_frame: [WARNING]     return node.target(*args, **kwargs)
[2023-09-11 07:37:03,076] torch._dynamo.convert_frame: [WARNING] torch._dynamo.exc.TorchRuntimeError: Failed running call_function <built-in method manual_seed of torch._C.Generator object at 0x7f5fccbe33b0>(*(42,), **{}):
[2023-09-11 07:37:03,076] torch._dynamo.convert_frame: [WARNING] manual_seed expected a long, but got SymInt
[2023-09-11 07:37:03,076] torch._dynamo.convert_frame: [WARNING] 
[2023-09-11 07:37:03,076] torch._dynamo.convert_frame: [WARNING] from user code:
[2023-09-11 07:37:03,076] torch._dynamo.convert_frame: [WARNING]    File "/home/jonch/Desktop/Programming/mlsys/pytorch/torch/random.py", line 48, in <resume in manual_seed>
[2023-09-11 07:37:03,076] torch._dynamo.convert_frame: [WARNING]     return default_generator.manual_seed(seed)
[2023-09-11 07:37:03,076] torch._dynamo.convert_frame: [WARNING] 
[2023-09-11 07:37:03,076] torch._dynamo.convert_frame: [WARNING] Set TORCH_LOGS="+dynamo" and TORCHDYNAMO_VERBOSE=1 for more information
[2023-09-11 07:37:03,076] torch._dynamo.convert_frame: [WARNING] 
[2023-09-11 07:37:03,076] torch._dynamo.convert_frame: [WARNING] 
[2023-09-11 07:37:03,080] torch._dynamo.convert_frame: [WARNING] WON'T CONVERT set_rng_state /home/jonch/Desktop/Programming/mlsys/pytorch/torch/random.py line 9 
[2023-09-11 07:37:03,080] torch._dynamo.convert_frame: [WARNING] due to: 
[2023-09-11 07:37:03,080] torch._dynamo.convert_frame: [WARNING] Traceback (most recent call last):
[2023-09-11 07:37:03,080] torch._dynamo.convert_frame: [WARNING]   File "/home/jonch/Desktop/Programming/mlsys/pytorch/torch/_subclasses/meta_utils.py", line 198, in meta_tensor
[2023-09-11 07:37:03,080] torch._dynamo.convert_frame: [WARNING]     assert not torch._C._dispatch_tls_local_exclude_set().has(
[2023-09-11 07:37:03,080] torch._dynamo.convert_frame: [WARNING] AssertionError: 
[2023-09-11 07:37:03,080] torch._dynamo.convert_frame: [WARNING] 
[2023-09-11 07:37:03,080] torch._dynamo.convert_frame: [WARNING] from user code:
[2023-09-11 07:37:03,080] torch._dynamo.convert_frame: [WARNING]  
[2023-09-11 07:37:03,080] torch._dynamo.convert_frame: [WARNING] Set TORCH_LOGS="+dynamo" and TORCHDYNAMO_VERBOSE=1 for more information
[2023-09-11 07:37:03,080] torch._dynamo.convert_frame: [WARNING] 
[2023-09-11 07:37:03,080] torch._dynamo.convert_frame: [WARNING] 
[2023-09-11 07:37:03,084] torch._dynamo.convert_frame: [WARNING] WON'T CONVERT _compare_out /home/jonch/Desktop/Programming/mlsys/pytorch/test/test_ops.py line 833 
[2023-09-11 07:37:03,084] torch._dynamo.convert_frame: [WARNING] due to: 
[2023-09-11 07:37:03,084] torch._dynamo.convert_frame: [WARNING] Traceback (most recent call last):
[2023-09-11 07:37:03,084] torch._dynamo.convert_frame: [WARNING]   File "/home/jonch/Desktop/Programming/mlsys/pytorch/torch/_dynamo/variables/torch.py", line 248, in call_function
[2023-09-11 07:37:03,084] torch._dynamo.convert_frame: [WARNING]     self.as_python_constant()(
[2023-09-11 07:37:03,084] torch._dynamo.convert_frame: [WARNING] torch._dynamo.exc.InternalTorchDynamoError: torch.iinfo() requires an integer input type. Use torch.finfo to handle 'torch.iinfo'
[2023-09-11 07:37:03,084] torch._dynamo.convert_frame: [WARNING] 
[2023-09-11 07:37:03,084] torch._dynamo.convert_frame: [WARNING] from user code:
[2023-09-11 07:37:03,084] torch._dynamo.convert_frame: [WARNING]    File "/home/jonch/Desktop/Programming/mlsys/pytorch/test/test_ops.py", line 834, in _compare_out
[2023-09-11 07:37:03,084] torch._dynamo.convert_frame: [WARNING]     out = _apply_out_transform(transform, expected)
[2023-09-11 07:37:03,084] torch._dynamo.convert_frame: [WARNING]   File "/home/jonch/Desktop/Programming/mlsys/pytorch/test/test_ops.py", line 807, in _apply_out_transform
[2023-09-11 07:37:03,084] torch._dynamo.convert_frame: [WARNING]     return fn(out)
[2023-09-11 07:37:03,084] torch._dynamo.convert_frame: [WARNING]   File "/home/jonch/Desktop/Programming/mlsys/pytorch/test/test_ops.py", line 856, in _case_zero_transform
[2023-09-11 07:37:03,084] torch._dynamo.convert_frame: [WARNING]     info = torch.iinfo(t.dtype)
[2023-09-11 07:37:03,084] torch._dynamo.convert_frame: [WARNING] 
[2023-09-11 07:37:03,084] torch._dynamo.convert_frame: [WARNING] Set TORCH_LOGS="+dynamo" and TORCHDYNAMO_VERBOSE=1 for more information
[2023-09-11 07:37:03,084] torch._dynamo.convert_frame: [WARNING] 
[2023-09-11 07:37:03,084] torch._dynamo.convert_frame: [WARNING] 
[2023-09-11 07:37:03,087] torch._dynamo.convert_frame: [WARNING] WON'T CONVERT _apply_out_transform /home/jonch/Desktop/Programming/mlsys/pytorch/test/test_ops.py line 805 
[2023-09-11 07:37:03,087] torch._dynamo.convert_frame: [WARNING] due to: 
[2023-09-11 07:37:03,087] torch._dynamo.convert_frame: [WARNING] Traceback (most recent call last):
[2023-09-11 07:37:03,087] torch._dynamo.convert_frame: [WARNING]   File "/home/jonch/Desktop/Programming/mlsys/pytorch/torch/_dynamo/variables/torch.py", line 248, in call_function
[2023-09-11 07:37:03,087] torch._dynamo.convert_frame: [WARNING]     self.as_python_constant()(
[2023-09-11 07:37:03,087] torch._dynamo.convert_frame: [WARNING] torch._dynamo.exc.InternalTorchDynamoError: torch.iinfo() requires an integer input type. Use torch.finfo to handle 'torch.iinfo'
[2023-09-11 07:37:03,087] torch._dynamo.convert_frame: [WARNING] 
[2023-09-11 07:37:03,087] torch._dynamo.convert_frame: [WARNING] from user code:
[2023-09-11 07:37:03,087] torch._dynamo.convert_frame: [WARNING]    File "/home/jonch/Desktop/Programming/mlsys/pytorch/test/test_ops.py", line 807, in _apply_out_transform
[2023-09-11 07:37:03,087] torch._dynamo.convert_frame: [WARNING]     return fn(out)
[2023-09-11 07:37:03,087] torch._dynamo.convert_frame: [WARNING]   File "/home/jonch/Desktop/Programming/mlsys/pytorch/test/test_ops.py", line 856, in _case_zero_transform
[2023-09-11 07:37:03,087] torch._dynamo.convert_frame: [WARNING]     info = torch.iinfo(t.dtype)
[2023-09-11 07:37:03,087] torch._dynamo.convert_frame: [WARNING] 
[2023-09-11 07:37:03,087] torch._dynamo.convert_frame: [WARNING] Set TORCH_LOGS="+dynamo" and TORCHDYNAMO_VERBOSE=1 for more information
[2023-09-11 07:37:03,087] torch._dynamo.convert_frame: [WARNING] 
[2023-09-11 07:37:03,087] torch._dynamo.convert_frame: [WARNING] 
[2023-09-11 07:37:03,089] torch._dynamo.convert_frame: [WARNING] WON'T CONVERT _case_zero_transform /home/jonch/Desktop/Programming/mlsys/pytorch/test/test_ops.py line 854 
[2023-09-11 07:37:03,089] torch._dynamo.convert_frame: [WARNING] due to: 
[2023-09-11 07:37:03,089] torch._dynamo.convert_frame: [WARNING] Traceback (most recent call last):
[2023-09-11 07:37:03,089] torch._dynamo.convert_frame: [WARNING]   File "/home/jonch/Desktop/Programming/mlsys/pytorch/torch/_dynamo/variables/torch.py", line 248, in call_function
[2023-09-11 07:37:03,089] torch._dynamo.convert_frame: [WARNING]     self.as_python_constant()(
[2023-09-11 07:37:03,089] torch._dynamo.convert_frame: [WARNING] torch._dynamo.exc.InternalTorchDynamoError: torch.iinfo() requires an integer input type. Use torch.finfo to handle 'torch.iinfo'
[2023-09-11 07:37:03,089] torch._dynamo.convert_frame: [WARNING] 
[2023-09-11 07:37:03,089] torch._dynamo.convert_frame: [WARNING] from user code:
[2023-09-11 07:37:03,089] torch._dynamo.convert_frame: [WARNING]    File "/home/jonch/Desktop/Programming/mlsys/pytorch/test/test_ops.py", line 856, in _case_zero_transform
[2023-09-11 07:37:03,089] torch._dynamo.convert_frame: [WARNING]     info = torch.iinfo(t.dtype)
[2023-09-11 07:37:03,089] torch._dynamo.convert_frame: [WARNING] 
[2023-09-11 07:37:03,089] torch._dynamo.convert_frame: [WARNING] Set TORCH_LOGS="+dynamo" and TORCHDYNAMO_VERBOSE=1 for more information
[2023-09-11 07:37:03,089] torch._dynamo.convert_frame: [WARNING] 
[2023-09-11 07:37:03,089] torch._dynamo.convert_frame: [WARNING] 
F
======================================================================
FAIL: test_out__refs_randn_cuda_float32 (__main__.TestCommonCUDA)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jonch/Desktop/Programming/mlsys/pytorch/torch/testing/_internal/common_utils.py", line 2406, in wrapper
    method(*args, **kwargs)
  File "/home/jonch/Desktop/Programming/mlsys/pytorch/torch/testing/_internal/common_utils.py", line 2406, in wrapper
    method(*args, **kwargs)
  File "/home/jonch/Desktop/Programming/mlsys/pytorch/torch/testing/_internal/common_device_type.py", line 415, in instantiated_test
    result = test(self, **param_kwargs)
  File "/home/jonch/Desktop/Programming/mlsys/pytorch/torch/testing/_internal/common_device_type.py", line 908, in test_wrapper
    return test(*args, **kwargs)
  File "/home/jonch/Desktop/Programming/mlsys/pytorch/test/test_ops.py", line 781, in test_out
    samples = op.sample_inputs(device, dtype)
  File "/home/jonch/Desktop/Programming/mlsys/pytorch/test/test_ops.py", line 873, in <resume in test_out>
    _compare_out(_case_one_transform)
  File "/home/jonch/Desktop/Programming/mlsys/pytorch/test/test_ops.py", line 841, in _compare_out
    self.assertEqual(expected, out)
  File "/home/jonch/Desktop/Programming/mlsys/pytorch/torch/testing/_internal/common_utils.py", line 3309, in assertEqual
    raise error_metas.pop()[0].to_error(
AssertionError: Tensor-likes are not close!

Mismatched elements: 10 / 10 (100.0%)
Greatest absolute difference: 2.6712822914123535 at index (7,) (up to 1e-05 allowed)
Greatest relative difference: 3.5533642768859863 at index (0,) (up to 1.3e-06 allowed)

To execute this test, run the following from the base repo dir:
    PYTORCH_TEST_WITH_INDUCTOR=1 python test/test_ops.py -k test_out__refs_randn_cuda_float32

This message can be suppressed by setting PYTORCH_PRINT_REPRO_ON_FAILURE=0

```

### Versions

PyTorch version: 2.2.0a0+git2b9ad3d
Is debug build: False
CUDA used to build PyTorch: 12.2
ROCM used to build PyTorch: N/A

OS: Ubuntu 22.04.3 LTS (x86_64)
GCC version: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Clang version: Could not collect
CMake version: version 3.27.2
Libc version: glibc-2.35

Python version: 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] (64-bit runtime)
Python platform: Linux-6.2.0-32-generic-x86_64-with-glibc2.35
Is CUDA available: True
CUDA runtime version: 12.2.128
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 4070 Laptop GPU
Nvidia driver version: 535.86.10
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.8.9.4
/usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.9.4
/usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.9.4
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.9.4
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.9.4
/usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.9.4
/usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.9.4
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: False

CPU:
Architecture:                       x86_64
CPU op-mode(s):                     32-bit, 64-bit
Address sizes:                      46 bits physical, 48 bits virtual
Byte Order:                         Little Endian
CPU(s):                             20
On-line CPU(s) list:                0-19
Vendor ID:                          GenuineIntel
Model name:                         13th Gen Intel(R) Core(TM) i9-13900H
CPU family:                         6
Model:                              186
Thread(s) per core:                 2
Core(s) per socket:                 14
Socket(s):                          1
Stepping:                           2
CPU max MHz:                        5400.0000
CPU min MHz:                        400.0000
BogoMIPS:                           5990.40
Flags:                              fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb intel_pt sha_ni xsaveopt xsavec xgetbv1 xsaves avx_vnni dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req hfi umip pku ospke waitpkg gfni vaes vpclmulqdq tme rdpid movdiri movdir64b fsrm md_clear serialize pconfig arch_lbr ibt flush_l1d arch_capabilities
Virtualization:                     VT-x
L1d cache:                          544 KiB (14 instances)
L1i cache:                          704 KiB (14 instances)
L2 cache:                           11.5 MiB (8 instances)
L3 cache:                           24 MiB (1 instance)
NUMA node(s):                       1
NUMA node0 CPU(s):                  0-19
Vulnerability Gather data sampling: Not affected
Vulnerability Itlb multihit:        Not affected
Vulnerability L1tf:                 Not affected
Vulnerability Mds:                  Not affected
Vulnerability Meltdown:             Not affected
Vulnerability Mmio stale data:      Not affected
Vulnerability Retbleed:             Not affected
Vulnerability Spec store bypass:    Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:           Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:           Mitigation; Enhanced IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS SW sequence
Vulnerability Srbds:                Not affected
Vulnerability Tsx async abort:      Not affected

Versions of relevant libraries:
[pip3] flake8==6.0.0
[pip3] flake8-bugbear==23.3.23
[pip3] flake8-comprehensions==3.12.0
[pip3] flake8-executable==2.1.3
[pip3] flake8-logging-format==0.9.0
[pip3] flake8-pyi==23.3.1
[pip3] flake8-simplify==0.19.3
[pip3] jax-triton==0.1.4
[pip3] mypy==1.4.1
[pip3] mypy-extensions==1.0.0
[pip3] numpy==1.24.3
[pip3] pytorch-triton==2.1.0+6e4932cda8
[pip3] torch==2.2.0a0+git2b9ad3d
[pip3] torchaudio==2.0.2
[pip3] torchvision==0.15.2
[pip3] triton==2.1.0
[conda] Could not collect


cc @pbelevich @ezyang @msaroufim @wconstab @bdhirsh @anijain2305 @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @chenyang78 @aakhundov @kadeng