o
    áÙ·i¯	  ã                   @   s@   d dl Z d dlmZ d dlmZ d dlmZ G dd„ deƒZdS )é    N)Úadd_cli_args©Úmain)ÚOmniBenchmarkSubcommandBasec                   @   sH   e Zd ZdZdZdZedejddfdd„ƒZ	e
d	ejddfd
d„ƒZdS )ÚOmniBenchmarkServingSubcommandz&The `serve` subcommand for vllm bench.Úservez(Benchmark the online serving throughput.ÚparserÚreturnNc                 C   sH   t |ƒ |jD ]}|jdkrd|_|jdkrd|_|jdkr!d|_qd S )NÚpercentile_metricszÌComma-separated list of selected metrics to report percentiles.This argument specifies the metrics to report percentiles.Allowed metric names are "ttft", "tpot", "itl", "e2el", "audio_ttfp", "audio_rtf". Úrandom_mm_limit_mm_per_prompta  Per-modality hard caps for items attached per request, e.g. '{"image": 3, "video": 0, "audio": 1}'. The sampled per-request item count is clamped to the sum of these limits. When a modality reaches its cap, its buckets are excluded and probabilities are renormalized.Úrandom_mm_bucket_configa[  The bucket config is a dictionary mapping a multimodal itemsampling configuration to a probability.Currently allows for 3 modalities: audio, images and videos. A bucket key is a tuple of (height, width, num_frames)The value is the probability of sampling that specific item. Example: --random-mm-bucket-config {(256, 256, 1): 0.5, (720, 1280, 16): 0.4, (0, 1, 5): 0.10} First item: images with resolution 256x256 w.p. 0.5Second item: videos with resolution 720x1280 and 16 frames Third item: audios with 1s duration and 5 channels w.p. 0.1OBS.: If the probabilities do not sum to 1, they are normalized.)r   Ú_actionsÚdestÚhelp)Úclsr   Úaction© r   ú]/home/ubuntu/.local/lib/python3.10/site-packages/vllm_omni/entrypoints/cli/benchmark/serve.pyr      s   

ÿ
ÿ
ÿ€ðz+OmniBenchmarkServingSubcommand.add_cli_argsÚargsc                 C   s   t | ƒ d S )Nr   )r   r   r   r   Úcmd1   s   z"OmniBenchmarkServingSubcommand.cmd)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Únamer   ÚclassmethodÚargparseÚArgumentParserr   ÚstaticmethodÚ	Namespacer   r   r   r   r   r   	   s    !r   )r   Úvllm.benchmarks.server   Úvllm_omni.benchmarks.server   Ú(vllm_omni.entrypoints.cli.benchmark.baser   r   r   r   r   r   Ú<module>   s
    