The `xla_device` argument has been deprecated
Author: yqiz-98
Pull request: no

### System Info

Transformers v4.4.0       pycharm        python3.8

### 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

from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("mrm8488/t5-base-finetuned-question-generation-ap")
model = AutoModelForSeq2SeqLM.from_pretrained("mrm8488/t5-base-finetuned-question-generation-ap")

def get_question(answer, context, max_length=64):
  input_text = "answer: %s  context: %s 
" % (answer, context)
  features = tokenizer([input_text], return_tensors='pt')

  output = model.generate(input_ids=features['input_ids'],
               attention_mask=features['attention_mask'],
               max_length=max_length)

  output = tokenizer.decode(output[0])[6:][:-4]
  return output

context = "Alan Turing defined AI as the science that enables computers to perform tasks that require human intelligence. Academics at Stanford University consider AI to be the science and engineering of intelligent machines, especially intelligent computer programs. Wikipedia defines AI as the intelligence shown by artificially created systems, and the term also refers to the scientific field that studies whether and how such intelligent systems can be achieved. No matter how it is defined, it cannot be separated from intelligence. However, so far, human beings have not been able to give a unified definition of intelligence, and generally speaking, intelligence only refers to the expression form of human intelligence. Professor Zhong Yixin, former chairman of the Chinese Society for Artificial Intelligence, believes that human intelligence consists of finding problems, defining problems and solving problems, while artificial intelligence is only capable of solving problems. The author believes that intelligence is a kind of order, the embodiment of information, and also the ability to make the world develop in an orderly direction. Sadly, according to the principle of increasing entropy, no matter what the agents do, the universe is always moving in the direction of increasing entropy, which is more and more disorder and chaos. It is not known whether this is God's deliberate arrangement, or human observation of the universe beyond the universe."
answer = "solving problems"
output = get_question(answer, context)




#########[error message]:
The `xla_device` argument has been deprecated in v4.4.0 of Transformers. It is ignored and you can safely remove it from your `config.json` file.
The `xla_device` argument has been deprecated in v4.4.0 of Transformers. It is ignored and you can safely remove it from your `config.json` file.
The `xla_device` argument has been deprecated in v4.4.0 of Transformers. It is ignored and you can safely remove it from your `config.json` file.
The `xla_device` argument has been deprecated in v4.4.0 of Transformers. It is ignored and you can safely remove it from your `config.json` file.



### Expected behavior

The program can run normally. This warning will reduce the previous script loading speed. How to eliminate this warning. Thank you.



Comments:
Hi @yqiz-98, thanks for reporting this issue. The warning is being raised, as the [config for the checkpoint mrm8488/t5-base-finetuned-question-generation-ap](https://huggingface.co/mrm8488/t5-base-finetuned-question-generation-ap/blob/5b3fa1afa0bba84b23b2c27eb7b4bc35aae63876/config.json#L51) contains [the argument `xla_device`](https://github.com/huggingface/transformers/blob/370f0ca18c8e4577357df59936e790acdecef4ac/src/transformers/configuration_utils.py#L363). As the error message indicates, this is now deprecated and can be removed from the config. 

It would be up to the user [mrm8488](https://huggingface.co/mrm8488) whether they want to make this update to the configuration file. The update would mean that the config file isn't fully compatible with versions of transformers < 4.4.x. I'd suggest opening a discussion [on the repo](https://huggingface.co/mrm8488/t5-base-finetuned-question-generation-ap/discussions) to ask about this. 

With this config file, the program can still run normally. I'd be surprised if this caused significant differences to the loading speed. One update we can do on our end, if update `logger.warning` to `logger.warning_once` so that the message is only printed to terminal once. 
 

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.