Skip to content

Ensure metrics are logged regardless of requests#2347

Merged
simon-mo merged 1 commit intovllm-project:mainfrom
deepinfra:fix-metrics
Jan 5, 2024
Merged

Ensure metrics are logged regardless of requests#2347
simon-mo merged 1 commit intovllm-project:mainfrom
deepinfra:fix-metrics

Conversation

@ichernev
Copy link
Copy Markdown
Contributor

@ichernev ichernev commented Jan 4, 2024

Metrics are currently logged at the end of each step, but if there are no requests there are no new logs/metrics, so the last values are reported to prometheus indefinitely.

Also, for some reason, it always reports one running request.

@simon-mo simon-mo self-assigned this Jan 4, 2024
@simon-mo
Copy link
Copy Markdown
Collaborator

simon-mo commented Jan 4, 2024

nice catch! although a better UX would be to reset it just once so vLLM won't be spamming the same log message telling idle status every 10s. i'm having trouble coming up with a clean way to do it though.

@ichernev
Copy link
Copy Markdown
Contributor Author

ichernev commented Jan 4, 2024

If you have the instance running in kubernetes, every 15s it queries the /metrics and prints in the logs. If you really want to avoid the vllm log part (where it logs zeros over and over), I can add some ifs. I think it's not needed, let me know.

@ichernev ichernev marked this pull request as draft January 4, 2024 19:42
@ichernev
Copy link
Copy Markdown
Contributor Author

ichernev commented Jan 4, 2024

@simon-mo I'm a bit confused about the ray/remote logic. Should I call the do_log_stats via self.engine.do_log_stats.remote(), or there is something I'm missing.

Metrics are currently logged at the end of each step, but if there are
no requests there are no new logs/metrics, so the last values are
reported to prometheus indefinitely.

Also, for some reason, it always reports one running request.
@ichernev ichernev marked this pull request as ready for review January 4, 2024 21:11
Comment on lines +511 to +512
if self.engine_use_ray:
await self.engine.do_log_stats.remote()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yeah this is right.

@simon-mo simon-mo merged commit d0215a5 into vllm-project:main Jan 5, 2024
@simon-mo
Copy link
Copy Markdown
Collaborator

simon-mo commented Jan 5, 2024

@ichernev thanks again. I think the current state is fine, therefore, merged. We can revisit this if people find the logs too spammy.

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.

2 participants