Fix accelerate tests
# What does this PR do?
Fixes the accelerate test based on new accelerate update.
Some of the test are fixed, but not all yet, so WIP

`for i in range(len(max_memory)-2):` 
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_19746). All of your documentation changes will be reflected on that endpoint.