Skip to content

index_select type mismatch failure #2227

@naoyam

Description

@naoyam

This is what I get with the TOT devel:

======================================================================
ERROR: test_index_select_fusion (__main__.TestCudaFuser)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/nmaruyama/pytorch/debug6/test/test_jit_cuda_fuser.py", line 4172, in test_index_select_fusion
    self._run_helper(t_jit, t, lookup_tv, indies_tv, sbf)
  File "/home/nmaruyama/pytorch/debug6/test/test_jit_cuda_fuser.py", line 204, in _run_helper
    jit_o = jit_op(*args)
  File "/home/nmaruyama/pytorch/debug6/torch/testing/_internal/common_utils.py", line 474, in prof_func_call
    return prof_callable(func_call, *args, **kwargs)
  File "/home/nmaruyama/pytorch/debug6/torch/testing/_internal/common_utils.py", line 471, in prof_callable
    return callable(*args, **kwargs)
RuntimeError: The following operation failed in the TorchScript interpreter.
Traceback of TorchScript (most recent call last):
RuntimeError: Incompatible operand types: int and int64_t

It's because the index values passed to index_select are type int, while the indexing math we generate is int64_t. Looks like PyTorch allows both int64_t and int as the data type of index tensors.

I think it's reasonable to do automatic type promotion in IrBuilder to handle these cases.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions