We don't need attention_mask in sdpa implementation?
Author: rangehow
Pull request: no

### System Info

- `transformers` version: 4.39.0.dev0
- Platform: Linux-3.10.0-1160.71.1.el7.x86_64-x86_64-with-glibc2.17
- Python version: 3.10.13
- Huggingface_hub version: 0.21.4
- Safetensors version: 0.4.2
- Accelerate version: 0.27.2
- Accelerate config:    - compute_environment: LOCAL_MACHINE
        - distributed_type: MULTI_GPU
        - mixed_precision: bf16
        - use_cpu: False
        - debug: False
        - num_processes: 4
        - machine_rank: 0
        - num_machines: 1
        - gpu_ids: 0,1,2,3
        - rdzv_backend: static
        - same_network: True
        - main_training_function: main
        - downcast_bf16: no
        - tpu_use_cluster: False
        - tpu_use_sudo: False
        - tpu_env: []
        - dynamo_config: {'dynamo_backend': 'INDUCTOR', 'dynamo_mode': 'max-autotune', 'dynamo_use_dynamic': False, 'dynamo_use_fullgraph': False}
- PyTorch version (GPU?): 2.2.1 (True)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using GPU in script?: <fill in>
- Using distributed or parallel set-up in script?: <fill in>

### Who can help?

_No response_

### Information

- [X] The official example scripts
- [ ] My own modified scripts

### Tasks

- [X] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)

### Reproduction
I found there has no decoder attention mask during bart model training using sdpa. 
I set a breakpoint on line 1394 to see the decoder attention mask https://github.com/huggingface/transformers/blob/main/src/transformers/models/bart/modeling_bart.py#L1377-L1394
![image](https://github.com/huggingface/transformers/assets/88258534/74d53a9d-2ff8-4075-9acc-6c8ac21a400f)
At the same time, I am sure that the branch entering here is for sdpa.
![image](https://github.com/huggingface/transformers/assets/88258534/6cac8f6e-93b0-4cd4-8d04-5c6e6b89d5eb)
If I run the naive implementation 
```python
attention_mask = _prepare_4d_causal_attention_mask(
                attention_mask, input_shape, inputs_embeds, past_key_values_length
            )
```
![image](https://github.com/huggingface/transformers/assets/88258534/109aa452-03b5-4049-afa9-a5bf14943cfd)
I will get a correct causal mask, So I am not sure if here is a bug or not.
Would you like to check it out ：）

### Expected behavior

Check whether the implementation of attention mask has bug here.

Comments:
if you read torch docs, you will notice that torch sdpa apply causal mask itself by setting is_causal=True.
there could be another way to use already defined causal mask but to my best knowledge, it is way faster to use is_causal option.

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.