XGLM Bug: break: module 'torch.utils' has no attribute 'checkpoint'
## Environment info
<!-- You can run the command `transformers-cli env` and copy-and-paste its output below.
     Don't forget to fill out the missing fields in that output! -->

- `transformers` version: 4.17.0.dev0
- Platform: Linux-4.9.253-tegra-aarch64-with-glibc2.29
- Python version: 3.8.10
- PyTorch version (GPU?): 1.10.2 (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?: Yes
- Using distributed or parallel set-up in script?: No

### Who can help
@patil-suraj 

## Information

Model I am using (Bert, XLNet ...): XGLMForCausalLM

The problem arises when using:
* [X] the official example scripts: (give details below)
* [ ] my own modified scripts: (give details below)

The tasks I am working on is:
* [ ] an official GLUE/SQUaD task: (give the name)
* [X] my own task or dataset: (give details below)

## To reproduce

Steps to reproduce the behavior:

1. I am trying to start training on a dataset using a converted model. 
2. As soon as I start training using the script `run_clm.py` (found in the examples folder) I get the following error back:
```
break: module 'torch.utils' has no attribute 'checkpoint'
```
Cause might be related to this: https://discuss.pytorch.org/t/attributeerror-module-torch-utils-has-no-attribute-checkpoint/101543/6

When adding the following line in the modeling_xglm.py, the error does not appear and training starts:

```
from torch.utils.checkpoint import checkpoint
```
<!-- If you have code snippets, error messages, stack traces please provide them here as well.
     Important! Use code tags to correctly format your code. See https://help.github.com/en/github/writing-on-github/creating-and-highlighting-code-blocks#syntax-highlighting
     Do not use screenshots, as they are hard to read and (more importantly) don't allow others to copy-and-paste your code.-->

## Expected behavior

Training would start without any issues.
Hi,
Could you please share a code snippet or colab so I could reproduce this issue? Thanks <|||||>I can't share my dataset, but I used this one as the basis for the trainer:

https://github.com/huggingface/transformers/blob/master/examples/pytorch/language-modeling/run_clm.py

EDIT: Just train any XGLM-compatible model with a default dataset (wikitext for example)<|||||>Thank you for reporting this. Fixed in #15427 