Feed forward chunking others
Author: Pradhy729
Pull request: yes

Adding feed forward chunking to other models. Based on #6024 

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

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

```diff
@@            Coverage Diff             @@
##           master    #6365      +/-   ##
==========================================
+ Coverage   78.42%   80.47%   +2.04%     
==========================================
  Files         156      156              
  Lines       28129    28152      +23     
==========================================
+ Hits        22061    22655     +594     
+ Misses       6068     5497     -571     
```


| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/6365?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/transformers/configuration\_reformer.py](https://codecov.io/gh/huggingface/transformers/pull/6365/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9jb25maWd1cmF0aW9uX3JlZm9ybWVyLnB5) | `100.00% <ø> (ø)` | |
| [src/transformers/modeling\_bert.py](https://codecov.io/gh/huggingface/transformers/pull/6365/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19iZXJ0LnB5) | `88.26% <ø> (-0.17%)` | :arrow_down: |
| [src/transformers/modeling\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/6365/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ191dGlscy5weQ==) | `87.35% <ø> (+0.19%)` | :arrow_up: |
| [src/transformers/configuration\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/6365/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9jb25maWd1cmF0aW9uX3V0aWxzLnB5) | `96.62% <100.00%> (+1.38%)` | :arrow_up: |
| [src/transformers/modeling\_albert.py](https://codecov.io/gh/huggingface/transformers/pull/6365/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19hbGJlcnQucHk=) | `83.50% <100.00%> (+0.13%)` | :arrow_up: |
| [src/transformers/modeling\_distilbert.py](https://codecov.io/gh/huggingface/transformers/pull/6365/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19kaXN0aWxiZXJ0LnB5) | `97.84% <100.00%> (+1.65%)` | :arrow_up: |
| [src/transformers/modeling\_longformer.py](https://codecov.io/gh/huggingface/transformers/pull/6365/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19sb25nZm9ybWVyLnB5) | `92.02% <100.00%> (+0.07%)` | :arrow_up: |
| [src/transformers/modeling\_reformer.py](https://codecov.io/gh/huggingface/transformers/pull/6365/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19yZWZvcm1lci5weQ==) | `96.09% <100.00%> (ø)` | |
| [src/transformers/modeling\_xlm.py](https://codecov.io/gh/huggingface/transformers/pull/6365/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ194bG0ucHk=) | `91.31% <100.00%> (+0.07%)` | :arrow_up: |
| [src/transformers/modeling\_xlnet.py](https://codecov.io/gh/huggingface/transformers/pull/6365/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ194bG5ldC5weQ==) | `83.42% <100.00%> (+0.11%)` | :arrow_up: |
| ... and [17 more](https://codecov.io/gh/huggingface/transformers/pull/6365/diff?src=pr&el=tree-more) | |

------

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


https://github.com/huggingface/transformers/pull/6024 is merged :-) Great work @Pradhy729! It would be a good idea to rebase this PR to current master so that you can easily leverage the tests that were added in https://github.com/huggingface/transformers/pull/6024 just by setting the flag `test_chunking=True` for all models you want to add here.

Yes - definitely will do. Was just waiting for the merge. Thanks for adding the tests.

@patrickvonplaten Feed forward chunking has been added for the following:
1. Albert
2. Distillbert
3. Longformer
4. XLNet
5. XLM

Also, changed model signature to have callable as first positional argument.

Hi @patrickvonplaten --> Can you review and approve if this looks good?


Hey @Pradhy729 - this looks great! 
1) Can you add the docstrings for `chunk_size_feed_forward` as explained in the comment above and delete the corresponding config param in Reformer and the Reformer docstring (You can just cut & paste the Reformer docstring here)
2) Can you please remove the `test_chunking=True` statements in the model specific test files -> I think it's only in test_modeling_bert.py actually.
3) It would be awesome if you try to rebase the branch to master (`git fetch upstream master`, `git rebase upstream/master`).
If you have too many merge conflicts - then I'll do it :-) 

@patrickvonplaten 
Done. Please review and let me know if there's anything else.

LGTM! @Pradhy729 - great work!

Merging! Good job @Pradhy729