Repository: pytorch
Issue: [NvFuser] would change the output for some inaccurate dtype
Labels: triaged,module: nvfuser

### 🐛 Describe the bug

NvFuser would change the output for some inaccurate dtype. 

```py
import torch
torch._C._jit_set_nvfuser_single_node_mode(True)

def f(input, other):
    return torch.fmod(input, other)

input = torch.tensor([-64.1, -21.9], dtype=torch.bfloat16, device='cuda')
other = torch.tensor(0.1999, dtype=torch.float64, device='cuda')

jit_f = torch.jit.trace(f, (input, other))
print(f(input, other))
print(jit_f(input, other))
# tensor([-0.1377, -0.0537], device='cuda:0', dtype=torch.bfloat16)
# tensor([-0.0320, -0.0859], device='cuda:0', dtype=torch.bfloat16)
```

The results are much different for `fmod`

The root cause of this issue could be that NvFuser changed the computation logic for bfloat16, which is inaccurate dtype and could behave totally differently in different execution

---

Another example is `add`/`sub`

```py
import torch

device = 'cuda'

class M(torch.nn.Module):
    def __init__(self):
        super().__init__()

    def forward(self, input, other):
        fn_res = torch.add(input, other, )
        return fn_res

input = torch.tensor([[[0.1733]]], dtype=torch.bfloat16, device=device)
other = torch.tensor(59.8794, dtype=torch.float64, device=device)

m = M().to(device)

torch._C._jit_set_nvfuser_single_node_mode(True)
jit_m = torch.jit.trace(m, (input.clone(), other.clone()))
print(jit_m(input.clone(), other.clone()))

torch._C._jit_set_nvfuser_single_node_mode(False)
jit_m = torch.jit.trace(m, (input.clone(), other.clone()))
print(jit_m(input.clone(), other.clone()))
```

```
tensor([[[60.]]], device='cuda:0', dtype=torch.bfloat16)
tensor([[[60.2500]]], device='cuda:0', dtype=torch.bfloat16)
```

### Versions

```
PyTorch version: 1.13.0.dev20221001
Is debug build: False
CUDA used to build PyTorch: 11.7
ROCM used to build PyTorch: N/A

OS: Ubuntu 22.04.1 LTS (x86_64)
GCC version: (Ubuntu 11.2.0-19ubuntu1) 11.2.0
Clang version: Could not collect
CMake version: Could not collect
Libc version: glibc-2.35

Python version: 3.9.13 (main, Aug 25 2022, 23:26:10)  [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-5.19.5-051905-generic-x86_64-with-glibc2.35
Is CUDA available: True
CUDA runtime version: 11.7.99
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 3060
Nvidia driver version: 515.65.01
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] numpy==1.23.3
[pip3] torch==1.13.0.dev20221001
[pip3] torchaudio==0.13.0.dev20221001
[pip3] torchvision==0.14.0.dev20221001
[conda] blas                      1.0                         mkl  
[conda] mkl                       2021.4.0           h06a4308_640  
[conda] mkl-service               2.4.0            py39h7f8727e_0  
[conda] mkl_fft                   1.3.1            py39hd3c417c_0  
[conda] mkl_random                1.2.2            py39h51133e4_0  
[conda] numpy                     1.23.3                   pypi_0    pypi
[conda] numpy-base                1.23.1           py39ha15fc14_0  
[conda] pytorch                   1.13.0.dev20221001 py3.9_cuda11.7_cudnn8.5.0_0    pytorch-nightly
[conda] pytorch-cuda              11.7                 h67b0de4_0    pytorch-nightly
[conda] pytorch-mutex             1.0                        cuda    pytorch-nightly
[conda] torch                     1.13.0.dev20220923+cu116          pypi_0    pypi
[conda] torchaudio                0.13.0.dev20220923+cu116          pypi_0    pypi
[conda] torchvision               0.14.0.dev20220923+cu116          pypi_0    pypi
```