-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
[Misc] Add more scoping for improved trace #28329
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces profiling scopes using record_function_or_nullcontext in key areas of the scheduler and engine core. This will help in identifying performance hotspots and analyzing cycle-heavy areas. The changes are well-targeted and correctly placed. I've found a minor typo in one of the scope names, which I've commented on. Otherwise, the changes look good.
vllm/v1/engine/llm_engine.py
Outdated
| with record_function_or_nullcontext("LLM_ENGINE STEP:: RECORD_STATS"): | ||
| if self.logger_manager is not None and outputs.scheduler_stats is not None: | ||
| self.logger_manager.record( | ||
| scheduler_stats=outputs.scheduler_stats, | ||
| iteration_stats=iteration_stats, | ||
| mm_cache_stats=self.processor.stat_mm_cache(), | ||
| ) | ||
| self.do_log_stats_with_interval() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There appears to be a typo in the profiler scope name. It uses a double colon (::) which is inconsistent with the other scopes in this file that use a single colon. For consistency and to ensure easier parsing of traces, this should be corrected to LLM_ENGINE STEP: RECORD_STATS.
| with record_function_or_nullcontext("LLM_ENGINE STEP:: RECORD_STATS"): | |
| if self.logger_manager is not None and outputs.scheduler_stats is not None: | |
| self.logger_manager.record( | |
| scheduler_stats=outputs.scheduler_stats, | |
| iteration_stats=iteration_stats, | |
| mm_cache_stats=self.processor.stat_mm_cache(), | |
| ) | |
| self.do_log_stats_with_interval() | |
| with record_function_or_nullcontext("LLM_ENGINE STEP: RECORD_STATS"): | |
| if self.logger_manager is not None and outputs.scheduler_stats is not None: | |
| self.logger_manager.record( | |
| scheduler_stats=outputs.scheduler_stats, | |
| iteration_stats=iteration_stats, | |
| mm_cache_stats=self.processor.stat_mm_cache(), | |
| ) | |
| self.do_log_stats_with_interval() |
Summary: Add more scoping in the hotspot area which can greatly help us to the find the cycle heavy area Reviewed By: henryoier Differential Revision: D86436375
eaacf3b to
bef857a
Compare
Summary: Add more scoping in the hotspot area which can greatly help us to the find the cycle heavy area Reviewed By: henryoier Differential Revision: D86436375
bef857a to
462ae02
Compare
Summary: Add more scoping in the hotspot area which can greatly help us to the find the cycle heavy area Reviewed By: henryoier Differential Revision: D86436375
462ae02 to
ed91441
Compare
Summary: Add more scoping in the hotspot area which can greatly help us to the find the cycle heavy area Reviewed By: henryoier Differential Revision: D86436375
ed91441 to
2c55e43
Compare
|
nit: can we try to unify the text format? we have all lower, all upper, first letter capitalized in three different layers |
l prefer to use all lower case which saves the space visually. |
Summary: Add more scoping in the hotspot area which can greatly help us to the find the cycle heavy area Reviewed By: henryoier Differential Revision: D86436375
2c55e43 to
f5f5b8b
Compare
Summary: Add more scoping in the hotspot area which can greatly help us to the find the cycle heavy area
Differential Revision: D86436375