Skip to content

[benchmark] Update seed argument handling in benchmark_serving.py#7356

Merged
EmmonsCurse merged 1 commit intodevelopfrom
ZhangYulongg-patch-1
Apr 13, 2026
Merged

[benchmark] Update seed argument handling in benchmark_serving.py#7356
EmmonsCurse merged 1 commit intodevelopfrom
ZhangYulongg-patch-1

Conversation

@ZhangYulongg
Copy link
Copy Markdown
Collaborator

默认不使用seed

Motivation

💡 If this PR is a Cherry Pick, the PR title needs to follow the format by adding the [Cherry-Pick] label at the very beginning and appending the original PR ID at the end. For example, [Cherry-Pick][CI] Add check trigger and logic(#5191)

💡 如若此PR是Cherry Pick,PR标题需遵循格式,在最开始加上[Cherry-Pick]标签,以及最后面加上原PR ID,例如[Cherry-Pick][CI] Add check trigger and logic(#5191)

Modifications

Usage or Command

Accuracy Tests

Checklist

  • Add at least a tag in the PR title.
    • Tag list: [[FDConfig],[APIServer],[Engine], [Scheduler], [PD Disaggregation], [Executor], [Graph Optimization], [Speculative Decoding], [RL], [Models], [Quantization], [Loader], [OP], [KVCache], [DataProcessor], [BugFix], [Docs], [CI], [Optimization], [Feature], [Benchmark], [Others], [XPU], [HPU], [GCU], [DCU], [Iluvatar], [Metax]]
    • You can add new tags based on the PR content, but the semantics must be clear.
  • Format your code, run pre-commit before commit.
  • Add unit tests. Please write the reason in this PR if no unit tests.
  • Provide accuracy results.
  • If the current PR is submitting to the release branch, make sure the PR has been submitted to the develop branch, then cherry-pick it to the release branch with the [Cherry-Pick] PR tag.

@paddle-bot
Copy link
Copy Markdown

paddle-bot bot commented Apr 13, 2026

Thanks for your contribution!

@EmmonsCurse
Copy link
Copy Markdown
Collaborator

/skip-ci all

Copy link
Copy Markdown
Collaborator

@EmmonsCurse EmmonsCurse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM~ Skip check for benchmark.

@EmmonsCurse EmmonsCurse merged commit 738c658 into develop Apr 13, 2026
35 of 37 checks passed
@EmmonsCurse EmmonsCurse deleted the ZhangYulongg-patch-1 branch April 13, 2026 08:05
Copy link
Copy Markdown

@PaddlePaddle-bot PaddlePaddle-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📋 Review 摘要

PR 概述:将 benchmark 的 --seed 参数默认值从 0 改为 None,使 benchmark 默认不固定随机种子。

变更范围:benchmarks/benchmark_serving.py

影响面 Tag[Benchmark]

📝 PR 规范检查

PR 描述使用了默认模板,未填写 Motivation 和 Modifications 部分。建议补充说明修改动机和具体变更内容。

标题建议(当前标题已符合规范,无需修改):

  • [benchmark] Update seed argument handling in benchmark_serving.py

描述模板(建议补充):

## Motivation

默认使用固定 seed 会导致每次 benchmark 运行结果完全相同,无法测试模型在不同输入下的真实性能波动。改为默认不使用 seed,使 benchmark 更贴近实际使用场景。

## Modifications

-`--seed` 参数默认值从 `0` 改为 `None`
- 只在 `args.seed is not None` 时设置全局 random seed

问题

级别 文件 概述
🟡 建议 benchmarks/benchmark_dataset.py:76 None seed 在 Dataset 内部仍被替换为 0

总体评价

变更逻辑正确,实现了让 benchmark 默认不固定随机种子的目标。但需注意 BenchmarkDataset 类内部会将 None seed 替换为 DEFAULT_SEED(0),因此 --shuffle 仍然是可重复的(seed=0)。如果需要完全不可重复,可能需要同时修改 BenchmarkDataset 的处理逻辑。当前实现对大多数场景已足够。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants