Repository navigation
Conversation
The tuned-config merge keyed its duplicate-shape check on the raw _tag value. The key was added so a flydsl_fallback row can sit beside the live row for the same shape, but lookups skip only flydsl_fallback rows and serve every other row whatever its _tag, keeping the first per shape. Model tables now carry other labels (fused_expert, exact-m4096-a, ...), and the merge fills 0 into the rows of a table without the column, so two live rows for one shape passed the check and the runtime served whichever file the glob listed first. The key now compares _tag as fallback or live. The power-table conflict check groups the duplicate rows the same way: grouped by label, a power row and a latency row for one shape would be ranked against each other. Signed-off-by: Rony Leppänen <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: Reviews: |
There was a problem hiding this comment.
🟡 Changes recommended
Fallback-label normalization can delete the only live source row, and the changed power-conflict grouping lacks merge-level regression coverage.
2 open issues
What changed in this PR
This PR aligns tuned-config duplicate detection with lookup behavior: _tag distinguishes fallback rows from live rows, rather than separating every label.
Changes:
- Detects same-shape live-row collisions across different labels and applies the same grouping to power-conflict checks.
- Adds regression coverage for differently labeled live rows and fallback coexistence.
- Clarifies the merge-key documentation.
| File | Description |
|---|---|
op_tests/tuning_tests/test_config_shape_collision.py |
Adds live-versus-fallback merge cases. |
aiter/jit/core.py |
Groups duplicate shapes and power conflicts by fallback status. |
.claude/skills/aiter-config-shape/SKILL.md |
Documents how _tag participates in merge keys. |
Review effort: Balanced
…er-conflict grouping The merge's duplicate key took `_tag` as fallback or live after stripping the label, but get_cfg_2stages compares it exactly, so "flydsl_fallback " is a live row there. Stripped, an exact fallback row and a padded live row for one shape shared a key, and the auto-resolution kept the fallback row and deleted the live one from its source. The key now compares exactly. test_merge_keys_tag_as_live_or_fallback gains the padded label. A new merge-level test covers the power-conflict grouping: a power row and a latency row for one shape with different labels are refused and both sources stay as they are. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
READY FOR HUMAN REVIEWPR Self-ReviewRevision Author self-review accepted. Readiness report: Author answers
Show the author's self-review answersBehavior and intentValidation and unverified scopePR-specific questionChanged op testsPR state
Copilot findings
Code and op-test hygiene
Required CI
Shadow mode reports what would block but keeps the status successful. Set |
There was a problem hiding this comment.
🟡 Changes recommended
A critical conflict-detection bug groups equivalent numeric keys by raw CSV text, allowing auto-resolution to delete a source row instead of preserving both files.
1 open issue
2 resolved since last review
Review effort: Balanced
… duplicate check compared The duplicate check compares numeric key cells as numbers (256 and 256.0 are one shape) and the tag as fallback or live, but power_merge_conflict still grouped the rows on the raw cells, other than the tag. A power row and a latency row that the duplicate check took for one shape could fall into separate groups on 256 against 256.0, the conflict was missed, and the auto-resolution deleted the slower row from its source. The conflict check now gets the compared value of every key column. The merge-level power test covers a differing tag, a differing numeric spelling and both. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
| # tag separates only those two kinds of row. get_cfg_2stages | ||
| # compares the label exactly, so a padded "flydsl_fallback " is a | ||
| # live row there and here. | ||
| comparable["_tag"] = merge_df["_tag"].astype(str).eq("flydsl_fallback") |
There was a problem hiding this comment.
Item 1: The live-or-fallback key reports the swiglu_limit=N rows of tuned_swiglu_limit_fmoe as duplicates on current main (category: correctness)
On main the premise "lookups use _tag only to skip flydsl_fallback rows" no longer holds. read_table (aiter/moev2/dispatch/tuned.py:120-122) keeps only the rows whose _tag equals the requested label when a tag is passed, and fused_moe.py passes swiglu_limit_tag(swiglu_limit) for AITER_CONFIG_FMOE_SWIGLU_LIMIT_FILE. a8w8_blockscale_tuned_swiglu_limit_fmoe_gfx942.csv holds every shape twice, tagged swiglu_limit=5 and swiglu_limit=7, and both rows are served, each for its own limit.
With this key both rows count as live. Merging the head into main a7752f1 and running op_tests.tuning_tests.test_config_shape_collision: test_fmoe_swiglu_limit fails with Found 16 duplicate shape entries during merge of 'tuned_swiglu_limit_fmoe', and the auto-resolution reports a8w8_blockscale_tuned_swiglu_limit_fmoe_gfx942.csv: 16 -> 8 rows. In a checkout that deletes the slower limit's rows from the committed table. The same suite passes on main alone (34 of 34) and on this head against its own base, so the PR's CI cannot show it.
Could you rebase and keep the raw _tag in the key for families whose lookup selects rows by tag (today tuned_swiglu_limit_fmoe), and collapse it to live or fallback only for the families whose lookup ignores it? A merge-level case with two live rows of one shape tagged swiglu_limit=5 and swiglu_limit=7, expecting no error, would pin that down.
| # Numeric columns compare as numbers, so 256 and 256.0 are one shape. | ||
| comparable = merge_df.apply(as_numbers) | ||
| if has_tag: | ||
| # Lookups skip flydsl_fallback rows and serve every other row |
There was a problem hiding this comment.
Item 2: Comments, skill text and description name the old lookup as the rule for every family (category: documentation)
This comment says lookups "serve every other row whatever its _tag" and points to the exact comparison in get_cfg_2stages. On main get_cfg_2stages delegates to read_table, and a tagged read serves only the exact label. The same sentence is in .claude/skills/aiter-config-shape/SKILL.md (the _tag description around line 33) and in the PR description. Once item 1 settles which families key on the raw tag and which on live or fallback, could you state that in the comment and the skill file, and name read_table as the lookup the key mirrors?
| # tag separates only those two kinds of row. get_cfg_2stages | ||
| # compares the label exactly, so a padded "flydsl_fallback " is a | ||
| # live row there and here. | ||
| comparable["_tag"] = merge_df["_tag"].astype(str).eq("flydsl_fallback") |
There was a problem hiding this comment.
Item 3: The duplicate-shape header names _tag as a key for rows whose _tag differs (category: documentation) (nit, lower importance)
For two live rows with different labels, for example fused_expert against 0, the header prints dedup key: [..., '_tag'] and then lists rows whose _tag cells differ. A reader sees a key column with different values reported as a duplicate. Printing the key as it is compared, for example _tag (fallback or live), would remove the confusion.


Summary
The tuned-config merge now reports a shape with two live rows even when their
_taglabels differ. As a key,_tagseparates only
flydsl_fallbackrows, which lookups skip, from all other rows.Motivation
update_config_fileskeys its duplicate-shape check on the raw_tagvalue (_shape_dedup_keys). The key came withthe FlyDSL a4w4 MoE ([FlyDSL] import flydsl implement of a4w4 moe #2113), so that a
flydsl_fallbackrow can sit beside the live row for the same shape._tagonly to skipflydsl_fallbackrows:get_cfg_2stages(aiter/fused_moe.py) drops the rows whoselabel is exactly that, keys the rest on the shape and keeps the first row per shape with a warning. The FlyDSL MoE AOT
build (
aiter/aot/flydsl/moe.py) skips them after stripping whitespace._tagalso carries other labels onmain:fused_expert,exact-m4096-a,asm_flat_situv2,glm5.2_moe_pertokenfp8_large_20260831, and0, which the merge itself writes into the rows of a table withoutthe column.
_tag(filled0) and an untagged row from another table. The runtime then serves the row of whichever file comesfirst, and the merge's own resolution (keep the lowest
us, rewrite the sources) never runs.Changes
aiter/jit/core.py,_raise_on_duplicate_shapes: the key compares_tagas fallback or live, comparing the labelexactly as
get_cfg_2stagesdoes (a paddedflydsl_fallbackis live). The merged table and the error message keepthe labels as written.
power_merge_conflict) groups the duplicate rows on the keys as theduplicate check compared them: numeric cells as numbers (
256and256.0are one shape), the tag as fallback orlive. Grouped on the raw cells, a power row and a latency row for one shape would fall into separate groups on a
label or a numeric spelling, and the merge would rank one against the other and delete the loser from its source.
op_tests/tuning_tests/test_config_shape_collision.py:test_merge_keys_tag_as_live_or_fallbackandtest_merge_refuses_power_row_against_latency_row_keyed_differently..claude/skills/aiter-config-shape/SKILL.md: the key description says what_tagseparates.aiter/utility/base_tuner.py) and the power overlay's shape coverage(
aiter/utility/power_configs.py,_overlay_power_tables) still key on the raw_tag.Testing
Documentation
The skill file above is the only description of the merge key; no user or performance guide covers
_tag.Dependencies
Breaking Changes
A merge whose tables hold two live rows for one shape under different
_taglabels now raises the duplicate-shapeerror and rewrites the sources to the lowest-
usrow, as for any other duplicate. No table onmainhas such a pair:the family tests of
test_config_shape_collision, which merge the real tables (tuned_fmoeamong them), pass.PR Self-Review
Reviewed revision
54a256d7e0563463b09fe67f9e06282d803c8d25Behavior and intent
The merge's duplicate check sees the rows that lookups see: live rows collide per shape whatever their label, and a
flydsl_fallbackrow still sits beside the live one. Before, a label difference, including the0the merge fills in,hid a duplicate that the runtime then resolved by file order.
Validation and unverified scope
vllm/vllm-openai-rocm:nightly-rocm100-083fbac021348c2c7af8a7bc71ba18199d0dd7a4(Python 3.12,torch 2.13.0+rocm10.0.0, pandas 3.0.1) with FlyDSL 0.5.0 from PyPI,
GPU_ARCHS=gfx950, and the tree onPYTHONPATH.python3 -m unittest op_tests.tuning_tests.test_config_shape_collision: 34 passed on this branch (based onmainatd02f9d058a). With the key on the raw_tag, as before this PR, thefused_expertand padded-label cases and thepower test fail and the
flydsl_fallbackcase passes.op_tests.tuning_tests.test_fast_tuningandtest_tuner_infra: the same 3 errors with this change and withmain'score.py(no Triton GPU driver:0 active drivers;GroupedFmoeTunerhas no blank-cell value fora_preshuffle), everything else passes._tagalone, as the previous head did: the numeric-spelling cases oftest_merge_refuses_power_row_against_latency_row_keyed_differentlyfail, because the merge auto-resolves the powerrow against the latency row and rewrites the sources;
dup_rows: all three cases of that test fail;_tagfailstest_fmoe(gptoss_fp8fp4_tuned_fmoe.csvhas fallback rows beside live rows),measured at
948b1cd15.main'score.py, a power row and a latency row written256and256.0with no tags are auto-resolved and thelatency row is deleted from its table (observed on the
fixandmaintrees in the same container): the gap inthe conflict check is older than this change, and the numeric-spelling cases above close it.
PR-specific question
Which workload keys consume this, and what shows that unrelated shapes keep their selection:
duplicate, the merged table and every lookup are the same as before.
test_config_shape_collisionmerge the real tables onmainand pass with the change, so noshipped shape has two live rows and none changes selection.
usrow through the existingduplicate path, instead of to the first file.
Changed op tests
op_tests/tuning_tests/test_config_shape_collision.py:test_merge_keys_tag_as_live_or_fallback: a labeled live row, or a paddedflydsl_fallbackrow, against a row from atable without
_tagmust collide (the labeled case fails onmain, the padded one with the whitespace stripped), andan exact
flydsl_fallbackrow beside a live row must not.test_merge_refuses_power_row_against_latency_row_keyed_differently: a power row and a latency row for one shape arerefused with "a power-tuned row and a latency row share a shape", and both source files are unchanged afterwards,
whether the two tables write the key with different tags, with
256against256.0, or both._tagcolumn, and the family tests pass with or without this changebecause
mainhas no such pair.🤖 Generated with Claude Code