added compiled model support for inference
# What does this PR do?

Adds support for torch.compile-ed models in pipelines.

Basically, you cannot run torch.compile-ed model under `torch.inference_mode()` context and should use `torch.no_grad` instead

Examples:

<img width="1004" alt="image" src="https://github.com/huggingface/transformers/assets/22663468/04f0bde9-c7d0-4776-9fc4-bd224fadebce">

Here you see start of the super long traceback that ends with:
```
RuntimeError: Inference tensors do not track version counter.

While executing %getitem : [#users=1] = call_function[target=operator.getitem](args = (%attention_mask, 
(slice(None, None, None), None, None, slice(None, None, None))), kwargs = {})
Original traceback:
  File "/home/alexander/jupyter_server/.venv/lib/python3.8/site-packages/transformers/modeling_utils.py", line 890,
in get_extended_attention_mask
    extended_attention_mask = attention_mask[:, None, None, :]
 |   File 
"/home/alexander/jupyter_server/.venv/lib/python3.8/site-packages/transformers/models/bert/modeling_bert.py", line 
993, in forward
    extended_attention_mask: torch.Tensor = self.get_extended_attention_mask(attention_mask, input_shape)
 |   File 
"/home/alexander/jupyter_server/.venv/lib/python3.8/site-packages/transformers/models/bert/modeling_bert.py", line 
1758, in forward
    outputs = self.bert(
```

and 

```
BackendCompilerFailed: debug_wrapper raised RuntimeError: Inference tensors do not track version counter.

While executing %getitem : [#users=1] = call_function[target=operator.getitem](args = (%attention_mask, 
(slice(None, None, None), None, None, slice(None, None, None))), kwargs = {})
Original traceback:
  File "/home/alexander/jupyter_server/.venv/lib/python3.8/site-packages/transformers/modeling_utils.py", line 890,
in get_extended_attention_mask
    extended_attention_mask = attention_mask[:, None, None, :]
 |   File 
"/home/alexander/jupyter_server/.venv/lib/python3.8/site-packages/transformers/models/bert/modeling_bert.py", line 
993, in forward
    extended_attention_mask: torch.Tensor = self.get_extended_attention_mask(attention_mask, input_shape)
 |   File 
"/home/alexander/jupyter_server/.venv/lib/python3.8/site-packages/transformers/models/bert/modeling_bert.py", line 
1758, in forward
    outputs = self.bert(

```

Possible solution right now:

<img width="692" alt="image" src="https://github.com/huggingface/transformers/assets/22663468/f6b2c599-78b9-4e0c-89b7-31ded7532a52">

## Who can review?
@Narsil

_The documentation is not available anymore as the PR was closed or merged._