This release is a pre-release and may not be stable for production use.
dai-bench
=======
dai-bench 项目结构
如何运行
uv pip install -e .
由于依赖的 llm-d/llm-d-benchmark 没有Python包,采用的
config-explorer @ git+https://github.com/llm-d/llm-d-benchmark.git@v0.4.0#subdirectory=config_explorer的方式声明的依赖,如果由于网络原因卡在这里可以尝试使用 git clone https://github.com/llm-d/llm-d-benchmark.git 后运行 pip install -e ./config_explorer 安装
创建项目和运行实验
dai-bench setup --name test1
cd test1
dai-bench run --experiment 1
在 Kubernetes 上运行
本仓库内置了一个最小可用的 K8S 部署示例,使用 deploy/common 目录下的清单即可在集群中直接运行基准测试。
1. 准备依赖
- PVC:
deploy/common/deployment.yaml中默认使用名为dai-bench-common-pvc的 PVC 作为输出目录挂载点,需要提前创建:- 该 PVC 会挂载到容器内
/outputs,用于存储dai-bench生成的项目目录和结果。
- 该 PVC 会挂载到容器内
- 模型目录: 默认通过
hostPath挂载/gpfs/rd/models到容器内/models,需要根据实际环境调整:- 修改
deploy/common/deployment.yaml中:spec.template.spec.containers[0].volumeMounts[*].mountPath: /modelsspec.template.spec.volumes[*].hostPath.path: /gpfs/rd/models
- 确保模型目录内包含
Qwen3-0.6B或按需调整deploy/common/config.yaml中的server.model_name和tokenizer.path。
- 修改
2. 配置压测参数
deploy/common/config.yaml 定义了一个 ConfigMap,其中:
config.yaml:- 包含
project_name,用于在容器启动时自动创建项目目录(相当于执行dai-bench setup --name <project_name> --output-dir /outputs)。
- 包含
bench.yaml:- 定义负载(
load)、接口类型(api)、服务端信息(server)、tokenizer、数据源等。 - 启动时会被复制到
/outputs/<project_name>/experiments/01/treatment/bench.yaml。
- 定义负载(
如需调整压测参数,只需修改该文件中的 bench.yaml 部分并重新应用 ConfigMap:
kubectl apply -f deploy/common/config.yaml
3. 启动 benchmark 容器
部署 Deployment:
kubectl apply -f deploy/common/deployment.yaml
该 Deployment 中容器启动命令等价于:
dai-bench run \
--init \
--from-config /config/config.yaml \
--from-bench /config/bench.yaml \
--output-dir /outputs \
--experiment 01
其中:
--init --from-config会:- 读取
/config/config.yaml中的project_name; - 在
/outputs下创建对应项目目录结构; - 将
config.yaml覆盖到setup/config.yaml。
- 读取
--from-bench会:- 将
/config/bench.yaml复制到experiments/01/treatment/bench.yaml,覆盖默认配置。
- 将
4. 查看运行结果
压测完成后,结果会写入 PVC 对应的存储卷中,目录结构类似:
/outputs/
└── <project_name>
├── experiments/
├── results/
└── setup/
可以通过以下方式查看:
- 在节点上直接查看挂载路径(如果使用
hostPath)。 - 或通过临时 Pod 访问 PVC 内容,例如:
kubectl run -it --rm debug --image=busybox --restart=Never -- sh
# 挂载同一个 PVC 后在容器内查看 /outputs 下的数据
运行 llm-d-benchmark config explorer 可视化结果
# 安装 llm-d-benchmark 依赖
git clone https://github.com/llm-d/llm-d-benchmark.git
cd llm-d-benchmark
pip install -e ./config_explorer # 如果已经安装可以跳过
pip install -r config_explorer/requirements-streamlit.txt
streamlit run ./config_explorer/Capacity_Planner.py
输出目录结构
outputs/
└── test1
├── experiments
│ ├── 01
│ │ └── treatment
│ │ ├── bench.yaml
│ │ └── run.sh
│ └── 02
│ └── treatment
│ ├── bench.yaml
│ └── run.sh
├── README.md
├── results
│ └── 01
│ └── Qwen_Qwen3-0.6B
│ └── data
│ ├── stage1-c1_2-i100-o100
│ │ ├── benchmark_report,_infqps-concurrency1-20251216-185633.json.yaml
│ │ ├── benchmark_report,_infqps-concurrency2-20251216-185658.json.yaml
│ │ ├── infqps-concurrency1-20251216-185633.json
│ │ └── infqps-concurrency2-20251216-185658.json
│ └── stage2-c1_2-i1000-o100
│ ├── benchmark_report,_infqps-concurrency1-20251216-185705.json.yaml
│ ├── benchmark_report,_infqps-concurrency2-20251216-185715.json.yaml
│ ├── infqps-concurrency1-20251216-185705.json
│ └── infqps-concurrency2-20251216-185715.json
└── setup
├── config.yaml
└── metadata.json
Metadata
Release files for dai-bench 0.3.0rc0.post0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dai_bench-0.3.0rc0.post0.tar.gz | 1.4 MB | Without provenance | Details for dai_bench-0.3.0rc0.post0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dai_bench-0.3.0rc0.post0-py3-none-any.whl | Python 3 | none | any | Details for dai_bench-0.3.0rc0.post0-py3-none-any.whl |
Total release size: 1.5 MB
Release files / dai_bench-0.3.0rc0.post0.tar.gz
| Download URL | dai_bench-0.3.0rc0.post0.tar.gz |
|---|---|
| Size | 1.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2f8c69f0e8879daada4aaee979ff05c90b941b403241daa4b39b8ad39aa1e230
|
|
BLAKE2b-256 checksum How to use checksums |
5c724c7902cd1c75d4c16954bd0a468f13415a26c546bd04c56c01b620765e23
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.2
|
Release files / dai_bench-0.3.0rc0.post0-py3-none-any.whl
| Download URL | dai_bench-0.3.0rc0.post0-py3-none-any.whl |
|---|---|
| Size | 144.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
599fb666f49711d6d462a18d68a82de9940896b579efe7aec33211bc19dbdd30
|
|
BLAKE2b-256 checksum How to use checksums |
effeb9e974f048ef7e4825c67891ddc6bd0c06e4d99762ebef610169c7b91abf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.12
|
Security for dai-bench 0.3.0rc0.post0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.