allenai / allenai/longformer

GPU OOM when training XLM-RoBERTa with LongSelfAttention

Aberta
#91 1 comentário 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Python
Estrelas
2.2k
Forks
286
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

Hi, thanks for the great example on training RoBERTa with long attention.

Followed this example: https://github.com/allenai/longformer/blob/master/scripts/convert_model_to_long.ipynb
Was able to successfully train for one epoch with the example notebook on Colab. After changing Roberta to XLMRoberta the model training does not fit into 16GB GPU memory.

In short, this is what I did:
`from transformers import RobertaForMaskedLM, RobertaTokenizerFast`
changed to
`from transformers import XLMRobertaForMaskedLM, XLMRobertaTokenizer`

After some experimentation I tried installing apex and train with fp16 option but still facing the CUDA out of memory error.
The experiment I ran is available in Colab: https://colab.research.google.com/drive/1lje_QTh6F3f9w0LoD0yB0mEUffGWkHG-?usp=sharing

Does anyone have any ideas on how to train XLM-RoBERTa with LongSelfAttention and why does it differ than much from RoBERTa?

Thanks!

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.