Run transformers.OPTForCausalLM(config=config) occurs 'GraphModule' object has no attribute 'compile_subgraph_reason'
Labels: triaged, oncall: pt2, module: export

### 🐛 Describe the bug

I try to convert whole opt model fw/bw without any break. It seems same to closed issue https://github.com/pytorch/pytorch/issues/97319, which is not solved in nighty version!

test.py
```
import transformers
import torch._dynamo
torch._dynamo.config.suppress_errors = False
    
def make_data(model, device):
    batch_size = 1
    seq_len = 16
    input = torch.randint(
        low=0, high=model.config.vocab_size, size=(batch_size, seq_len), device=device
    )

    label = torch.randint(low=0, high=model.config.vocab_size, size=(batch_size, seq_len),
                          device=device)
    return input, label

device = torch.device('cuda')
config = transformers.AutoConfig.from_pretrained("facebook/opt-125m")
config.tie_word_embeddings = False
model = transformers.OPTForCausalLM(config=config)
model.to(device)

optimized_model = torch.compile(model, backend='inductor',options={'trace.enabled':True,'trace.graph_diagram':True})
data = make_data(model, device)
model.zero_grad(set_to_none=True)
with torch.cuda.amp.autocast(enabled=True, dtype=torch.float16):
    torch._dynamo.explain(model, data[0])
```

occurs:
```
Traceback (most recent call last):
  File "/home/training/test.py", line 26, in <module>
    torch._dynamo.explain(model, data[0])
  File "/usr/lib/python3.9/unittest/mock.py", line 1336, in patched
    return func(*newargs, **newkeywargs)
  File "/usr/lib/python3.9/site-packages/torch/_dynamo/eval_frame.py", line 702, in explain
    return inner(*extra_args, **extra_kwargs)
  File "/usr/lib/python3.9/site-packages/torch/_dynamo/eval_frame.py", line 661, in inner
    opt_f(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
    return forward_call(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/torch/_dynamo/eval_frame.py", line 333, in _fn
    return fn(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/training/torch-byteir-training/transformers/models/opt/modeling_opt.py", line 944, in forward
    outputs = self.model.decoder(
  File "/usr/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/training/torch-byteir-training/transformers/models/opt/modeling_opt.py", line 650, in forward
    causal_attention_mask = self._prepare_decoder_attention_mask(
  File "/usr/lib/python3.9/site-packages/torch/_dynamo/eval_frame.py", line 493, in catch_errors
    return callback(frame, cache_size, hooks, frame_state)
  File "/usr/lib/python3.9/site-packages/torch/_dynamo/convert_frame.py", line 637, in _convert_frame
    result = inner_convert(frame, cache_size, hooks, frame_state)
  File "/usr/lib/python3.9/site-packages/torch/_dynamo/convert_frame.py", line 133, in _fn
    return fn(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/torch/_dynamo/convert_frame.py", line 371, in _convert_frame_assert
    return _compile(
  File "/usr/lib/python3.9/site-packages/torch/_dynamo/convert_frame.py", line 567, in _compile
    guarded_code = compile_inner(code, one_graph, hooks, transform)
  File "/usr/lib/python3.9/site-packages/torch/_dynamo/utils.py", line 181, in time_wrapper
    r = func(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/torch/_dynamo/convert_frame.py", line 466, in compile_inner
    out_code = transform_code_object(code, transform)
  File "/usr/lib/python3.9/site-packages/torch/_dynamo/bytecode_transformation.py", line 1028, in transform_code_object
    transformations(instructions, code_options)
  File "/usr/lib/python3.9/site-packages/torch/_dynamo/convert_frame.py", line 433, in transform
    tracer.run()
  File "/usr/lib/python3.9/site-packages/torch/_dynamo/symbolic_convert.py", line 2071, in run
    super().run()
  File "/usr/lib/python3.9/site-packages/torch/_dynamo/symbolic_convert.py", line 724, in run
    and self.step()
  File "/usr/lib/python3.9/site-packages/torch/_dynamo/symbolic_convert.py", line 688, in step
    getattr(self, inst.opname)(inst)
  File "/usr/lib/python3.9/site-packages/torch/_dynamo/symbolic_convert.py", line 2159, in RETURN_VALUE
    self.output.compile_subgraph(
  File "/usr/lib/python3.9/site-packages/torch/_dynamo/output_graph.py", line 829, in compile_subgraph
    self.compile_and_call_fx_graph(tx, list(reversed(stack_values)), root)
  File "/usr/lib/python3.9/contextlib.py", line 79, in inner
    return func(*args, **kwds)
  File "/usr/lib/python3.9/site-packages/torch/_dynamo/output_graph.py", line 953, in compile_and_call_fx_graph
    compiled_fn = self.call_user_compiler(gm)
  File "/usr/lib/python3.9/site-packages/torch/_dynamo/utils.py", line 181, in time_wrapper
    r = func(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/torch/_dynamo/output_graph.py", line 1020, in call_user_compiler
    raise BackendCompilerFailed(self.compiler_fn, e).with_traceback(
  File "/usr/lib/python3.9/site-packages/torch/_dynamo/output_graph.py", line 1005, in call_user_compiler
    compiled_fn = compiler_fn(gm, self.example_inputs())
  File "/usr/lib/python3.9/site-packages/torch/_dynamo/repro/after_dynamo.py", line 95, in debug_wrapper
    compiled_gm = compiler_fn(copy.deepcopy(gm), example_inputs)
  File "/usr/lib/python3.9/site-packages/torch/_dynamo/eval_frame.py", line 644, in dynamo_graph_accumulating_compiler
    gm, graphs, op_count, ops_per_graph, break_reasons = _explain_graph_detail(
  File "/usr/lib/python3.9/site-packages/torch/_dynamo/backends/debugging.py", line 232, in _explain_graph_detail
    if gm.compile_subgraph_reason.graph_break:
  File "/usr/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1695, in __getattr__
    raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'")
torch._dynamo.exc.BackendCompilerFailed: backend='dynamo_graph_accumulating_compiler' raised:
AttributeError: 'GraphModule' object has no attribute 'compile_subgraph_reason'
```

break at：
```
#  File "/home/training/torch-byteir-training/transformers/models/opt/modeling_opt.py", line 650, in forward
        causal_attention_mask = self._prepare_decoder_attention_mask(
            attention_mask, input_shape, inputs_embeds, past_key_values_length
        )
```

### Versions

--extra-index-url https://download.pytorch.org/whl/nightly/cu118
--pre
torch==2.1.0.dev20230820+cu118

cc @ezyang @msaroufim @wconstab @bdhirsh @anijain2305