[Reformer] Add Masked LM Reformer
Author: patrickvonplaten
Pull request: yes

Similar to BERT, Reformer LM model is split into two:
- The standard Causal Language Modeling Reformer `ReformerModelWithLMHead`: Here we have a tiny breaking change as `ReformerModelWithLMHead` can no longer be used with bi-directional self-attention. This option should not really have been used anyways as there are no pretrained weights
- A masked language model Reformer `ReformerForMaskedLM`. 

Here a colab notebook showcasing how to use Reformer for MLM: https://colab.research.google.com/drive/1tzzh0i8PgDQGV3SMFUGxM7_gGae3K-uW?usp=sharing

Checked all tests including RUN_SLOW on GPU => all pass.

Comments:
# [Codecov](https://codecov.io/gh/huggingface/transformers/pull/5426?src=pr&el=h1) Report
> Merging [#5426](https://codecov.io/gh/huggingface/transformers/pull/5426?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/35befd9ce31c23a774fd34f57bc44033ce70141d&el=desc) will **increase** coverage by `0.29%`.
> The diff coverage is `96.15%`.

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

```diff
@@            Coverage Diff             @@
##           master    #5426      +/-   ##
==========================================
+ Coverage   77.57%   77.86%   +0.29%     
==========================================
  Files         141      140       -1     
  Lines       24581    24368     -213     
==========================================
- Hits        19068    18974      -94     
+ Misses       5513     5394     -119     
```


| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/5426?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/transformers/\_\_init\_\_.py](https://codecov.io/gh/huggingface/transformers/pull/5426/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9fX2luaXRfXy5weQ==) | `99.22% <ø> (ø)` | |
| [src/transformers/modeling\_reformer.py](https://codecov.io/gh/huggingface/transformers/pull/5426/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19yZWZvcm1lci5weQ==) | `89.45% <96.00%> (+1.34%)` | :arrow_up: |
| [src/transformers/modeling\_auto.py](https://codecov.io/gh/huggingface/transformers/pull/5426/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19hdXRvLnB5) | `74.41% <100.00%> (ø)` | |
| [src/transformers/modeling\_tf\_distilbert.py](https://codecov.io/gh/huggingface/transformers/pull/5426/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl9kaXN0aWxiZXJ0LnB5) | `66.25% <0.00%> (-32.52%)` | :arrow_down: |
| [src/transformers/trainer\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/5426/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy90cmFpbmVyX3V0aWxzLnB5) | `78.26% <0.00%> (-7.46%)` | :arrow_down: |
| [src/transformers/training\_args.py](https://codecov.io/gh/huggingface/transformers/pull/5426/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy90cmFpbmluZ19hcmdzLnB5) | `76.84% <0.00%> (-0.71%)` | :arrow_down: |
| [src/transformers/tokenization\_utils\_base.py](https://codecov.io/gh/huggingface/transformers/pull/5426/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy90b2tlbml6YXRpb25fdXRpbHNfYmFzZS5weQ==) | `93.71% <0.00%> (-0.50%)` | :arrow_down: |
| [src/transformers/pipelines.py](https://codecov.io/gh/huggingface/transformers/pull/5426/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9waXBlbGluZXMucHk=) | `75.31% <0.00%> (-0.48%)` | :arrow_down: |
| [src/transformers/optimization\_tf.py](https://codecov.io/gh/huggingface/transformers/pull/5426/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9vcHRpbWl6YXRpb25fdGYucHk=) | `57.27% <0.00%> (-0.39%)` | :arrow_down: |
| ... and [14 more](https://codecov.io/gh/huggingface/transformers/pull/5426/diff?src=pr&el=tree-more) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/5426?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/5426?src=pr&el=footer). Last update [35befd9...4e52c6b](https://codecov.io/gh/huggingface/transformers/pull/5426?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Yeah, I'm only adding one assert, which forces `ReformerLMHead` to not have bi-directional attention, but I doubt anybody has used this yet anyways

When I make the sequences shorter but increase the batch size an zero division error returns.
Do I need to take care about something specific ?

> When I make the sequences shorter but increase the batch size an zero division error returns.
> Do I need to take care about something specific ?

Hey @flozi00, would be great if you can open an issue with environment info and code so that I can reproduce :-)