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

[Speculative decoding] Add periodic log with time spent in proposal/scoring/verification #6963

Merged
merged 7 commits into from
Aug 5, 2024

Conversation

cadedaniel
Copy link
Collaborator

  • Log values whenever rejection sampler produces metrics
  • Measures average time spent proposing each token, time spent scoring, and time spent verifiying.

Copy link

👋 Hi! Thank you for contributing to the vLLM project.
Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which consists a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of default ones by unblocking the steps in your fast-check build on Buildkite UI.

Once the PR is approved and ready to go, please make sure to run full CI as it is required to merge (or just use auto-merge).

To run full CI, you can do one of these:

  • Comment /ready on the PR
  • Add ready label to the PR
  • Enable auto-merge.

🚀

@cadedaniel cadedaniel marked this pull request as ready for review July 30, 2024 23:15
Comment on lines 937 to 946
class Timer:

def __enter__(self):
self.start_time = time.time()
return self

def __exit__(self, exc_type, exc_value, traceback):
self.end_time = time.time()
self.elapsed_time_s = self.end_time - self.start_time
self.elapsed_time_ms = self.elapsed_time_s * 1000
Copy link
Collaborator

Choose a reason for hiding this comment

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

Put it in a more common space like utils?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ack

Comment on lines 740 to 747
(average_time_per_proposal_tok_ms, scoring_time_ms,
verification_time_ms) = stage_times
logger.info(
"SpecDecodeWorker stage times: "
"average_time_per_proposal_tok_ms=%.02f "
"scoring_time_ms=%.02f verification_time_ms=%.02f",
average_time_per_proposal_tok_ms, scoring_time_ms,
verification_time_ms)
Copy link
Collaborator

Choose a reason for hiding this comment

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

It looks like we will print this log every step? Did I miss something?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

only when rejection sampler emits metrics, which is every 5s

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll add comment

Copy link
Collaborator

@comaniac comaniac left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@rkooo567 rkooo567 left a comment

Choose a reason for hiding this comment

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

QQ; should we enable it only disable_log_stats=False?

@cadedaniel
Copy link
Collaborator Author

QQ; should we enable it only disable_log_stats=False?

What is the motivation ?

@rkooo567
Copy link
Collaborator

What is the motivation ?

oh because normally many users don't want to emit this kind of logs (and I thought that's why we have the disable_log_stats as an argument)

@cadedaniel
Copy link
Collaborator Author

Hmm good point. Let me see if I can pipe down that argument.

@cadedaniel cadedaniel enabled auto-merge (squash) August 4, 2024 17:19
@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label Aug 4, 2024
@cadedaniel cadedaniel merged commit 82a1b1a into vllm-project:main Aug 5, 2024
51 checks passed
sfc-gh-mkeralapura pushed a commit to sfc-gh-mkeralapura/vllm that referenced this pull request Aug 12, 2024
kylesayrs pushed a commit to neuralmagic/vllm that referenced this pull request Aug 17, 2024
Alvant pushed a commit to compressa-ai/vllm that referenced this pull request Oct 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready ONLY add when PR is ready to merge/full CI is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants