[Profiler] Add per-session profiling controls to Python and Rust frontends (#57875)

Signed-off-by: czhu <conway.zhu@cohere.com>
Signed-off-by: Conway Zhu <conway.zhu@cohere.com>
Co-authored-by: aoshen02 <aoshen@inferact.ai>
This commit is contained in:
czhu-cohere
2026-10-06 05:21:19 +00:00
committed by GitHub
co-authored by aoshen02
parent 9a1f6fd4cb
commit 6fddc9b21e
25 changed files with 1497 additions and 164 deletions
+13 -2
View File
@@ -810,8 +810,19 @@ class EngineCore:
cleanup_dist_env_and_memory()
logger.debug_once("[shutdown] EngineCore: local resource teardown complete")
def profile(self, is_start: bool = True, profile_prefix: str | None = None):
self.model_executor.profile(is_start, profile_prefix)
def profile(
self,
is_start: bool = True,
profile_prefix: str | None = None,
delay_iterations: int | None = None,
max_iterations: int | None = None,
):
self.model_executor.profile(
is_start,
profile_prefix,
delay_iterations=delay_iterations,
max_iterations=max_iterations,
)
def reset_mm_cache(self):
# NOTE: Since this is mainly for debugging, we don't attempt to