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

decoder_input_ids must be set to 2 when using fairseq model #2621

Open
cocovoc opened this issue Dec 24, 2024 · 0 comments
Open

decoder_input_ids must be set to 2 when using fairseq model #2621

cocovoc opened this issue Dec 24, 2024 · 0 comments

Comments

@cocovoc
Copy link

cocovoc commented Dec 24, 2024

Issue

When using fairseq and TensorRT-LLM for inference, I encountered an issue.
In the model's vocabulary,:

</s>:       0
<pad>:    2
</s>:       0
<unk>:    1

When using TensorRT-LLM, the decoder_input_ids must be set to 2 (the token) in order to function correctly.
If I set decoder_input_ids to other token IDs (e.g., 0 for ““ or 1 for “”), the model does not work properly and does not produce the expected output.

Environment

fairseq version: 0.12.2
TensorRT-LLM version: 0.9.0

Example

the output of the fairseq model :
Image
the output of the TensorRT-LLM (decoder_start_token_id =2):
Image
the output of the TensorRT-LLM (decoder_start_token_id =0):
Image

Does the token_id in the TensorRT-LLM engine need to be consistent with the token_id in the fairseq model?

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

1 participant