Incompatibility with complex tensors
Labels: triaged, module: complex, oncall: pt2

### 🐛 Describe the bug

I am compiling a model that involves fourier transform and inverse fourier transform of tensors, which involves complex values after the transform. I am getting the error:

  [2023-03-21 15:23:29,937] torch._dynamo.convert_frame: [ERROR] WON'T CONVERT <graph break in fft2d> /mnt/c/Users/Jin Yi/Documents/ArianaPHD/research/neural_operator/FNO2D.py line 87 
due to: 
Traceback (most recent call last):
  File "/home/jinyi12/miniconda3/envs/phasefield/lib/python3.8/site-packages/torch/_ops.py", line 287, in __call__
    return self._op(*args, **kwargs or {})
RuntimeError: aten::_conj() Expected a value of type 'Tensor' for argument 'self' but instead found type 'complex'.
Position: 0
Value: -6.283185307179586j
Declaration: aten::_conj(Tensor(a) self) -> Tensor(a)
Cast error details: Unable to cast -6.283185307179586j to Tensor

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/jinyi12/miniconda3/envs/phasefield/lib/python3.8/site-packages/torch/_dynamo/output_graph.py", line 675, in call_user_compiler
    raise BackendCompilerFailed(self.compiler_fn, e) from e
torch._dynamo.exc.BackendCompilerFailed: debug_wrapper raised RuntimeError: aten::_conj() Expected a value of type 'Tensor' for argument 'self' but instead found type 'complex'.
Position: 0
Value: -6.283185307179586j
Declaration: aten::_conj(Tensor(a) self) -> Tensor(a)
Cast error details: Unable to cast -6.283185307179586j to Tensor

Set torch._dynamo.config.verbose=True for more information

### Error logs

Traceback (most recent call last):
  File "/home/jinyi12/miniconda3/envs/phasefield/lib/python3.8/site-packages/torch/_ops.py", line 287, in __call__
    return self._op(*args, **kwargs or {})
RuntimeError: aten::_conj() Expected a value of type 'Tensor' for argument 'self' but instead found type 'complex'.
Position: 0
Value: -6.283185307179586j
Declaration: aten::_conj(Tensor(a) self) -> Tensor(a)
Cast error details: Unable to cast -6.283185307179586j to Tensor

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/jinyi12/miniconda3/envs/phasefield/lib/python3.8/site-packages/torch/_dynamo/output_graph.py", line 675, in call_user_compiler
    raise BackendCompilerFailed(self.compiler_fn, e) from e
torch._dynamo.exc.BackendCompilerFailed: debug_wrapper raised RuntimeError: aten::_conj() Expected a value of type 'Tensor' for argument 'self' but instead found type 'complex'.
Position: 0
Value: -6.283185307179586j
Declaration: aten::_conj(Tensor(a) self) -> Tensor(a)
Cast error details: Unable to cast -6.283185307179586j to Tensor

Set torch._dynamo.config.verbose=True for more information


[2023-03-21 15:23:30,775] torch._dynamo.convert_frame: [ERROR] WON'T CONVERT <graph break in forward> /mnt/c/Users/Jin Yi/Documents/ArianaPHD/research/neural_operator/FNO2D.py line 45 
due to: 
Traceback (most recent call last):
  File "/home/jinyi12/miniconda3/envs/phasefield/lib/python3.8/site-packages/torch/_functorch/partitioners.py", line 220, in _tensor_nbytes
    raise NotImplementedError("Don't know the size of dtype ", dtype)
NotImplementedError: ("Don't know the size of dtype ", torch.complex64)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/jinyi12/miniconda3/envs/phasefield/lib/python3.8/site-packages/torch/_dynamo/output_graph.py", line 675, in call_user_compiler
    raise BackendCompilerFailed(self.compiler_fn, e) from e
torch._dynamo.exc.BackendCompilerFailed: debug_wrapper raised NotImplementedError: ("Don't know the size of dtype ", torch.complex64)

Set torch._dynamo.config.verbose=True for more information

### Minified repro

_No response_

### Versions

Collecting environment information...
PyTorch version: 2.0.0+cu118
Is debug build: False
CUDA used to build PyTorch: 11.8
ROCM used to build PyTorch: N/A

OS: Ubuntu 20.04.5 LTS (x86_64)
GCC version: (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
Clang version: Could not collect
CMake version: version 3.25.0
Libc version: glibc-2.31

Python version: 3.8.16 (default, Jan 17 2023, 23:13:24)  [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.17
Is CUDA available: True
CUDA runtime version: 12.1.66
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 2070 SUPER
Nvidia driver version: 516.94
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Architecture:                    x86_64
CPU op-mode(s):                  32-bit, 64-bit
Byte Order:                      Little Endian
Address sizes:                   48 bits physical, 48 bits virtual
CPU(s):                          24
On-line CPU(s) list:             0-23
Thread(s) per core:              2
Core(s) per socket:              12
Socket(s):                       1
Vendor ID:                       AuthenticAMD
CPU family:                      23
Model:                           1
Model name:                      AMD Ryzen Threadripper 1920X 12-Core Processor
Stepping:                        1
CPU MHz:                         3493.476
BogoMIPS:                        6986.95
Hypervisor vendor:               Microsoft
Virtualization type:             full
L1d cache:                       384 KiB
L1i cache:                       768 KiB
L2 cache:                        6 MiB
L3 cache:                        24 MiB
Vulnerability Itlb multihit:     Not affected
Vulnerability L1tf:              Not affected
Vulnerability Mds:               Not affected
Vulnerability Meltdown:          Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1:        Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:        Mitigation; Full AMD retpoline, IBPB conditional, STIBP disabled, RSB filling
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Not affected
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl tsc_reliable nonstop_tsc cpuid extd_apicid pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw topoext ssbd ibpb vmmcall fsgsbase bmi1 avx2 smep bmi2 rdseed adx smap clflushopt sha_ni xsaveopt xsavec xgetbv1 xsaves clzero xsaveerptr virt_ssbd arat

Versions of relevant libraries:
[pip3] adabelief-pytorch==0.2.0
[pip3] mypy==1.0.0
[pip3] mypy-extensions==1.0.0
[pip3] numpy==1.24.1
[pip3] pytorch-lightning==1.6.2
[pip3] pytorch-triton==2.0.0+0d7e753227
[pip3] torch==2.0.0+cu118
[pip3] torchaudio==2.0.0.dev20230201+cu116
[pip3] torchmetrics==0.8.1
[pip3] torchsummary==1.5.1
[pip3] torchvision==0.15.0.dev20230201+cu116
[pip3] triton==2.0.0
[conda] adabelief-pytorch         0.2.0                    pypi_0    pypi
[conda] numpy                     1.24.1                   pypi_0    pypi
[conda] pytorch-lightning         1.6.2                    pypi_0    pypi
[conda] pytorch-triton            2.0.0+0d7e753227          pypi_0    pypi
[conda] torch                     2.0.0+cu118              pypi_0    pypi
[conda] torchaudio                2.0.0.dev20230201+cu116          pypi_0    pypi
[conda] torchmetrics              0.8.1                    pypi_0    pypi
[conda] torchsummary              1.5.1                    pypi_0    pypi
[conda] torchvision               0.15.0.dev20230201+cu116          pypi_0    pypi
[conda] triton                    2.0.0                    pypi_0    pypi

cc @ezyang @anjali411 @dylanbespalko @mruberry @Lezcano @nikitaved @soumith @msaroufim @wconstab @ngimel @bdhirsh