Type promotion for accumulate operation differs between eager and CPP dynamo 
Labels: module: cpu, triaged, bug, oncall: pt2

### 🐛 Describe the bug

Discovered while looking at `CpuTests.test_tmp_not_defined_issue2`, where result of reduction op for a float tensor is stored in float scalar, which results in slight accuracy discrepancy between eager and dynamo, see:
```
% python test_torchinductor.py -v -k test_tmp_not_defined_issue2_cpu
test_tmp_not_defined_issue2_cpu (__main__.CpuTests) ... /Users/nshulga/git/pytorch/pytorch/test/inductor/test_torchinductor.py:278: 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()
[2023-02-02 16:22:56,261] torch._inductor.compile_fx: [INFO] Step 3: torchinductor compiling FORWARDS graph 0

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()


kernel_cpp_0 = async_compile.cpp('''
#include "/var/folders/gp/67vtnf450p79stdw457xqkvr0000gn/T/torchinductor_nshulga/77/c7773nj5pwikpmm2pwa62rcudlf7p3if7eyqb5k4sjsvewwje4le.h"
extern "C" void kernel(const float* __restrict__ in_ptr0,
                       const float* __restrict__ in_ptr1,
                       const float* __restrict__ in_ptr2,
                       float* __restrict__ out_ptr0)
{
    {
        {
            float tmp5 = 0;
            #pragma omp parallel num_threads(8)
            {
                #pragma omp for reduction(+:tmp5) 
                for(long i0=0; i0<140800; i0+=1)
                {
                    auto tmp0 = in_ptr0[i0];
                    auto tmp1 = in_ptr1[0];
                    auto tmp3 = in_ptr2[i0];
                    auto tmp2 = tmp0 / tmp1;
                    auto tmp4 = tmp2 * tmp3;
                    tmp5 += tmp4;
                }
            }
            out_ptr0[0] = tmp5;
        }
    }
}
''')


async_compile.wait(globals())
del async_compile

def call(args):
    primals_1, primals_2, primals_3 = args
    args.clear()
    buf0 = empty_strided((), (), device='cpu', dtype=torch.float32)
    kernel_cpp_0(c_void_p(primals_3.data_ptr()), c_void_p(primals_2.data_ptr()), c_void_p(primals_1.data_ptr()), c_void_p(buf0.data_ptr()))
    return (buf0, primals_1, primals_2, primals_3, )


if __name__ == "__main__":
    from torch._dynamo.testing import rand_strided
    from torch._inductor.utils import print_performance
    primals_1 = rand_strided((1, 88, 40, 40), (140800, 1600, 40, 1), device='cpu', dtype=torch.float32)
    primals_2 = rand_strided((), (), device='cpu', dtype=torch.float32)
    primals_3 = rand_strided((1, 88, 40, 40), (140800, 1600, 40, 1), device='cpu', dtype=torch.float32)
    print_performance(lambda: call([primals_1, primals_2, primals_3]))

[2023-02-02 16:22:56,298] torch._inductor.compile_fx: [INFO] Step 3: torchinductor done compiling FORWARDS graph 0
FAIL

======================================================================
FAIL: test_tmp_not_defined_issue2_cpu (__main__.CpuTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/nshulga/git/pytorch/pytorch/test/inductor/test_torchinductor.py", line 5394, in <lambda>
    other_cls, f"{name}_{suffix}", lambda self, value=value: value(self)
  File "/Users/nshulga/git/pytorch/pytorch/test/inductor/test_torchinductor.py", line 5091, in test_tmp_not_defined_issue2
    self.common(forward, args)
  File "/Users/nshulga/miniforge3/lib/python3.9/unittest/mock.py", line 1336, in patched
    return func(*newargs, **newkeywargs)
  File "/Users/nshulga/git/pytorch/pytorch/test/inductor/test_torchinductor.py", line 389, in check_model
    self.assertEqual(
  File "/Users/nshulga/git/pytorch/pytorch/torch/testing/_internal/common_utils.py", line 2926, in assertEqual
    assert_equal(
  File "/Users/nshulga/git/pytorch/pytorch/torch/testing/_comparison.py", line 1244, in assert_equal
    raise error_metas[0].to_error(msg)
AssertionError: Scalars are not close!

Absolute difference: 0.359375 (up to 1e-05 allowed)
Relative difference: 1.7807008110627664e-06 (up to 1.3e-06 allowed)

The failure occurred for item [1]

----------------------------------------------------------------------
Ran 1 test in 0.481s

FAILED (failures=1)

```
 
generated for
https://github.com/pytorch/pytorch/blob/7db4d813c3e30cdc6c9937e0c2ff68f4a84edf49/test/inductor/test_torchinductor.py#L5126-L5130

### Error logs

_No response_

### Minified repro

_No response_

### Versions

CI

cc @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10 @ezyang @soumith @msaroufim @wconstab @ngimel @bdhirsh