Training on GLUE using TPUs
Author: LysandreJik
Pull request: yes

**_Disclaimer: This pull request is under active development and is being improved daily._**

This pull request aims to train a BERT model on GLUE, using a TPU. Several approaches are tested: keras' fit method (doesn't work yet), and a custom training loop using TPUStrategy.

The custom training loop currently worked until the 2nd of October on the `tf-nightly-2.0-preview`. The TPU should be `nightly` too. 

Comments:
# [Codecov](https://codecov.io/gh/huggingface/transformers/pull/1424?src=pr&el=h1) Report
> Merging [#1424](https://codecov.io/gh/huggingface/transformers/pull/1424?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/b3cfd979460d6ff828741eddffc72c34417b5046?src=pr&el=desc) will **decrease** coverage by `0.05%`.
> The diff coverage is `50%`.

[![Impacted file tree graph](https://codecov.io/gh/huggingface/transformers/pull/1424/graphs/tree.svg?width=650&token=9qOlN6Hb1c&height=150&src=pr)](https://codecov.io/gh/huggingface/transformers/pull/1424?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master    #1424      +/-   ##
==========================================
- Coverage   84.72%   84.67%   -0.06%     
==========================================
  Files          84       84              
  Lines       12591    12600       +9     
==========================================
+ Hits        10668    10669       +1     
- Misses       1923     1931       +8
```


| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/1424?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [transformers/modeling\_tf\_bert.py](https://codecov.io/gh/huggingface/transformers/pull/1424/diff?src=pr&el=tree#diff-dHJhbnNmb3JtZXJzL21vZGVsaW5nX3RmX2JlcnQucHk=) | `95.03% <50%> (-0.67%)` | :arrow_down: |
| [transformers/tokenization\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/1424/diff?src=pr&el=tree#diff-dHJhbnNmb3JtZXJzL3Rva2VuaXphdGlvbl91dGlscy5weQ==) | `90.19% <0%> (-1.3%)` | :arrow_down: |
| [transformers/modeling\_gpt2.py](https://codecov.io/gh/huggingface/transformers/pull/1424/diff?src=pr&el=tree#diff-dHJhbnNmb3JtZXJzL21vZGVsaW5nX2dwdDIucHk=) | `83.98% <0%> (ø)` | :arrow_up: |
| [transformers/configuration\_gpt2.py](https://codecov.io/gh/huggingface/transformers/pull/1424/diff?src=pr&el=tree#diff-dHJhbnNmb3JtZXJzL2NvbmZpZ3VyYXRpb25fZ3B0Mi5weQ==) | `88.63% <0%> (ø)` | :arrow_up: |
| [transformers/modeling\_tf\_distilbert.py](https://codecov.io/gh/huggingface/transformers/pull/1424/diff?src=pr&el=tree#diff-dHJhbnNmb3JtZXJzL21vZGVsaW5nX3RmX2Rpc3RpbGJlcnQucHk=) | `96.61% <0%> (ø)` | :arrow_up: |
| [transformers/modeling\_tf\_gpt2.py](https://codecov.io/gh/huggingface/transformers/pull/1424/diff?src=pr&el=tree#diff-dHJhbnNmb3JtZXJzL21vZGVsaW5nX3RmX2dwdDIucHk=) | `93.47% <0%> (ø)` | :arrow_up: |
| [transformers/tokenization\_gpt2.py](https://codecov.io/gh/huggingface/transformers/pull/1424/diff?src=pr&el=tree#diff-dHJhbnNmb3JtZXJzL3Rva2VuaXphdGlvbl9ncHQyLnB5) | `96.72% <0%> (ø)` | :arrow_up: |
| [transformers/modeling\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/1424/diff?src=pr&el=tree#diff-dHJhbnNmb3JtZXJzL21vZGVsaW5nX3V0aWxzLnB5) | `92.69% <0%> (+0.24%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/1424?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/huggingface/transformers/pull/1424?src=pr&el=footer). Last update [b3cfd97...111bf7c](https://codecov.io/gh/huggingface/transformers/pull/1424?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Tensorflow official team have implemented this, I have tested it in TPU with tf-nightly vesion, it works well now, you can refer to https://github.com/tensorflow/models/tree/master/official/nlp