[Metrics] Count finished requests by watermark status (#58715)
Signed-off-by: Simon Veitner <sveitner@redhat.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Lucas Wilkinson <LucasWilkinson@users.noreply.github.com>
This commit is contained in:
co-authored by
Claude
Lucas Wilkinson
parent
45bb710eca
commit
a7b7bc1fbe
@@ -277,6 +277,12 @@ class RequestStateStats:
|
||||
# Track if this request is corrupted (NaNs in logits)
|
||||
is_corrupted: bool = False
|
||||
|
||||
# Track if this request was sampled with the engine watermark
|
||||
is_watermarked: bool = False
|
||||
|
||||
# Track if this request asked for the watermark but could not use it
|
||||
is_watermark_skipped: bool = False
|
||||
|
||||
|
||||
@dataclass
|
||||
class FinishedRequestStats:
|
||||
@@ -479,6 +485,9 @@ class IterationStats:
|
||||
self.time_to_first_tokens_iter: list[float] = []
|
||||
self.inter_token_latencies_iter: list[float] = []
|
||||
self.num_corrupted_reqs: int = 0
|
||||
self.num_watermarked_reqs: int = 0
|
||||
self.num_watermark_skipped_reqs: int = 0
|
||||
self.num_not_watermarked_reqs: int = 0
|
||||
|
||||
def __repr__(self) -> str:
|
||||
field_to_value_str = ", ".join(f"{k}={v}" for k, v in vars(self).items())
|
||||
@@ -624,6 +633,13 @@ class IterationStats:
|
||||
if req_stats.is_corrupted:
|
||||
self.num_corrupted_reqs += 1
|
||||
|
||||
if req_stats.is_watermarked:
|
||||
self.num_watermarked_reqs += 1
|
||||
elif req_stats.is_watermark_skipped:
|
||||
self.num_watermark_skipped_reqs += 1
|
||||
else:
|
||||
self.num_not_watermarked_reqs += 1
|
||||
|
||||
|
||||
class LoRAStats:
|
||||
"""Tracks waiting and running request IDs for a single LoRA."""
|
||||
|
||||
Reference in New Issue
Block a user