Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wangsen
mlcommon_inference
Commits
8e1a3267
Commit
8e1a3267
authored
Jan 09, 2026
by
root
Browse files
change bert99.md
parent
999835ed
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
12 deletions
+54
-12
README_BERT99.md
README_BERT99.md
+54
-12
No files found.
README_BERT99.md
View file @
8e1a3267
...
@@ -99,16 +99,66 @@ ln -sf /root/MLC/repos/local/cache/download-file_bert-get-datase_8f14db6c/vocab.
...
@@ -99,16 +99,66 @@ ln -sf /root/MLC/repos/local/cache/download-file_bert-get-datase_8f14db6c/vocab.
---
---
## 5. 执行推理测试
## 5. 执行推理测试
---
运行精度模式下的
`SingleStream`
场景测试:
### 5.1.测试命令
```
bash
# 启动推理测试 (预览模式: 100个样本)
|目标指标 | 场景 | 测试命令 |
python3 run.py
--backend
tf
--scenario
SingleStream
--accuracy
--max_examples
100
| --- | --- |--- |
|最大吞吐量|
**Offline**
|
`python3 run.py --backend tf --scenario Offline`
|
|最低延时|
**SingleStream**
|
`python3 run.py --backend tf --scenario SingleStream`
|
|最大并发流|
**MultiStream**
|
`python3 run.py --backend tf --scenario MultiStream`
|
|20ms约束QPS|
**Server**
|
`python3 run.py --backend tf --scenario Server(需配合 user.conf)`
|
---
### 5.2. 如何设置“P99 20ms”和“目标QPS”?
要实现你要求的特定约束(如 Server 场景下 P99 < 20ms),你需要修改或创建一个
`user.conf`
文件。
**操作步骤:**
1.
在
`inference/language/bert`
目录下查找或新建一个名为
`user.conf`
的文件。
2.
在文件中添加以下内容(根据你的需求自定义数值):
```
ini
# 设置 Server 场景的目标 QPS 和延迟约束
bert.Server.target_qps
=
100
bert.Server.target_latency
=
20
# 设置 Offline 场景的目标吞吐量
bert.Offline.target_qps
=
1000
# 设置 MultiStream 的延迟约束
bert.MultiStream.target_latency
=
50
```
```
3.
**运行命令时指定配置文件:**
使用
`--user_conf`
参数加载该配置:
```
bash
python3 run.py
--backend
tf
--scenario
Server
--user_conf
user.conf
```
---
### 5.3. 如何找到最终的性能指标?
运行成功后,请忽略图片 1 中显示的“No warnings/errors”,直接抓取
`mlperf_log_summary.txt`
中的数据:
*
**最大吞吐量 (Offline):**
查找
`Samples per second`
。
*
**最低延时 (SingleStream):**
查找
`Mean latency`
或
`90.00% percentile latency`
。
*
**P99 20ms 下的吞吐量 (Server):**
1. 首先确认
`Result is : VALID`
(表示 99% 的请求都在你设定的 20ms 内完成了)。
2.
查找
`Scheduled samples per second`
,这就是该约束下的最大吞吐量。
*
**最大并发流数 (MultiStream):**
查找
`Samples per query`
。
### 参数说明:
### 参数说明:
*
`--backend tf`
: 指定使用 TensorFlow 后端。
*
`--backend tf`
: 指定使用 TensorFlow 后端。
...
@@ -118,12 +168,4 @@ python3 run.py --backend tf --scenario SingleStream --accuracy --max_examples 10
...
@@ -118,12 +168,4 @@ python3 run.py --backend tf --scenario SingleStream --accuracy --max_examples 10
---
---
## 6. 预期结果
测试完成后,结果将保存于
`build/result/`
。
*
**精度验证**
:通过
`accuracy-squad.py`
检查 F1 分数是否达标。
*
**性能验证**
:查看
`mlperf_log_summary.txt`
获取 Latency(延迟)和 QPS(吞吐量)数据。
---
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment