fsdp bf16 enable autocast
# What does this PR do?

1. Fixes #21560 wrt FSDP integration. 

_The documentation is not available anymore as the PR was closed or merged._<|||||>Hello @sgugger, officially, there is not much info on `mixed_precision` support of FSDP. In the official docs here https://pytorch.org/docs/stable/fsdp.html, it doesn't mention anything regarding `bf16` and `fp16` nuances. 

In the  official tutorial: https://github.com/lessw2020/transformer_central/tree/main/mixed_precision, for `bf16` they don't specify the need for autocasting. Here, it is mentioned the need for `ShardedGradScaler` for `fp16`. And the issue https://github.com/pytorch/pytorch/issues/75676 is still open. 

However, `bf16` support with FSDP does work for few models, notably T5 as mentioned in this github comment from my experiments: https://github.com/pytorch/pytorch/issues/79605#issuecomment-1184410231

In T5, attention probs are casted back to `bf16` explicitly by this line of code: https://github.com/huggingface/transformers/blob/main/src/transformers/models/t5/modeling_t5.py#L560-L562 . 

This avoids the error that happens for BERT in #21560. With this observation, I just tried enabling autocast and observed no errors and expected performance. Hence, this PR. 


<|||||>using this PR when I run:
```bash
torchrun --nproc_per_node=2 run_glue.py   --model_name_or_path bert-base-cased   --task_name $TASK_NAME   --overwrite_output_dir   --do_train   --do_eval   --max_seq_length 128   --per_device_train_batch_size 16   --learning_rate 2e-5   --num_train_epochs 3   --output_dir $TASK_NAME/   --fsdp "full_shard auto_wrap"   --fsdp_config "fsdp_config.json"   --bf16
```

wirh fsdp_config.json contents being:
```
{
	"fsdp_transformer_layer_cls_to_wrap": "BertLayer",
	"fsdp_backward_prefetch": "backward_pre",
	"fsdp_forward_prefetch": true,
	"limit_all_gathers": true
}
```

output logs:
```
wandb: Run summary:
wandb:                  eval/accuracy 0.84804
wandb:            eval/combined_score 0.87039
wandb:                        eval/f1 0.89273
wandb:                      eval/loss 0.36461
```

without fsdp run gave below results:
```
torchrun --nproc_per_node=2 run_glue.py   --model_name_or_path bert-base-cased   --task_name $TASK_NAME   --overwrite_output_dir   --do_train   --do_eval   --max_seq_length 128   --per_device_train_batch_size 16   --learning_rate 2e-5   --num_train_epochs 3   --output_dir $TASK_NAME/   --bf16
```

```
wandb: Run summary:
wandb:                  eval/accuracy 0.84804
wandb:            eval/combined_score 0.87057
wandb:                        eval/f1 0.8931
wandb:                      eval/loss 0.36857
```

So, similar performance between them.