-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Question: Return log probabilites #983
Comments
Hi @sindhuvahinis , this is a general missing return in generation.py that is not T5 or enc-dec only. In summary, the return log probs and return cumulative log probs are both supported, as you saw in the SamplingConfig. But the I recommend you manually add Please let me know this works |
Hey @symphonylyh Thanks for the reply Yes I understand it's a generic setting. And return_dict or not does not matter. I just want to get the log_probs of output tokens generated.
Output I got.
|
Hello @symphonylyh I printed out self.log_probs after each each handler_per_step call. For each token generation, it seems to be zero tensors and the does not seem like log_probs is updated anywhere. Also printed out log_probs after all generation is over. It is still zero tensors. |
Hi @sindhuvahinis, I reproduced your observation, and confirmed it's a bug. I have a full fix internally, but it would be too many small changes to communicate over here. As a temporary workaround, can you try the following changes:
|
Thank you @symphonylyh . Will check this out. |
@symphonylyh Are you sure v0.8.0 fixed this issue? I tried with 0.8.0. I still dont see log_probs. They are all set to zero |
+1 Also can't see log_probs returning non-zero in v0.8.0 |
@symphonylyh I see your suggested code is in v0.8.0, but does it work for you? Could you confirm? |
Trying out T5 with python backend. https://github.com/NVIDIA/TensorRT-LLM/blob/main/examples/enc_dec/run.py#L484
I see SamplingConfig has output_log_probs https://github.com/NVIDIA/TensorRT-LLM/blob/main/tensorrt_llm/runtime/generation.py#L355.
But in the return dict does not have the log probabilities https://github.com/NVIDIA/TensorRT-LLM/blob/main/tensorrt_llm/runtime/generation.py#L2515.
Is there any other way to get the log probabilities?
The text was updated successfully, but these errors were encountered: