Repository: pytorch
Issue: torch.export fails for whisper tiny
Labels: oncall: pt2,module: dynamo,oncall: export

### 🐛 Describe the bug

Trying to export whisper model. Getting an error when I run with `strict=True`

The model exports when I used `strict=False`

Is this a valid Dynamo related issue which is addressed by non-strict mode?

```
import torch

from transformers import WhisperProcessor, WhisperForConditionalGeneration
from datasets import load_dataset

# load model and processor
model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-tiny")

input_features = torch.randn(1,80, 3000)
attention_mask = torch.ones(1, 3000)
decoder_input_ids = torch.tensor([[1, 1, 1 , 1]]) * model.config.decoder_start_token_id

model.eval()

exported_program: torch.export.ExportedProgram= torch.export.export(model, args=(input_features, attention_mask, decoder_input_ids,), strict=True)
```

Errors Logs

```
  File "/home/agunapal/export_games/asr_1.py", line 16, in <module>
    exported_program: torch.export.ExportedProgram= torch.export.export(model, args=(input_features, attention_mask, decoder_input_ids,), strict=True)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/export/__init__.py", line 368, in export
    return _export(
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/export/_trace.py", line 1031, in wrapper
    raise e
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/export/_trace.py", line 1004, in wrapper
    ep = fn(*args, **kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/export/exported_program.py", line 122, in wrapper
    return fn(*args, **kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/export/_trace.py", line 1957, in _export
    export_artifact = export_func(  # type: ignore[operator]
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/export/_trace.py", line 1251, in _strict_export
    return _strict_export_lower_to_aten_ir(
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/export/_trace.py", line 1279, in _strict_export_lower_to_aten_ir
    gm_torch_level = _export_to_torch_ir(
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/export/_trace.py", line 660, in _export_to_torch_ir
    gm_torch_level, _ = torch._dynamo.export(
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/eval_frame.py", line 1539, in inner
    result_traced = opt_f(*args, **kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1740, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1751, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/eval_frame.py", line 556, in _fn
    return fn(*args, **kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1740, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1751, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 1395, in __call__
    return self._torchdynamo_orig_callable(
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 545, in __call__
    return _compile(
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 1027, in _compile
    raise InternalTorchDynamoError(
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 977, in _compile
    guarded_code = compile_inner(code, one_graph, hooks, transform)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 706, in compile_inner
    return _compile_inner(code, one_graph, hooks, transform)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_utils_internal.py", line 95, in wrapper_function
    return function(*args, **kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 741, in _compile_inner
    out_code = transform_code_object(code, transform)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/bytecode_transformation.py", line 1348, in transform_code_object
    transformations(instructions, code_options)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 229, in _fn
    return fn(*args, **kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 658, in transform
    tracer.run()
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 2912, in run
    super().run()
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 1120, in run
    while self.step():
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 1032, in step
    self.dispatch_table[inst.opcode](self, inst)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 640, in wrapper
    return inner_fn(self, inst)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 1816, in CALL_FUNCTION_EX
    self.call_function(fn, argsvars.items, kwargsvars)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 967, in call_function
    self.push(fn.call_function(self, args, kwargs))  # type: ignore[arg-type]
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/variables/nn_module.py", line 442, in call_function
    return tx.inline_user_function_return(
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 973, in inline_user_function_return
    return InliningInstructionTranslator.inline_call(self, fn, args, kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 3127, in inline_call
    return cls.inline_call_(parent, func, args, kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 3255, in inline_call_
    tracer.run()
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 1120, in run
    while self.step():
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 1032, in step
    self.dispatch_table[inst.opcode](self, inst)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 640, in wrapper
    return inner_fn(self, inst)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 1816, in CALL_FUNCTION_EX
    self.call_function(fn, argsvars.items, kwargsvars)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 967, in call_function
    self.push(fn.call_function(self, args, kwargs))  # type: ignore[arg-type]
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/variables/functions.py", line 410, in call_function
    return super().call_function(tx, args, kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/variables/functions.py", line 349, in call_function
    return super().call_function(tx, args, kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/variables/functions.py", line 125, in call_function
    return tx.inline_user_function_return(self, [*self.self_args(), *args], kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 973, in inline_user_function_return
    return InliningInstructionTranslator.inline_call(self, fn, args, kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 3127, in inline_call
    return cls.inline_call_(parent, func, args, kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 3255, in inline_call_
    tracer.run()
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 1120, in run
    while self.step():
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 1032, in step
    self.dispatch_table[inst.opcode](self, inst)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 640, in wrapper
    return inner_fn(self, inst)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 1828, in CALL_FUNCTION_KW
    self.call_function(fn, args, kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 967, in call_function
    self.push(fn.call_function(self, args, kwargs))  # type: ignore[arg-type]
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/variables/nn_module.py", line 442, in call_function
    return tx.inline_user_function_return(
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 973, in inline_user_function_return
    return InliningInstructionTranslator.inline_call(self, fn, args, kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 3127, in inline_call
    return cls.inline_call_(parent, func, args, kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 3255, in inline_call_
    tracer.run()
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 1120, in run
    while self.step():
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 1032, in step
    self.dispatch_table[inst.opcode](self, inst)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 640, in wrapper
    return inner_fn(self, inst)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 1816, in CALL_FUNCTION_EX
    self.call_function(fn, argsvars.items, kwargsvars)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 967, in call_function
    self.push(fn.call_function(self, args, kwargs))  # type: ignore[arg-type]
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/variables/functions.py", line 410, in call_function
    return super().call_function(tx, args, kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/variables/functions.py", line 349, in call_function
    return super().call_function(tx, args, kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/variables/functions.py", line 125, in call_function
    return tx.inline_user_function_return(self, [*self.self_args(), *args], kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 973, in inline_user_function_return
    return InliningInstructionTranslator.inline_call(self, fn, args, kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 3127, in inline_call
    return cls.inline_call_(parent, func, args, kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 3255, in inline_call_
    tracer.run()
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 1120, in run
    while self.step():
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 1032, in step
    self.dispatch_table[inst.opcode](self, inst)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 640, in wrapper
    return inner_fn(self, inst)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 1828, in CALL_FUNCTION_KW
    self.call_function(fn, args, kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 967, in call_function
    self.push(fn.call_function(self, args, kwargs))  # type: ignore[arg-type]
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/variables/nn_module.py", line 442, in call_function
    return tx.inline_user_function_return(
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 973, in inline_user_function_return
    return InliningInstructionTranslator.inline_call(self, fn, args, kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 3127, in inline_call
    return cls.inline_call_(parent, func, args, kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 3255, in inline_call_
    tracer.run()
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 1120, in run
    while self.step():
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 1032, in step
    self.dispatch_table[inst.opcode](self, inst)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 640, in wrapper
    return inner_fn(self, inst)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 1816, in CALL_FUNCTION_EX
    self.call_function(fn, argsvars.items, kwargsvars)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 967, in call_function
    self.push(fn.call_function(self, args, kwargs))  # type: ignore[arg-type]
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/variables/functions.py", line 410, in call_function
    return super().call_function(tx, args, kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/variables/functions.py", line 349, in call_function
    return super().call_function(tx, args, kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/variables/functions.py", line 125, in call_function
    return tx.inline_user_function_return(self, [*self.self_args(), *args], kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 973, in inline_user_function_return
    return InliningInstructionTranslator.inline_call(self, fn, args, kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 3127, in inline_call
    return cls.inline_call_(parent, func, args, kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 3255, in inline_call_
    tracer.run()
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 1120, in run
    while self.step():
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 1032, in step
    self.dispatch_table[inst.opcode](self, inst)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 640, in wrapper
    return inner_fn(self, inst)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 1828, in CALL_FUNCTION_KW
    self.call_function(fn, args, kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 967, in call_function
    self.push(fn.call_function(self, args, kwargs))  # type: ignore[arg-type]
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/variables/nn_module.py", line 442, in call_function
    return tx.inline_user_function_return(
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 973, in inline_user_function_return
    return InliningInstructionTranslator.inline_call(self, fn, args, kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 3127, in inline_call
    return cls.inline_call_(parent, func, args, kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 3255, in inline_call_
    tracer.run()
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 1120, in run
    while self.step():
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 1032, in step
    self.dispatch_table[inst.opcode](self, inst)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 640, in wrapper
    return inner_fn(self, inst)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 1816, in CALL_FUNCTION_EX
    self.call_function(fn, argsvars.items, kwargsvars)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 967, in call_function
    self.push(fn.call_function(self, args, kwargs))  # type: ignore[arg-type]
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/variables/functions.py", line 410, in call_function
    return super().call_function(tx, args, kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/variables/functions.py", line 349, in call_function
    return super().call_function(tx, args, kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/variables/functions.py", line 125, in call_function
    return tx.inline_user_function_return(self, [*self.self_args(), *args], kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 973, in inline_user_function_return
    return InliningInstructionTranslator.inline_call(self, fn, args, kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 3127, in inline_call
    return cls.inline_call_(parent, func, args, kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 3255, in inline_call_
    tracer.run()
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 1120, in run
    while self.step():
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 1032, in step
    self.dispatch_table[inst.opcode](self, inst)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 547, in inner
    if truth_fn(mod):
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/transformers/cache_utils.py", line 406, in __len__
    return len(self.key_cache)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1935, in __getattr__
    raise AttributeError(
torch._dynamo.exc.InternalTorchDynamoError: AttributeError: 'DynamicCache' object has no attribute 'key_cache'

from user code:
   File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/transformers/models/whisper/modeling_whisper.py", line 1767, in forward
    outputs = self.model(
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1751, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/transformers/models/whisper/modeling_whisper.py", line 1634, in forward
    decoder_outputs = self.decoder(
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1751, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/transformers/models/whisper/modeling_whisper.py", line 1324, in forward
    layer_outputs = decoder_layer(
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1751, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/transformers/models/whisper/modeling_whisper.py", line 732, in forward
    hidden_states, cross_attn_weights, cross_attn_present_key_value = self.encoder_attn(
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1751, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/agunapal/anaconda3/envs/export/lib/python3.10/site-packages/transformers/models/whisper/modeling_whisper.py", line 520, in forward
    if is_cross_attention and past_key_value and is_updated:

Set TORCH_LOGS="+dynamo" and TORCHDYNAMO_VERBOSE=1 for more information
```

