Unverified Commit 7042cc96 authored by Mark McLoughlin's avatar Mark McLoughlin Committed by GitHub
Browse files

[V1][Spec Decoding] Log accumulated metrics after system goes idle (#17913)


Signed-off-by: default avatarMark McLoughlin <markmc@redhat.com>
parent 0c0fdae8
...@@ -128,8 +128,6 @@ class LoggingStatLogger(StatLoggerBase): ...@@ -128,8 +128,6 @@ class LoggingStatLogger(StatLoggerBase):
scheduler_stats.gpu_cache_usage * 100, scheduler_stats.gpu_cache_usage * 100,
self.prefix_caching_metrics.hit_rate * 100, self.prefix_caching_metrics.hit_rate * 100,
) )
if scheduler_stats.spec_decoding_stats is not None:
self.spec_decoding_logging.log(log_fn=log_fn) self.spec_decoding_logging.log(log_fn=log_fn)
def log_engine_initialized(self): def log_engine_initialized(self):
......
...@@ -67,6 +67,8 @@ class SpecDecodingLogging: ...@@ -67,6 +67,8 @@ class SpecDecodingLogging:
spec_decoding_stats.num_accepted_tokens_per_pos) spec_decoding_stats.num_accepted_tokens_per_pos)
def log(self, log_fn=logger.info): def log(self, log_fn=logger.info):
if not self.num_drafts:
return
num_drafts = np.sum(self.num_drafts) num_drafts = np.sum(self.num_drafts)
num_draft_tokens = np.sum(self.num_draft_tokens) num_draft_tokens = np.sum(self.num_draft_tokens)
num_accepted_tokens = np.sum(self.num_accepted_tokens) num_accepted_tokens = np.sum(self.num_accepted_tokens)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment