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

Include tokens from prompt phase in counter_generation_tokens #2802

Merged
merged 4 commits into from
Feb 22, 2024

Conversation

ronensc
Copy link
Contributor

@ronensc ronensc commented Feb 7, 2024

I noticed that the counter_generation_tokens metric was missing tokens generated during the prompt phase, only counting those from the autoregressive generation phase. This PR addresses that by incorporating tokens from both phases into the counter. Also, I've added a simple unit test to verify the counter.

- Count generation tokens during prompt phase
- Add a simple unit test to test the metric
@ronensc
Copy link
Contributor Author

ronensc commented Feb 7, 2024

@NikolaBorisov @rib-2 Could you please review my PR?

@robertgshaw2-redhat
Copy link
Collaborator

@ronensc

Just so I am clear, the need for this comes from the fact that num_batched_tokens in the prompt_run case only includes the prefill tokens and none of the new tokens generated?

@ronensc
Copy link
Contributor Author

ronensc commented Feb 8, 2024

@ronensc

Just so I am clear, the need for this comes from the fact that num_batched_tokens in the prompt_run case only includes the prefill tokens and none of the new tokens generated?

correct.

Copy link
Contributor

@NikolaBorisov NikolaBorisov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Yeah, we missed counting those. We can merge this.

@NikolaBorisov
Copy link
Contributor

@simon-mo This is safe to merge.

@NikolaBorisov
Copy link
Contributor

@simon-mo Can we merge this. I reviewed it. It is safe and good

@simon-mo simon-mo merged commit 4caf704 into vllm-project:main Feb 22, 2024
22 checks passed
@ronensc ronensc deleted the fix-counter_generation_tokens branch February 26, 2024 07:47
xjpang pushed a commit to xjpang/vllm that referenced this pull request Mar 4, 2024
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

Successfully merging this pull request may close these issues.

4 participants