Skip to content

Revert "assert when found duplicated tuned shape" - #2502

Merged
gyohuangxin merged 1 commit into
mainfrom
revert-2376-assert_duplicate_tuned_shape
Mar 27, 2026
Merged

gyohuangxin merged 1 commit into
mainfrom
revert-2376-assert_duplicate_tuned_shape

Conversation

@gyohuangxin

Copy link
Copy Markdown
Member

Reverts #2376

@gyohuangxin
gyohuangxin requested review from a team and Copilot March 27, 2026 06:04
@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 (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:triton-355 Run Triton tests on MI355 in addition to MI325
ci:sglang SGLang integration tests
ci:atom ATOM benchmark (DeepSeek-R1 + GPT-OSS)
ci:vllm vLLM benchmark
ci:all All of the above

Add labels via the sidebar or gh pr edit 2502 --add-label <label>

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.

Pull request overview

Reverts the prior change that treated duplicated tuned shapes as a hard error during tuned-config CSV merges, returning to “drop duplicates and continue” behavior.

Changes:

  • Reworked update_config_files() merge behavior to sort by us, warn, and drop duplicate tuned rows instead of erroring.
  • Removed several model-specific untuned shape lists under aiter/configs/model_configs/.
  • Added a few missing tuned GEMM entries for KimiK2 and DSV3.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
aiter/jit/core.py Restores “warn + drop duplicates” merge behavior for tuned config files; simplifies merge input handling.
aiter/configs/model_configs/kimik2_fp4_untuned_fmoe.csv Deleted model-specific untuned FMoE shape list.
aiter/configs/model_configs/kimik2_bf16_untuned_gemm.csv Deleted model-specific untuned BF16 GEMM shape list.
aiter/configs/model_configs/kimik2_bf16_tuned_gemm.csv Added a tuned GEMM row for (M=80, N=2112, K=7168).
aiter/configs/model_configs/gptoss_bf16_untuned_gemm.csv Deleted model-specific untuned BF16 GEMM shape list.
aiter/configs/model_configs/dsv3_fp4_untuned_fmoe.csv Deleted model-specific untuned FMoE shape list.
aiter/configs/model_configs/dsv3_bf16_untuned_gemm.csv Deleted model-specific untuned BF16 GEMM shape list.
aiter/configs/model_configs/dsv3_bf16_tuned_gemm.csv Added several tuned GEMM rows for N=2112 at multiple M values.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread aiter/jit/core.py
merge_df = pd.concat([df for _, df in source_pairs], ignore_index=True)
df_list.append(df)
else:
logger.info(f"path {i+1}: {path} (not exist)")

Copilot AI Mar 27, 2026

Copy link

Choose a reason for hiding this comment

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

The missing-path log uses enumerate(path_list[1:]) but formats the index as i+1, so it reports the second path as "path 1". If you want the log index to correspond to the original path_list position, this should be offset by 2 (or log the actual position/index directly).

Suggested change
logger.info(f"path {i+1}: {path} (not exist)")
logger.info(f"path {i+2}: {path} (not exist)")

Copilot uses AI. Check for mistakes.
Comment thread aiter/jit/core.py
Comment on lines +191 to +192
df_list.append(pd.read_csv(path_list[0]))
for i, path in enumerate(path_list[1:]):

Copilot AI Mar 27, 2026

Copy link

Choose a reason for hiding this comment

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

pd.read_csv(path_list[0]) is executed unconditionally. If the first path in the env var / merged list doesn’t exist, this will raise a pandas FileNotFoundError before you can skip missing paths (and it bypasses the previous, clearer FileNotFoundError when no paths exist). Consider iterating over all paths with an existence check (including index 0) and raising a controlled error if none exist.

Copilot uses AI. Check for mistakes.
Comment thread aiter/jit/core.py
Comment on lines +197 to +199
assert (
base_cols == new_cols
), f"Column mismatch between {path_list[0]} and {path}, {base_cols}, {new_cols}"

Copilot AI Mar 27, 2026

Copy link

Choose a reason for hiding this comment

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

Column mismatch detection uses assert. Asserts are stripped with Python optimizations (-O), which would silently skip this validation. Use an explicit exception (e.g., ValueError) instead so mismatched CSV schemas are always caught with a stable error type.

Suggested change
assert (
base_cols == new_cols
), f"Column mismatch between {path_list[0]} and {path}, {base_cols}, {new_cols}"
if base_cols != new_cols:
raise ValueError(
f"Column mismatch between {path_list[0]} and {path}, {base_cols}, {new_cols}"
)

Copilot uses AI. Check for mistakes.
Comment thread aiter/jit/core.py
else:
logger.info(f"path {i+1}: {path} (not exist)")
merge_df = (
pd.concat([df for df in df_list if not df.empty], ignore_index=True)

Copilot AI Mar 27, 2026

Copy link

Choose a reason for hiding this comment

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

pd.concat([df for df in df_list if not df.empty], ...) can raise ValueError: No objects to concatenate when all loaded CSVs are empty (common for files that only contain headers). Previously concatenation included empty dataframes and produced an empty merge_df. Handle the “all empty” case explicitly (or avoid filtering empties) to prevent a runtime crash.

Suggested change
pd.concat([df for df in df_list if not df.empty], ignore_index=True)
pd.concat(df_list, ignore_index=True)

Copilot uses AI. Check for mistakes.
@gyohuangxin
gyohuangxin merged commit 46afd48 into main Mar 27, 2026
16 checks passed
@gyohuangxin
gyohuangxin deleted the revert-2376-assert_duplicate_tuned_shape branch March 27, 2026 06:19
yzhou103 added a commit that referenced this pull request Mar 27, 2026
valarLip added a commit that referenced this pull request Apr 1, 2026
* Reapply "assert when found duplicated tuned shape (#2376)" (#2502)

This reverts commit 46afd48.

* update blockscale_bpreshuffle_gemm

* Update aiter/configs/model_configs/dsv3_bf16_untuned_gemm.csv

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* add fused_qk_norm_group_quant kernel

* update untuned bf16 gemm csv

* remove unrelated non-core changes from duplicate-shape PR

Keep PR #2503 focused on duplicate-shape handling in aiter/jit/core.py and model-config CSV updates by reverting unintentionally included fused_qk/allreduce/test changes.

Made-with: Cursor

* revert remaining non-csv files from PR #2503

Keep the PR scope limited to aiter/jit/core.py and model config CSV changes by removing the remaining communication and multigpu test file deltas.

Made-with: Cursor

* revert hook-only non-csv churn from PR #2503

Drop remaining non-core, non-csv diffs introduced by hook normalization so the PR scope stays limited to aiter/jit/core.py and model config CSV changes.

Made-with: Cursor

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Lingpeng Jin <103567126+valarLip@users.noreply.github.com>
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.

2 participants