Skip to content

benchmarks: move adaptive prefill calibration to Examples - #1018

Open
SuperGoodGame wants to merge 4 commits into
deepspeedai:masterfrom
SuperGoodGame:benchmarks/adaptive-prefill-calibration
Open

SuperGoodGame wants to merge 4 commits into
deepspeedai:masterfrom
SuperGoodGame:benchmarks/adaptive-prefill-calibration

Conversation

@SuperGoodGame

@SuperGoodGame SuperGoodGame commented Oct 10, 2026 •

Copy link
Copy Markdown

Adds adaptive prefill calibration and evaluation tooling alongside the existing rollout benchmark in benchmarks/opsd. Requires Transformers >=4.56 and DeepSpeed PR #8786; the README explains configuration loading, the short-context calibration range and deployment validation.

Calibration derives ordinary MHA KV heads from query heads when the dedicated field is absent. The CLI requires a complete metadata object for supplied calibration files; cost-only artifacts are rejected, while applications can still pass hand-tuned coefficients directly to the rollout configuration. Saved configurations are checked against the model/device/library metadata and a combined source hash of rollout, bucket planning and static-cache implementations; stale or missing hashes require recalibration.

Validation: three regression tests pass, covering non-negative fitting, real tiny-OPT calibration on a GPU, and CLI acceptance/rejection of matching, changed, missing and cache-only-changed source hashes. Six targeted GPU oracle checks in the DeepSpeed companion validate OPT/Qwen generation through the static cache. Python lint and diff checks pass. The original seeded tiny-Qwen2 calibration/sweep smoke check also completed all four workloads with matching output IDs on every path.

Signed-off-by: SuperGoodGame <985236470@qq.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-10T18:16:09.060263Z 3fd685f New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dcdde0bf7f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread benchmarks/opsd/rollout_prefill.py Outdated
Comment thread benchmarks/opsd/rollout_prefill.py Outdated
Signed-off-by: SuperGoodGame <985236470@qq.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 79b2140eaf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread benchmarks/opsd/rollout_prefill.py
Comment thread benchmarks/opsd/rollout_prefill.py
Signed-off-by: SuperGoodGame <985236470@qq.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: beb3401dce

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread benchmarks/opsd/rollout_prefill.py
Signed-off-by: SuperGoodGame <985236470@qq.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3fd685fc55

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

'allow_tf32', 'source_sha256'):
if calibration['metadata'].get(key) != metadata[key]:
parser.error(f'calibration differs in {key}; recalibrate for this configuration')
costs = calibration.get('costs', {})

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject incomplete saved cost maps

When --cost-config points to an otherwise matching calibration artifact whose costs member is absent or has lost one of the five emitted coefficients, this fallback silently supplies HybridEngineRolloutConfig defaults for the missing values and the sweep completes with current metadata as though the calibrated policy was evaluated. Since --calibrate always emits the complete map (and hand-tuned partial configurations are documented for direct application use), validate the required cost keys before running the sweep.

Useful? React with 👍 / 👎.

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.

1 participant