Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The FT t5 beam search algorithm generates inconsistent results with HF's #522

Closed
shiqingzhangCSU opened this issue Mar 25, 2023 · 8 comments

Comments

@shiqingzhangCSU
Copy link

Branch/Tag/Commit

main

Docker Image Version

nvcr.io/nvidia/pytorch:22.09-py3

GPU name

A30

CUDA Driver

11.6

model

mt5

Reproduced Steps

Hi! I tested the results of FT and HF, I found that the beamsearch algorithm in HF(https://arxiv.org/pdf/1610.02424.pdf) maybe different from the one in FT and may generate different results. Is the beamsearch in FT the implementation in this paper(https://arxiv.org/pdf/1601.00372.pdf)? I look forward to your reply!

@byshiue
Copy link
Collaborator

byshiue commented Mar 28, 2023

Do you use early_stopping in HF?

@shiqingzhangCSU
Copy link
Author

Yes, I tried early_stopping and there was no change in results. We found that no_repeat_ngram_size has a greater impact on beam=1. When the no_repeat_ngram_size in HF is set to null, the result of HF is the same as that of FT.

@byshiue
Copy link
Collaborator

byshiue commented Mar 28, 2023

FT does not support early_stopping=False and no_repeat_ngram_size now.

@shiqingzhangCSU
Copy link
Author

If we want to add no_repeat_ngram_size features ourselves, how do we develop them? Any suggestions?

@byshiue
Copy link
Collaborator

byshiue commented Mar 28, 2023

You can add a penalty kernel in https://github.com/NVIDIA/FasterTransformer/blob/main/src/fastertransformer/layers/DynamicDecodeLayer.cc like other penalty to make sure the logit of repeated token is -inf.

@shiqingzhangCSU
Copy link
Author

If I'm not familiar with this library, how long do you estimate it will take me to add this feature?

@byshiue
Copy link
Collaborator

byshiue commented Mar 28, 2023

Sorry, I cannot help to provide the estimated time because it depends on too many factors.

@shiqingzhangCSU
Copy link
Author

Sorry, I cannot help to provide the estimated time because it depends on too many factors.

Thanks for the suggestion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants