Skip to content

[JIT] Name dedup key and env var in tuned-config duplicate error - #6307

Merged
zufayu merged 1 commit into
ROCm:mainfrom
yzhou103:fix/5184-config-dup-message
Oct 10, 2026
Merged

zufayu merged 1 commit into
ROCm:mainfrom
yzhou103:fix/5184-config-dup-message

Conversation

@yzhou103

@yzhou103 yzhou103 commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

When update_config_files finds duplicate shapes across merged tuned CSVs, the error now states the dedup key and the AITER_CONFIG_* env var that selects tables explicitly. "Please re-run" only holds in a source checkout; in an installed package or container the rewritten files do not persist, so users kept hitting the same error (#5184).

get_config_file passes env_name through to update_config_files; the MXFP8 config subclass forwards it. The raise and dedup behavior are unchanged, so main stays free of duplicate configs.

Motivation

Technical Details

Test Plan

Test Result

Submission Checklist

When update_config_files finds duplicate shapes across merged tuned CSVs,
the error now states the dedup key and the AITER_CONFIG_* env var that
selects tables explicitly. "Please re-run" only holds in a source
checkout; in an installed package or container the rewritten files do not
persist, so users kept hitting the same error (ROCm#5184).

get_config_file passes env_name through to update_config_files; the
MXFP8 config subclass forwards it. The raise and dedup behavior are
unchanged, so main stays free of duplicate configs.

Co-authored-by: Cursor <[email protected]>
@yzhou103
yzhou103 requested review from a team and a balanced review from Copilot October 9, 2026 09:51
@github-actions

github-actions Bot commented Oct 9, 2026

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: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: GPT-OSS-120B, DeepSeek-R1-0528, Kimi-K2.5
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 6307 --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.

@github-actions github-actions Bot changed the title [Config] Name dedup key and env var in tuned-config duplicate error [JIT] Name dedup key and env var in tuned-config duplicate error Oct 9, 2026
@github-actions github-actions Bot added the JIT label Oct 9, 2026

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 diagnostic change is consistently propagated and covered by an appropriate regression test.

0 open findings

What changed in this PR

Improves duplicate tuned-config errors by identifying the deduplication key and relevant configuration environment variable.

Changes:

  • Threads the environment-variable name through config merging.
  • Clarifies behavior for source checkouts versus installed/container environments.
  • Adds regression coverage for the enhanced error details.
File Description
aiter/​jit/​core.py Adds actionable duplicate-config diagnostics.
aiter/​ops/​mxfp8fp4gemm_common.py Forwards the environment-variable name.
op_tests/​tuning_tests/​test_config_shape_collision.py Verifies key and environment-variable reporting.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@zufayu
zufayu self-requested a review October 10, 2026 01:39
@zufayu zufayu self-assigned this Oct 10, 2026
@zufayu
zufayu merged commit 922e4a7 into ROCm:main Oct 10, 2026
yzhou103 added a commit to yzhou103/aiter that referenced this pull request Oct 10, 2026
The dedup write-back runs before the RuntimeError that reports the
duplicates, so a source that cannot be written replaces that diagnostic
with a bare PermissionError. That drops the dedup key and the
AITER_CONFIG_* hint precisely in a read-only install or container, which
is the environment those were added for (ROCm#6307, ROCm#5184), and
abandons any remaining source half-rewritten.

Catch OSError per source, collect the failures, and report them under
"Not updated" without counting them as updated. The resolution line now
says not every file could be rewritten when that happened, so the message
cannot claim a write that did not land.

This affected merges before and now also affects lone config files, since
those reach the same write-back.

Reported by Copilot review.

Signed-off-by: yzhou103 <[email protected]>
yzhou103 added a commit that referenced this pull request Oct 14, 2026
* [Config] Check single-file tuned configs for duplicate shapes

The duplicate-shape check only ran when a family had more than one table
to merge. Two short-circuits kept single-file families out of it
entirely: get_config_file returns the canonical CSV untouched when
model_configs/ has no sibling, and update_config_files returns early on
a one-element path list. A family that never grows a per-model table was
therefore never validated, and a lone CSV can still hold two rows with
the same key when a retune is appended instead of replacing the old row.

aiter/configs/tuned_grouped_fmoe.csv was in exactly that state: two rows
for gfx1250 token=512 model_dim=7168 inter_dim=3072 differing only in
tuning parameters. The row was removed in #6332, but the mechanism that
let it through was not, and test_grouped_fmoe stayed green throughout
because the resolution path it drives never reached the check.

Extract the check into _raise_on_duplicate_shapes and call it from both
paths, so the key derivation, the error text, and the keep-lowest-us
write-back stay in one place. env_name is threaded through, so the paths
reached for the first time still name the AITER_CONFIG_* variable.

Only the single-file duplicate case changes behavior: it is now reported
instead of silently accepted. Multi-file merges, and single files that
are clean, missing, header-only or unparseable, resolve as before.

_Mxfp8Config.update_config_files keeps its own single-path short-circuit;
that op validates individual rows in its loader, so its behavior does not
change.

Signed-off-by: yzhou103 <[email protected]>

* [Config] Cover the single-file path in the collision self-checks

The self-checks only drove the cross-file merge: _build_synthetic_family
always wrote a model_configs/ sibling, so the path where a family has no
sibling and resolves to its canonical CSV directly was never exercised.
That is the path that skipped the duplicate check, which is how
tuned_grouped_fmoe.csv kept a duplicate row (removed in #6332) while
every test here was green.

Removing the row makes test_grouped_fmoe green again without proving the
check runs, so add controls that do not depend on repository data:

- a duplicate planted in a lone CSV must be reported
- two distinct shapes in a lone CSV must not be
- an unparseable lone CSV must not raise out of get_config_file, since
  this path used to hand the file back unread and the parse error
  surfaced from the op's own loader

_build_synthetic_family takes with_model_file to choose the path and
canonical_raw for malformed input. _run_synthetic now catches Exception
rather than RuntimeError: pandas' ParserError is a ValueError, so the
malformed case has to be observable rather than escaping as a test error.

Verified by mutation: reverting the single-file check fails only the
first, and dropping the parse guard fails only the third.

Signed-off-by: yzhou103 <[email protected]>

* [Config] Keep the duplicate diagnostic when a source cannot be rewritten

The dedup write-back runs before the RuntimeError that reports the
duplicates, so a source that cannot be written replaces that diagnostic
with a bare PermissionError. That drops the dedup key and the
AITER_CONFIG_* hint precisely in a read-only install or container, which
is the environment those were added for (#6307, #5184), and
abandons any remaining source half-rewritten.

Catch OSError per source, collect the failures, and report them under
"Not updated" without counting them as updated. The resolution line now
says not every file could be rewritten when that happened, so the message
cannot claim a write that did not land.

This affected merges before and now also affects lone config files, since
those reach the same write-back.

Reported by Copilot review.

Signed-off-by: yzhou103 <[email protected]>

---------

Signed-off-by: yzhou103 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants