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

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
This commit is contained in:
Mark McLoughlin 2025-05-10 02:23:07 +01:00 committed by GitHub
parent 0c0fdae84f
commit 7042cc96b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -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):

View File

@ -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)