### Versions

```
Collecting environment information...
PyTorch version: 2.6.0.dev20241112+cu121
Is debug build: False
CUDA used to build PyTorch: 12.1
ROCM used to build PyTorch: N/A

OS: CentOS Stream 9 (x86_64)
GCC version: (GCC) 11.5.0 20240719 (Red Hat 11.5.0-2)
Clang version: Could not collect
CMake version: version 3.26.5
Libc version: glibc-2.34

Python version: 3.10.0 (default, Mar  3 2022, 09:58:08) [GCC 7.5.0] (64-bit runtime)
Python platform: Linux-5.12.0-0_fbk16_zion_7661_geb00762ce6d2-x86_64-with-glibc2.34
Is CUDA available: True
CUDA runtime version: Could not collect
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: 
GPU 0: NVIDIA PG509-210
GPU 1: NVIDIA PG509-210
GPU 2: NVIDIA PG509-210
GPU 3: NVIDIA PG509-210
GPU 4: NVIDIA PG509-210
GPU 5: NVIDIA PG509-210
GPU 6: NVIDIA PG509-210
GPU 7: NVIDIA PG509-210

Nvidia driver version: 525.105.17
cuDNN version: Probably one of the following:
/usr/lib64/libcudnn.so.8.8.0
/usr/lib64/libcudnn.so.9.1.0
/usr/lib64/libcudnn_adv.so.9.1.0
/usr/lib64/libcudnn_adv_infer.so.8.8.0
/usr/lib64/libcudnn_adv_train.so.8.8.0
/usr/lib64/libcudnn_cnn.so.9.1.0
/usr/lib64/libcudnn_cnn_infer.so.8.8.0
/usr/lib64/libcudnn_cnn_train.so.8.8.0
/usr/lib64/libcudnn_engines_precompiled.so.9.1.0
/usr/lib64/libcudnn_engines_runtime_compiled.so.9.1.0
/usr/lib64/libcudnn_graph.so.9.1.0
/usr/lib64/libcudnn_heuristic.so.9.1.0
/usr/lib64/libcudnn_ops.so.9.1.0
/usr/lib64/libcudnn_ops_infer.so.8.8.0
/usr/lib64/libcudnn_ops_train.so.8.8.0
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Architecture:                    x86_64
CPU op-mode(s):                  32-bit, 64-bit
Address sizes:                   46 bits physical, 48 bits virtual
Byte Order:                      Little Endian
CPU(s):                          192
On-line CPU(s) list:             0-191
Vendor ID:                       GenuineIntel
Model name:                      Intel(R) Xeon(R) Platinum 8339HC CPU @ 1.80GHz
CPU family:                      6
Model:                           85
Thread(s) per core:              2
Core(s) per socket:              24
Socket(s):                       4
Stepping:                        11
Frequency boost:                 enabled
CPU(s) scaling MHz:              100%
CPU max MHz:                     1801.0000
CPU min MHz:                     800.0000
BogoMIPS:                        3600.00
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cdp_l3 invpcid_single intel_ppin ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb intel_pt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local avx512_bf16 dtherm ida arat pln pts hwp hwp_act_window hwp_epp hwp_pkg_req pku ospke avx512_vnni md_clear flush_l1d arch_capabilities
Virtualization:                  VT-x
L1d cache:                       3 MiB (96 instances)
L1i cache:                       3 MiB (96 instances)
L2 cache:                        96 MiB (96 instances)
L3 cache:                        132 MiB (4 instances)
NUMA node(s):                    4
NUMA node0 CPU(s):               0-23,96-119
NUMA node1 CPU(s):               24-47,120-143
NUMA node2 CPU(s):               48-71,144-167
NUMA node3 CPU(s):               72-95,168-191
Vulnerability Itlb multihit:     Not affected
Vulnerability L1tf:              Not affected
Vulnerability Mds:               Not affected
Vulnerability Meltdown:          Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1:        Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:        Mitigation; Enhanced IBRS, IBPB conditional, RSB filling
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Not affected

Versions of relevant libraries:
[pip3] numpy==2.0.2
[pip3] nvidia-cublas-cu12==12.1.3.1
[pip3] nvidia-cuda-cupti-cu12==12.1.105
[pip3] nvidia-cuda-nvrtc-cu12==12.1.105
[pip3] nvidia-cuda-runtime-cu12==12.1.105
[pip3] nvidia-cudnn-cu12==9.1.0.70
[pip3] nvidia-cufft-cu12==11.0.2.54
[pip3] nvidia-curand-cu12==10.3.2.106
[pip3] nvidia-cusolver-cu12==11.4.5.107
[pip3] nvidia-cusparse-cu12==12.1.0.106
[pip3] nvidia-cusparselt-cu12==0.6.2
[pip3] nvidia-nccl-cu12==2.21.5
[pip3] nvidia-nvjitlink-cu12==12.1.105
[pip3] nvidia-nvtx-cu12==12.1.105
[pip3] pytorch-triton==3.1.0+cf34004b8a
[pip3] torch==2.6.0.dev20241112+cu121
[pip3] torchaudio==2.5.0.dev20241112+cu121
[pip3] torchvision==0.20.0.dev20241112+cu121
[conda] numpy                     2.0.2                    pypi_0    pypi
[conda] nvidia-cublas-cu12        12.1.3.1                 pypi_0    pypi
[conda] nvidia-cuda-cupti-cu12    12.1.105                 pypi_0    pypi
[conda] nvidia-cuda-nvrtc-cu12    12.1.105                 pypi_0    pypi
[conda] nvidia-cuda-runtime-cu12  12.1.105                 pypi_0    pypi
[conda] nvidia-cudnn-cu12         9.1.0.70                 pypi_0    pypi
[conda] nvidia-cufft-cu12         11.0.2.54                pypi_0    pypi
[conda] nvidia-curand-cu12        10.3.2.106               pypi_0    pypi
[conda] nvidia-cusolver-cu12      11.4.5.107               pypi_0    pypi
[conda] nvidia-cusparse-cu12      12.1.0.106               pypi_0    pypi
[conda] nvidia-cusparselt-cu12    0.6.2                    pypi_0    pypi
[conda] nvidia-nccl-cu12          2.21.5                   pypi_0    pypi
[conda] nvidia-nvjitlink-cu12     12.1.105                 pypi_0    pypi
[conda] nvidia-nvtx-cu12          12.1.105                 pypi_0    pypi
[conda] pytorch-triton            3.1.0+cf34004b8a          pypi_0    pypi
[conda] torch                     2.6.0.dev20241112+cu121          pypi_0    pypi
[conda] torchaudio                2.5.0.dev20241112+cu121          pypi_0    pypi
[conda] torchvision               0.20.0.dev20241112+cu121          pypi_0    pypi
```

cc @chauhang @penguinwu @voznesenskym @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @amjames @avikchaudhuri @gmagogsfm @zhxchen17 @tugsbayasgalan @angelayi @suo @ydwu4