Using `model.sample()` and increasing the `max_length` leads to CUDA OOM crash
## Environment info

- `transformers` version: 4.6.0.dev0
- Platform: Linux-5.4.104+-x86_64-with-Ubuntu-18.04-bionic
- Python version: 3.7.11
- PyTorch version (GPU?): 1.9.0+cu102 (True)
- Tensorflow version (GPU?): 2.5.0 (True)
- Using GPU in script?: Yes
- Using distributed or parallel set-up in script?: No

### Who can help
<!-- Your issue will be replied to more quickly if you can figure out the right person to tag with @
 If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
 Please tag fewer than 3 people.

Models:

- albert, bert, xlm: @LysandreJik
- blenderbot, bart, marian, pegasus, encoderdecoder,  t5: @patrickvonplaten, @patil-suraj
- longformer, reformer, transfoxl, xlnet: @patrickvonplaten
- fsmt: @stas00
- funnel: @sgugger
- gpt2: @patrickvonplaten, @LysandreJik
- rag: @patrickvonplaten, @lhoestq
- tensorflow: @Rocketknight1

Library:

- benchmarks: @patrickvonplaten
- deepspeed: @stas00
- ray/raytune: @richardliaw, @amogkam
- text generation: @patrickvonplaten
- tokenizers: @LysandreJik
- trainer: @sgugger
- pipelines: @LysandreJik

Documentation: @sgugger

Model hub:

- for issues with a model report at https://discuss.huggingface.co/ and tag the model's creator.

HF projects:

- datasets: [different repo](https://github.com/huggingface/datasets)
- rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)

Examples:

- maintained examples (not research project or legacy): @sgugger, @patil-suraj
- research_projects/bert-loses-patience: @JetRunner
- research_projects/distillation: @VictorSanh

 -->

I think @patrickvonplaten and @LysandreJik

## Information

Model I am using GPT-NEO:

The problem arises when using:
* my own modified scripts: Simply using `.sample()` method with `GPTNeoForCausalLM`

The tasks I am working on is:

* my own task: Simple Text generation.

## To reproduce

Steps to reproduce the behavior:

1. Visit this colab and run GPU runtime: https://colab.research.google.com/drive/1VjVUrptwgUx3TxdlcVqPNwXyX6YJYSAK
2. Execute Runtime -> Run All
3. Note the `nvidia-smi` output.
4. In the last cell, increase the `max_length` from 30 to 350. And run again.
4. Even if the crash doesn't occur, check `nvidia-smi` again.

## Expected behavior

To not consume that much GPU memory. It is understood that some tasks may take some memory, but using **~10 GB** for an increase of 300 tokens is... something wrong.
Related to https://github.com/huggingface/transformers/issues/11320

Cc @patil-suraj <|||||>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/master/CONTRIBUTING.md) are likely to be ignored.