Repository: pytorch
Issue: Triton tl.reinterpret is not Dynamo traceable
Labels: good first issue,triaged,oncall: pt2,module: dynamo,upstream triton

### 🐛 Describe the bug

Internal xref: https://fb.workplace.com/groups/1075192433118967/posts/1480219992616207/

Repro: 

```
import torch

from triton.runtime.jit import reinterpret as tl_reinterpret
import triton.language as tl

@torch.compile(backend="eager", fullgraph=True)
def fn(x):
    return tl_reinterpret(x, dtype=tl.float8e4nv)


fn(torch.randn(3, device='cuda'))
```

Fails with

```
Traceback (most recent call last):
  File "/data/users/ezyang/b/pytorch/torch/_dynamo/symbolic_convert.py", line 870, in step
    self.dispatch_table[inst.opcode](self, inst)
  File "/data/users/ezyang/b/pytorch/torch/_dynamo/symbolic_convert.py", line 558, in wrapper
    return inner_fn(self, inst)
  File "/data/users/ezyang/b/pytorch/torch/_dynamo/symbolic_convert.py", line 1655, in CALL_FUNCTION_KW
    self.call_function(fn, args, kwargs)
  File "/data/users/ezyang/b/pytorch/torch/_dynamo/symbolic_convert.py", line 805, in call_function
    self.push(fn.call_function(self, args, kwargs))  # type: ignore[arg-type]
  File "/data/users/ezyang/b/pytorch/torch/_dynamo/variables/functions.py", line 322, in call_function
    return super().call_function(tx, args, kwargs)
  File "/data/users/ezyang/b/pytorch/torch/_dynamo/variables/functions.py", line 106, in call_function
    return tx.inline_user_function_return(self, [*self.self_args(), *args], kwargs)
  File "/data/users/ezyang/b/pytorch/torch/_dynamo/symbolic_convert.py", line 811, in inline_user_function_return
    return InliningInstructionTranslator.inline_call(self, fn, args, kwargs)
  File "/data/users/ezyang/b/pytorch/torch/_dynamo/symbolic_convert.py", line 2946, in inline_call
    return cls.inline_call_(parent, func, args, kwargs)
  File "/data/users/ezyang/b/pytorch/torch/_dynamo/symbolic_convert.py", line 3062, in inline_call_
    tracer.run()
  File "/data/users/ezyang/b/pytorch/torch/_dynamo/symbolic_convert.py", line 958, in run
    while self.step():
  File "/data/users/ezyang/b/pytorch/torch/_dynamo/symbolic_convert.py", line 873, in step
    self.exception_handler(e)
  File "/data/users/ezyang/b/pytorch/torch/_dynamo/symbolic_convert.py", line 1459, in exception_handler
    raise raised_exception
  File "/data/users/ezyang/b/pytorch/torch/_dynamo/symbolic_convert.py", line 870, in step
    self.dispatch_table[inst.opcode](self, inst)
  File "/data/users/ezyang/b/pytorch/torch/_dynamo/symbolic_convert.py", line 1360, in RAISE_VARARGS
    raise exc.ObservedException(f"raised exception {val}")
torch._dynamo.exc.ObservedException: raised exception ExceptionVariable()

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/data/users/ezyang/b/pytorch/a.py", line 11, in <module>
    fn(torch.randn(3, device='cuda'))
  File "/data/users/ezyang/b/pytorch/torch/_dynamo/eval_frame.py", line 465, in _fn
    return fn(*args, **kwargs)
  File "/data/users/ezyang/b/pytorch/torch/_dynamo/convert_frame.py", line 1238, in __call__
    return self._torchdynamo_orig_callable(
  File "/data/users/ezyang/b/pytorch/torch/_dynamo/convert_frame.py", line 514, in __call__
    return _compile(
  File "/data/users/ezyang/b/pytorch/torch/_dynamo/convert_frame.py", line 902, in _compile
    guarded_code = compile_inner(code, one_graph, hooks, transform)
  File "/data/users/ezyang/b/pytorch/torch/_dynamo/convert_frame.py", line 653, in compile_inner
    return _compile_inner(code, one_graph, hooks, transform)
  File "/data/users/ezyang/b/pytorch/torch/_utils_internal.py", line 85, in wrapper_function
    return StrobelightCompileTimeProfiler.profile_compile_time(
  File "/data/users/ezyang/b/pytorch/torch/_strobelight/compile_time_profiler.py", line 129, in profile_compile_time
    return func(*args, **kwargs)
  File "/data/users/ezyang/b/pytorch/torch/_dynamo/convert_frame.py", line 686, in _compile_inner
    out_code = transform_code_object(code, transform)
  File "/data/users/ezyang/b/pytorch/torch/_dynamo/bytecode_transformation.py", line 1322, in transform_code_object
    transformations(instructions, code_options)
  File "/data/users/ezyang/b/pytorch/torch/_dynamo/convert_frame.py", line 208, in _fn
    return fn(*args, **kwargs)
  File "/data/users/ezyang/b/pytorch/torch/_dynamo/convert_frame.py", line 622, in transform
    tracer.run()
  File "/data/users/ezyang/b/pytorch/torch/_dynamo/symbolic_convert.py", line 2731, in run
    super().run()
  File "/data/users/ezyang/b/pytorch/torch/_dynamo/symbolic_convert.py", line 958, in run
    while self.step():
  File "/data/users/ezyang/b/pytorch/torch/_dynamo/symbolic_convert.py", line 873, in step
    self.exception_handler(e)
  File "/data/users/ezyang/b/pytorch/torch/_dynamo/symbolic_convert.py", line 1458, in exception_handler
    raise Unsupported("Observed exception")
torch._dynamo.exc.Unsupported: Observed exception

from user code:
   File "/data/users/ezyang/b/pytorch/a.py", line 8, in fn
    return tl_reinterpret(x, dtype=tl.float8e4nv)

Set TORCH_LOGS="+dynamo" and TORCHDYNAMO_VERBOSE=1 for more information


You can suppress this exception and fall back to eager by setting:
    import torch._dynamo
    torch._dynamo.config.suppress_errors = True

```

I think the problem is when we trace the hasattr call on data_ptr. Debug logs here: https://gist.github.com/ezyang/2eb8f879a49bf5bd607dad3e8e50133b

### Versions

main

cc @chauhang @penguinwu @voznesenskym @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @amjames @bertmaher @int3 @davidberard98 @nmacchioni @embg @peterbell10