lightseq icon indicating copy to clipboard operation
lightseq copied to clipboard

ValueError: Sequence length 713 exceeds the limit 300.

Open alayamanas opened this issue 3 years ago • 2 comments

Fairseq working fine, but lightseq (same params) throw this error, Here I found relevent code

why need MAX_SEQ_LENGTH = 300?

Can someone help me please

alayamanas avatar Aug 11 '21 17:08 alayamanas

Fairseq working fine, but lightseq (same params) throw this error, Here I found relevent code

why need MAX_SEQ_LENGTH = 300?

Can someone help me please

You can manually change MAX_SEQ_LENGTH to the maximal sequence length of your dataset, and then use pip install -e . to compile the source code.

We set MAX_SEQ_LENGTH=300 here to reduce the pre-allocated GPU memory, and this can handle most of the NLP tasks.

godweiyang avatar Aug 12 '21 04:08 godweiyang

Thanks for your reply, I set MAX_SEQ_LENGTH to 512 according to this, and also set fairseq max-source-positions = 512, now working fine.

and I still have a small question: fairseq's model size = 964M, lightseq's model size = 1.2G with almost same parmas, why they are not the same size? Is the model structure of lightseq more complicated?

Thanks again.

alayamanas avatar Aug 12 '21 08:08 alayamanas