Add spec_accept_histogram request statistic (#18332)

This commit is contained in:
Scott Lee
2026-02-12 21:09:21 +08:00
committed by GitHub
parent 0abe4a22c6
commit c59b9223e6
8 changed files with 54 additions and 8 deletions
+3 -3
View File
@@ -426,9 +426,9 @@ class EagleVerifyInput(SpecInput, EagleVerifyInputV2Mixin):
else:
unfinished_accept_index.append(accept_index[i])
req.spec_verify_ct += 1
req.spec_accepted_tokens += (
sum(1 for idx in accept_index_row if idx != -1) - 1
)
accepted_draft_tokens = sum(1 for idx in accept_index_row if idx != -1) - 1
req.spec_accepted_tokens += accepted_draft_tokens
req.update_spec_acceptance_histogram(accepted_draft_tokens)
if has_finished:
accept_length = (accept_index != -1).sum(dim=1) - 1
+3 -3
View File
@@ -188,9 +188,9 @@ class NgramVerifyInput(SpecInput):
)
raise e
req.spec_verify_ct += 1
req.spec_accepted_tokens += (
sum(1 for idx in accept_index_row if idx != -1) - 1
)
accepted_draft_tokens = sum(1 for idx in accept_index_row if idx != -1) - 1
req.spec_accepted_tokens += accepted_draft_tokens
req.update_spec_acceptance_histogram(accepted_draft_tokens)
if has_finished:
self.accept_length = (self.accepted_indices != -1).sum(dim=1) - 1