diff --git a/llm-api-benchmark/readme.md b/llm-api-benchmark/readme.md index 94aad9f..aff5fd5 100644 --- a/llm-api-benchmark/readme.md +++ b/llm-api-benchmark/readme.md @@ -55,8 +55,11 @@ pip install aiohttp pandas tiktoken matplotlib ``` -# 或者,不安装可选库: -# pip install aiohttp pandas +或者,不安装可选库: + +```bash +pip install aiohttp pandas +``` ## 配置 @@ -123,4 +126,20 @@ python benchmark_vllm.py \ * Token 计数的准确性依赖于 API 服务器在响应的 `usage` 字段中正确返回 `prompt_tokens` 和 `completion_tokens`。 * `min_tokens` 参数的有效性取决于目标 API 端点是否支持它。提示增强是作为一种备用策略。 -* 如果未安装 `tiktoken`,Token 计数将基于字符长度进行近似估算,这对于非英语文本或代码来说准确性较低。 \ No newline at end of file +* 如果未安装 `tiktoken`,Token 计数将基于字符长度进行近似估算,这对于非英语文本或代码来说准确性较低。 + +## 实例 + +使用下面的命令在 H200 HGX 平台上进行测试 + +```bash +python vllm_benchmark.py --token-lengths 10 100 500 1000 2000 5000 10000 20000 30000 --concurrency-levels 1 16 64 128 256 512 result +``` + +结果如下 + +![](src/avg_tokens_per_second_vs_concurrency.png) + +![](src/success_rate_vs_concurrency.png) + +![](total_tokens_per_second_vs_concurrency.png) \ No newline at end of file diff --git a/llm-api-benchmark/src/avg_tokens_per_second_vs_concurrency.png b/llm-api-benchmark/src/avg_tokens_per_second_vs_concurrency.png new file mode 100644 index 0000000..3986cc6 Binary files /dev/null and b/llm-api-benchmark/src/avg_tokens_per_second_vs_concurrency.png differ diff --git a/llm-api-benchmark/src/success_rate_vs_concurrency.png b/llm-api-benchmark/src/success_rate_vs_concurrency.png new file mode 100644 index 0000000..6420286 Binary files /dev/null and b/llm-api-benchmark/src/success_rate_vs_concurrency.png differ diff --git a/llm-api-benchmark/src/total_tokens_per_second_vs_concurrency.png b/llm-api-benchmark/src/total_tokens_per_second_vs_concurrency.png new file mode 100644 index 0000000..31988c7 Binary files /dev/null and b/llm-api-benchmark/src/total_tokens_per_second_vs_concurrency.png differ