@@ -145,15 +145,21 @@ python benchmarks/benchmark_mtp.py \
145145--dataset-path:测试数据集路径
146146```
147147
148- ### 指定输入输出长度,构造随机纯文输入测试
148+ ### 指定输入输出长度测试
149149
150- 相关参数:
151- - --dataset-name:指定数据集类,指定为"random"可构造随机纯文输入
152- - --random-input-len:随机输入长度,对应英文单词数,默认200
153- - --random-output-len:随机输出长度,默认1024
154- - --random-range-ratio:输入输出长度变化范围比,[ length * (1 - range_ratio), length* (1 + range_ratio)] ,默认0.1
150+ 支持两种随机构造输入的方式:
151+ - ` random ` :构造随机英文单词拼接的纯文输入
152+ - ` random_token_ids ` :直接构造随机 token id 序列作为输入(通过 prompt_token_ids 请求,不依赖英文单词表,长度控制更精确,也可覆盖非英文 token 场景)
155153
156- #### 使用方式:
154+ 相关参数:
155+ - --dataset-name:指定数据集类
156+ - ` random ` :随机英文单词拼接的纯文输入
157+ - ` random_token_ids ` :随机 token id 序列输入
158+ - --random-input-len:随机输入长度。` random ` 时对应英文单词数,` random_token_ids ` 时对应 token 数,默认 200
159+ - --random-output-len:随机输出长度,默认 1024
160+ - --random-range-ratio:输入输出长度变化范围比,[ length * (1 - range_ratio), length* (1 + range_ratio)] ,默认 0.1
161+
162+ #### 使用方式(随机英文单词输入):
157163``` bash
158164python benchmark_serving.py \
159165 --backend openai-chat \
@@ -171,3 +177,23 @@ python benchmark_serving.py \
171177 --max-concurrency 100 \
172178 --save-result > infer_log.txt 2>&1 &
173179```
180+
181+ #### 使用方式(随机 token id 输入):
182+ 将 ` --dataset-name ` 改为 ` random_token_ids ` 即可,` --random-input-len ` 语义变为 token 数:
183+ ``` bash
184+ python benchmark_serving.py \
185+ --backend openai-chat \
186+ --model EB45T \
187+ --endpoint /v1/chat/completions \
188+ --host 0.0.0.0 \
189+ --port 9812 \
190+ --dataset-name random_token_ids \
191+ --random-input-len 200 \
192+ --random-output-len 1024 \
193+ --random-range-ratio 0.1 \
194+ --percentile-metrics ttft,tpot,itl,e2el,s_ttft,s_itl,s_e2el,s_decode,input_len,s_input_len,output_len \
195+ --metric-percentiles 80,95,99,99.9,99.95,99.99 \
196+ --num-prompts 2000 \
197+ --max-concurrency 100 \
198+ --save-result > infer_log.txt 2>&1 &
199+ ```
0 commit comments