Skip to content

Commit

Permalink
[Misc] Refactor benchmark_throughput.py (vllm-project#9779)
Browse files Browse the repository at this point in the history
Signed-off-by: Linkun Chen <[email protected]>
Co-authored-by: Linkun Chen <[email protected]>
Co-authored-by: Linkun Chen <[email protected]>
  • Loading branch information
3 people committed Nov 4, 2024
1 parent b7fd939 commit 3daccc3
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions benchmarks/benchmark_throughput.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import random
import time
from typing import List, Optional
from typing import List, Optional

import torch
import uvloop
Expand All @@ -22,6 +23,23 @@
from vllm.utils import FlexibleArgumentParser, merge_async_iterators


@dataclasses.dataclass
class SampleRequest:
"""A class representing a single inference request for benchmarking.
Attributes:
prompt: The input text prompt for the model.
multi_modal_data: Optional dictionary containing multi-modal data (e.g.
images).
prompt_len: The length of the prompt in tokens.
expected_output_len: The expected length of the output in tokens.
"""
prompt: str
prompt_len: int
expected_output_len: int
multi_modal_data: Optional[MultiModalDataDict] = None


@dataclasses.dataclass
class SampleRequest:
"""A class representing a single inference request for benchmarking.
Expand Down

0 comments on commit 3daccc3

Please sign in to comment.