Skip to content

[tuner] Reject zero timing measurements - #6941

Merged
yzhou103 merged 4 commits into
ROCm:mainfrom
yzhou103:fix/reject-zero-timing
Nov 9, 2026
Merged

yzhou103 merged 4 commits into
ROCm:mainfrom
yzhou103:fix/reject-zero-timing

Conversation

@yzhou103

Copy link
Copy Markdown
Contributor

Treat repeated zero-latency measurements as failures and prevent non-positive or non-finite timings from being selected or written to tuning configs. Add worker, post-processing, and config-writing regression coverage.

Motivation

Technical Details

Test Plan

Test Result

Submission Checklist

@yzhou103
yzhou103 requested review from a team and a balanced review from Copilot October 26, 2026 08:13
@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter op tests (gfx942 + gfx950)
  • ✅ Triton tests on MI35X (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:gfx1250-ffm-triton Run the five-shard gfx1250 FFM Triton test suite
ci:triton-300x Run an additional Triton test job on MI300X in PRs (added automatically when gfx942 configs change); main branch always runs both MI35X and MI300X
ci:triton-355 Run the full Triton test suite on MI35X, not only the tests the change affects
ci:windows Windows JIT op smoke test on the gfx1201 ROCm runner
ci:multi-gpu Aiter multi-GPU tests on the 8-GPU runner
ci:sglang SGLang integration tests: DeepSeek-R1-MXFP4 accuracy, Qwen 3.5 accuracy
ci:atom ATOM benchmark: DeepSeek-R1-0528, GPT-OSS-120B
ci:atom_full ATOM accuracy suite for PR and main models from ATOM models_accuracy.json
ci:vllm vLLM benchmark: DeepSeek-V4-Pro, MiniMax-M3-MXFP4
ci:all All standard extended tests (excludes ci:atom_full)

Only add ci:atom_full for FlyDSL or Triton upgrades.
Add labels via the sidebar or gh pr edit 6941 --add-label <label>

One backend per PR:
A PR changes one kernel backend: [Triton/Gluon] (Triton and Gluon count as one), [HIP], [ASM], [CK], [OPUS] or [FlyDSL]. If the title ends up with two backend tags, split the PR -- as stacked pull requests when one part cannot merge without the other.

PR title tags & labels:
Component tags ([Triton/Gluon], [HIP], [CK], [ASM], ...) are added to the PR title and as PR labels automatically from the changed files and re-synced on every push — change-type tags like [fix]/[Perf], op tags like [MLA], and human labels (ci:*) are left untouched. Add the no-auto-title label to stop the title rewrites; labels stay in sync either way.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused timing guards and regression tests have no unresolved issues identified by static review.

No open issues 🎉

What changed in this PR

This PR strengthens aiter’s tuning pipeline so invalid latency measurements cannot win candidate selection or overwrite tuning configurations.

Changes:

  • Mark repeated zero-time worker measurements as failures.
  • Reject non-positive and non-finite timings during result processing and config writing.
  • Add regression coverage for worker failures, invalid-result filtering, and preserving existing configurations.
File Description
op_tests/​tuning_tests/​test_tuner_infra.py Tests invalid timing filtering, failed fallback results, and config preservation.
op_tests/​tuning_tests/​test_mp_tuner_logic.py Tests failure reporting after repeated zero measurements.
aiter/​utility/​mp_tuner.py Marks zero timings as failed after retries are exhausted.
aiter/​utility/​base_tuner.py Filters invalid timings from selection, metric calculations, and config updates.

Review effort: Balanced

Treat repeated zero-latency measurements as failures and prevent non-positive or non-finite timings from being selected or written to tuning configs. Add worker, post-processing, and config-writing regression coverage.

Co-authored-by: Cursor <[email protected]>
@yzhou103
yzhou103 force-pushed the fix/reject-zero-timing branch from e773d37 to 8afa106 Compare October 26, 2026 08:29
Copilot AI balanced review requested due to automatic review settings October 26, 2026 08:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

A targeted check confirmed that NaN timings can disrupt sorting before filtering and cause selection of a slower valid kernel.

1 open issue

Review effort: Balanced

Comment thread aiter/utility/base_tuner.py Resolved
Copilot AI balanced review requested due to automatic review settings November 5, 2026 07:10
@aiter-bot

aiter-bot commented Nov 5, 2026 •

Copy link
Copy Markdown

WAITING ON AUTHOR

PR Self-Review

Revision 694bee3de3f1 · mode shadow

Waiting for the PR author. The readiness report will appear after the self-review answers are complete for this revision.

Questions to answer in the PR description

  1. What behavior does this PR change, and why is the existing behavior insufficient?
  2. What did you validate, and what remains unverified? Include commands, hardware/configuration and results.
  3. What behavior would each changed op test fail on before this PR, and why is that coverage not already provided by an existing canonical test?
  4. For every changed op_tests/ file, what behavior does it cover and why is it not redundant? Write None if no op test changed.

Edit the PR Self-Review section in the PR description. Include the current revision SHA; this comment refreshes automatically.

Missing or invalid answers

  • FAIL — missing ### Reviewed revision in the PR description
  • FAIL — missing ### Behavior and intent in the PR description
  • FAIL — missing ### Validation and unverified scope in the PR description
  • FAIL — missing ### PR-specific question in the PR description
  • FAIL — missing ### Changed op tests in the PR description
  • FAIL — Reviewed revision must contain at least the first 7 characters of the current head SHA
  • FAIL — Behavior and intent has no substantive answer
  • FAIL — Validation and unverified scope has no substantive answer
  • FAIL — PR-specific question has no substantive answer
  • FAIL — changed op test not explained in Changed op tests: op_tests/tuning_tests/test_mp_tuner_logic.py
  • FAIL — changed op test not explained in Changed op tests: op_tests/tuning_tests/test_tuner_infra.py
  • FAIL — Changed op tests must explain why each changed op test is necessary and non-redundant

Shadow mode reports what would block but keeps the status successful. Set AITER_PR_SELF_REVIEW_MODE=enforce only after reviewing real false positives.

@yzhou103

yzhou103 commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

@zoe-cop review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain for the tuning-pipeline changes intended to prevent invalid latency measurements from being selected or saved.

1 open issue

Review effort: Balanced

Comment thread aiter/utility/base_tuner.py Resolved
A NaN timing makes every comparison False, so sorting the candidate list
before dropping invalid entries left it out of order: with [8.0, nan, 5.0]
and topk=1 the 8.0us kernel was selected instead of 5.0us. Filter first,
then sort the valid candidates. Add a regression test with a NaN between
valid timings.
Copilot AI balanced review requested due to automatic review settings November 9, 2026 03:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

There are no active review issues for the tuning-pipeline changes intended to prevent invalid latency measurements from affecting selected configurations or existing results.

1 open issue

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 9, 2026 06:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues block the tuning safeguards intended to prevent invalid latency measurements from affecting configuration selection or updates.

1 open issue

Review effort: Balanced

@demonsan demonsan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@yzhou103
yzhou103 merged commit 627eb77 into ROCm:main Nov 9, 2026
ruanjm pushed a commit that referenced this pull request Nov 10, 2026
* [tuner] Reject zero timing measurements

Treat repeated zero-latency measurements as failures and prevent non-positive or non-finite timings from being selected or written to tuning configs. Add worker, post-processing, and config-writing regression coverage.

Co-authored-by: Cursor <[email protected]>

* [tuner] Filter invalid timings before sorting candidates

A NaN timing makes every comparison False, so sorting the candidate list
before dropping invalid entries left it out of order: with [8.0, nan, 5.0]
and topk=1 the 8.0us kernel was selected instead of 5.0us. Filter first,
then sort the valid candidates. Add a regression test with a NaN between
valid timings.

---------

Co-authored-by: Ying Zhou <[email protected]>
Co-authored-by: Cursor <[email protected]>
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.

5 participants