Torchinductor backend fails to compile a model with index_put_(accumulate=True) with dtype float64
Labels: needs reproduction, triaged, oncall: pt2

### 🐛 Describe the bug

Have written a module that works with the 'eager' and 'aot_eager' backends. Compiles with the 'inductor' backend. The function uses an .index_put_ with the accumulate value set to True, and has multiple sets of duplicate indices, and we need to accumulate the values. 

### Error logs


[2023-02-28 12:17:03,611] torch._inductor.compile_fx: [INFO] Step 3: torchinductor done compiling FORWARDS graph 0
[2023-02-28 12:17:03,612] torch._dynamo.output_graph: [INFO] Step 2: done compiler function debug_wrapper
Traceback (most recent call last):
  File "/home/nickg/deeplearning/torch_segmentation_code/models/utils/ht_2.py", line 302, in <module>
    _ht_acc = ht_acc_mod(img_stack)
  File "/home/nickg/torch_ml/lib/python3.10/site-packages/torch/_dynamo/eval_frame.py", line 82, in __call__
    return self.dynamo_ctx(self._orig_mod.__call__)(*args, **kwargs)
  File "/home/nickg/torch_ml/lib/python3.10/site-packages/torch/_dynamo/eval_frame.py", line 215, in _fn
    return fn(*args, **kwargs)
  File "/home/nickg/torch_ml/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/nickg/deeplearning/torch_segmentation_code/models/utils/ht_2.py", line 27, in forward
    def forward(self,x:torch.Tensor)->torch.Tensor:
  File "/home/nickg/torch_ml/lib/python3.10/site-packages/torch/_dynamo/eval_frame.py", line 215, in _fn
    return fn(*args, **kwargs)
  File "/home/nickg/torch_ml/lib/python3.10/site-packages/torch/_functorch/aot_autograd.py", line 2819, in forward
    return compiled_fn(full_args)
  File "/home/nickg/torch_ml/lib/python3.10/site-packages/torch/_functorch/aot_autograd.py", line 1222, in g
    return f(*args)
  File "/home/nickg/torch_ml/lib/python3.10/site-packages/torch/_functorch/aot_autograd.py", line 1898, in runtime_wrapper
    all_outs = call_func_with_args(
  File "/home/nickg/torch_ml/lib/python3.10/site-packages/torch/_functorch/aot_autograd.py", line 1247, in call_func_with_args
    out = normalize_as_list(f(args))
  File "/home/nickg/torch_ml/lib/python3.10/site-packages/torch/_inductor/compile_fx.py", line 248, in run
    return model(new_inputs)
  File "/tmp/torchinductor_nickg/bb/cbbe32owz7yzmb5h5scyvxqtytogqch2my5wszfomzaatnvldviu.py", line 18799, in call
    triton__4.run(arg0_1, buf4, 524288, grid=grid(524288), stream=stream0)
  File "/home/nickg/torch_ml/lib/python3.10/site-packages/torch/_inductor/triton_ops/autotune.py", line 185, in run
    return launcher(
  File "<string>", line 6, in launcher
  File "/home/nickg/torch_ml/lib/python3.10/site-packages/triton/compiler.py", line 1678, in __getattribute__
    self._init_handles()
  File "/home/nickg/torch_ml/lib/python3.10/site-packages/triton/compiler.py", line 1671, in _init_handles
    mod, func, n_regs, n_spills = cuda_utils.load_binary(self.metadata["name"], self.asm["cubin"], self.shared, device)
RuntimeError: Triton Error [CUDA]: an illegal memory access was encountered

### Minified repro

```
import torch._inductor.overrides

import torch
from torch import tensor, device
import torch.fx as fx
from torch._dynamo.testing import rand_strided
from math import inf
from torch.fx.experimental.proxy_tensor import make_fx

import torch._dynamo.config
import torch._inductor.config
import torch._functorch.config
torch._dynamo.config.load_config(b'\x80\x02}q\x00(X\x0b\x00\x00\x00output_codeq\x01\x89X\r\x00\x00\x00log_file_nameq\x02NX\x07\x00\x00\x00verboseq\x03\x89X\x11\x00\x00\x00output_graph_codeq\x04\x89X\x12\x00\x00\x00verify_correctnessq\x05\x89X\x12\x00\x00\x00minimum_call_countq\x06K\x01X\x15\x00\x00\x00dead_code_eliminationq\x07\x88X\x10\x00\x00\x00cache_size_limitq\x08K@X\x14\x00\x00\x00specialize_int_floatq\t\x88X\x0e\x00\x00\x00dynamic_shapesq\n\x89X\x18\x00\x00\x00assume_static_by_defaultq\x0b\x89X\x10\x00\x00\x00guard_nn_modulesq\x0c\x89X\x1b\x00\x00\x00traceable_tensor_subclassesq\rc__builtin__\nset\nq\x0e]q\x0f\x85q\x10Rq\x11X\x0f\x00\x00\x00suppress_errorsq\x12\x89X\x15\x00\x00\x00replay_record_enabledq\x13\x89X \x00\x00\x00rewrite_assert_with_torch_assertq\x14\x88X\x12\x00\x00\x00print_graph_breaksq\x15\x89X\x07\x00\x00\x00disableq\x16\x89X*\x00\x00\x00allowed_functions_module_string_ignorelistq\x17h\x0e]q\x18(X\r\x00\x00\x00torch._decompq\x19X\x13\x00\x00\x00torch.distributionsq\x1aX\x0c\x00\x00\x00torch._primsq\x1bX\r\x00\x00\x00torch.testingq\x1cX\x0b\x00\x00\x00torch._refsq\x1de\x85q\x1eRq\x1fX\x12\x00\x00\x00repro_forward_onlyq \x89X\x0f\x00\x00\x00repro_toleranceq!G?PbM\xd2\xf1\xa9\xfcX\x16\x00\x00\x00capture_scalar_outputsq"\x89X \x00\x00\x00capture_dynamic_output_shape_opsq#\x89X\x19\x00\x00\x00enforce_cond_guards_matchq$\x88X\x0c\x00\x00\x00optimize_ddpq%\x88X\x1a\x00\x00\x00raise_on_ctx_manager_usageq&\x88X\x1c\x00\x00\x00raise_on_unsafe_aot_autogradq\'\x89X\x17\x00\x00\x00raise_on_backend_changeq(\x89X\x18\x00\x00\x00error_on_nested_fx_traceq)\x88X\t\x00\x00\x00allow_rnnq*\x89X\x08\x00\x00\x00base_dirq+X1\x00\x00\x00/home/nickg/torch_ml/lib/python3.10/site-packagesq,X\x0e\x00\x00\x00debug_dir_rootq-XD\x00\x00\x00/home/nickg/deeplearning/torch_segmentation_code/torch_compile_debugq.X)\x00\x00\x00DO_NOT_USE_legacy_non_fake_example_inputsq/\x89X\x13\x00\x00\x00_save_config_ignoreq0h\x0e]q1(X\x12\x00\x00\x00constant_functionsq2X\x0b\x00\x00\x00repro_afterq3X!\x00\x00\x00skipfiles_inline_module_allowlistq4X\x0b\x00\x00\x00repro_levelq5e\x85q6Rq7u.')
torch._inductor.config.load_config(b'\x80\x02}q\x00(X\x05\x00\x00\x00debugq\x01\x89X\x10\x00\x00\x00disable_progressq\x02\x88X\x10\x00\x00\x00verbose_progressq\x03\x89X\x0b\x00\x00\x00cpp_wrapperq\x04\x89X\x03\x00\x00\x00dceq\x05\x89X\x14\x00\x00\x00static_weight_shapesq\x06\x88X\x0c\x00\x00\x00size_assertsq\x07\x88X\x10\x00\x00\x00pick_loop_ordersq\x08\x88X\x0f\x00\x00\x00inplace_buffersq\t\x88X\x11\x00\x00\x00benchmark_harnessq\n\x88X\x0f\x00\x00\x00epilogue_fusionq\x0b\x89X\x15\x00\x00\x00epilogue_fusion_firstq\x0c\x89X\x0f\x00\x00\x00pattern_matcherq\r\x88X\n\x00\x00\x00reorderingq\x0e\x89X\x0c\x00\x00\x00max_autotuneq\x0f\x89X\x15\x00\x00\x00search_autotune_cacheq\x10\x88X\x17\x00\x00\x00realize_reads_thresholdq\x11K\x04X\x17\x00\x00\x00realize_bytes_thresholdq\x12M\xd0\x07X\x1b\x00\x00\x00realize_acc_reads_thresholdq\x13K\x08X\x0f\x00\x00\x00fallback_randomq\x14\x89X\x12\x00\x00\x00implicit_fallbacksq\x15\x88X\x0b\x00\x00\x00tune_layoutq\x16\x89X\x11\x00\x00\x00aggressive_fusionq\x17\x89X\x0f\x00\x00\x00max_fusion_sizeq\x18K@X\x1b\x00\x00\x00unroll_reductions_thresholdq\x19K\x08X\x0e\x00\x00\x00comment_originq\x1a\x89X\x12\x00\x00\x00developer_warningsq\x1b\x88X\x0f\x00\x00\x00compile_threadsq\x1cK\x10X\x11\x00\x00\x00global_cache_pathq\x1dNX\x13\x00\x00\x00kernel_name_max_opsq\x1eK\nX\r\x00\x00\x00shape_paddingq\x1f\x89X\x0e\x00\x00\x00permute_fusionq \x89X\x1a\x00\x00\x00profiler_mark_wrapper_callq!\x89X\x18\x00\x00\x00_raise_error_for_testingq"\x89X\x0c\x00\x00\x00_profile_varq#X\x00\x00\x00\x00q$X\x11\x00\x00\x00profile_bandwidthq%\x89X\x17\x00\x00\x00profile_bandwidth_regexq&h$X\x0b\x00\x00\x00cpp.threadsq\'J\xff\xff\xff\xffX\x13\x00\x00\x00cpp.dynamic_threadsq(\x89X\x0b\x00\x00\x00cpp.simdlenq)NX\x12\x00\x00\x00cpp.min_chunk_sizeq*M\x00\x10X\x07\x00\x00\x00cpp.cxxq+NX\x03\x00\x00\x00g++q,\x86q-X\x19\x00\x00\x00cpp.enable_kernel_profileq.\x89X\x12\x00\x00\x00cpp.weight_prepackq/\x88X\x11\x00\x00\x00triton.cudagraphsq0\x89X\x17\x00\x00\x00triton.debug_sync_graphq1\x89X\x18\x00\x00\x00triton.debug_sync_kernelq2\x89X\x12\x00\x00\x00triton.convolutionq3X\x04\x00\x00\x00atenq4X\x15\x00\x00\x00triton.dense_indexingq5\x89X\x10\x00\x00\x00triton.max_tilesq6K\x02X\x19\x00\x00\x00triton.autotune_pointwiseq7\x88X\'\x00\x00\x00triton.tiling_prevents_pointwise_fusionq8\x88X\'\x00\x00\x00triton.tiling_prevents_reduction_fusionq9\x88X\x1b\x00\x00\x00triton.ordered_kernel_namesq:\x89X\x1f\x00\x00\x00triton.descriptive_kernel_namesq;\x89X\x1c\x00\x00\x00triton.persistent_reductionsq<\x88X\x10\x00\x00\x00triton.max_blockq=}q>(X\x01\x00\x00\x00Xq?M\x00\x08X\x01\x00\x00\x00Yq@M\x00\x04X\x01\x00\x00\x00ZqAM\x00\x04uX\r\x00\x00\x00trace.enabledqB\x89X\x0f\x00\x00\x00trace.debug_logqC\x88X\x0e\x00\x00\x00trace.info_logqD\x89X\x0e\x00\x00\x00trace.fx_graphqE\x88X\x1a\x00\x00\x00trace.fx_graph_transformedqF\x88X\x13\x00\x00\x00trace.ir_pre_fusionqG\x88X\x14\x00\x00\x00trace.ir_post_fusionqH\x88X\x11\x00\x00\x00trace.output_codeqI\x88X\x13\x00\x00\x00trace.graph_diagramqJ\x89X\x15\x00\x00\x00trace.compile_profileqK\x89X\x10\x00\x00\x00trace.upload_tarqLNu.')
torch._functorch.config.load_config(b'\x80\x02}q\x00(X\x11\x00\x00\x00use_functionalizeq\x01\x88X\x0f\x00\x00\x00use_fake_tensorq\x02\x88X\x16\x00\x00\x00fake_tensor_allow_metaq\x03\x88X\x0c\x00\x00\x00debug_assertq\x04\x88X\x14\x00\x00\x00debug_fake_cross_refq\x05\x89X\x11\x00\x00\x00debug_partitionerq\x06\x89X\x0c\x00\x00\x00debug_graphsq\x07\x89X\x0b\x00\x00\x00debug_jointq\x08\x89X\x12\x00\x00\x00use_dynamic_shapesq\t\x89X\x14\x00\x00\x00static_weight_shapesq\n\x88X\x03\x00\x00\x00cseq\x0b\x88X\x10\x00\x00\x00max_dist_from_bwq\x0cK\x03X\t\x00\x00\x00log_levelq\rK\x14u.')


# REPLACEABLE COMMENT FOR TESTING PURPOSES


# torch version: 2.0.0.dev20230227+cu118
# torch cuda version: 11.8
# torch git version: 1e2e6e78c68c8df58d1498bc495629e56d433598


# CUDA Info: 
# nvcc not found
# GPU Hardware Info: 
# NVIDIA GeForce RTX 4090 : 1 


from torch.nn import *
class Repro(torch.nn.Module):
    def __init__(self):
        super().__init__()

    
    
    def forward(self, full, round_1, view_4, view_5, view_6):
        convert_element_type_4 = torch.ops.prims.convert_element_type.default(round_1, torch.int64);  round_1 = None
        unsqueeze_6 = torch.ops.aten.unsqueeze.default(convert_element_type_4, 0);  convert_element_type_4 = None
        expand_4 = torch.ops.aten.expand.default(unsqueeze_6, [8, -1, -1, -1]);  unsqueeze_6 = None
        slice_1 = torch.ops.aten.slice.Tensor(expand_4, 0, 0, 9223372036854775807);  expand_4 = None
        slice_2 = torch.ops.aten.slice.Tensor(slice_1, 1, 0, 9223372036854775807);  slice_1 = None
        slice_3 = torch.ops.aten.slice.Tensor(slice_2, 2, 0, 9223372036854775807);  slice_2 = None
        select = torch.ops.aten.select.int(slice_3, 3, 0);  slice_3 = None
        clone_1 = torch.ops.aten.clone.default(select, memory_format = torch.contiguous_format);  select = None
        _unsafe_view = torch.ops.aten._unsafe_view.default(clone_1, [524288]);  clone_1 = None
        index_put = torch.ops.aten.index_put.default(full, [view_4, _unsafe_view, view_5], view_6, True);  full = view_4 = _unsafe_view = view_5 = view_6 = None
        return (index_put,)
        
args = [((8, 365, 360), (131400, 360, 1), torch.float64, 'cuda'), ((256, 256, 360), (92160, 360, 1), torch.float32, 'cuda'), ((524288,), (1,), torch.int64, 'cuda'), ((524288,), (0,), torch.int64, 'cuda'), ((524288,), (1,), torch.float64, 'cuda')]
args = [rand_strided(sh, st, dt, dev) for (sh, st, dt, dev) in args]
mod = make_fx(Repro(), tracing_mode='real')(*args)

from torch._inductor.compile_fx import compile_fx_inner
from torch._dynamo.debug_utils import same_two_models

compiled = compile_fx_inner(mod, args)
ref = compiled(args)
torch.cuda.synchronize() # Ensures that segfaults are surfaced
```

### Versions

# torch version: 2.0.0.dev20230227+cu118
# torch cuda version: 11.8
# torch git version: 1e2e6e78c68c8df58d1498bc495629e56d433598


# CUDA Info: 
# nvcc not found
# GPU Hardware Info: 
# NVIDIA GeForce RTX 4090 : 1 

cc @ezyang @soumith @msaroufim @wconstab @ngimel @bdhirsh