Skip to content

[Tune] [Bugfix] --run_config <tuned_csv> runs without the default untuned CSV - #8857

Draft
demonsan wants to merge 1 commit into
mainfrom
demonsan/issue-6255-run-config-no-untuned
Draft

demonsan wants to merge 1 commit into
mainfrom
demonsan/issue-6255-run-config-no-untuned

Conversation

@demonsan

Copy link
Copy Markdown
Contributor

Refs #6255

Summary

--run_config <tuned.csv> now runs on a machine that has no default untuned CSV. One of the three defects of #6255; the other two are in the stacked PRs for the ASM table and for CK shape legality (see "Overlap").

Motivation

--run_config <tuned.csv> takes its shapes from that tuned file, but TunerCommon._run_selected called pre_process first. GemmCommonTuner.pre_process reads the default untuned CSV and asserts that it exists (Not exist untuned file), so the run died before it looked at --run_config.

Changes

  • aiter/utility/base_tuner.py: while --run_config <csv> is given without --compare or --all, get_untuned_gemm_list returns an empty frame (with the tuner's key columns) for a file that does not exist, instead of asserting. _run_selected still calls pre_process, so a tuner's own setup stays in place; GemmCommonTuner.pre_process skips its tuned-row mask for an empty untuned frame.
  • .github/scripts/split_tests.sh: runs the new test.

Not changed: --compare, --all, a bare --run_config, and an existing untuned file go through the same code as before.

An earlier shape of this fix skipped pre_process as a whole. That broke gemm_a8w8_mxfp8_bpreshuffle, whose pre_process sets _mxscale_table and swaps its tuned file, and run_config reads both; the test below covers that tuner.

Overlap with other work: #8825 and #7979 edit the a4w4 tuner file, not this one. #8847 (ASM full_n_tile) and the CK legality PR stacked on it are independent of this change.

Performance (if applicable)

Not a performance change.

Testing

  • Unit tests added or updated
  • Performance benchmarks run
  • Tested on MI250X
  • Tested on MI300X

Tested on MI350X (gfx950), see the Self-Review.

Documentation

  • Docstrings updated
  • User guide updated
  • Performance guide updated
  • No documentation change is needed, with the reason stated below

The comment at _run_selected and the one on _untuned_file_optional describe the behavior; no user-facing option changes.

Dependencies

  • No new third-party dependencies added
  • New dependencies are listed and justified below

Breaking Changes

None. Before, the case that now works died with an AssertionError.

PR Self-Review

Reviewed revision

20e058d

Behavior and intent

--run_config <tuned.csv> runs the tuned kernels of that file without the default untuned CSV. The tuner's own pre_process still runs, so its state (for example _mxscale_table and the swapped tuned file of the mxfp8 tuner) is in place when run_config runs. Only the read of a missing untuned CSV is skipped, and only when neither --compare nor --all is given.

Validation and unverified scope

Hardware: mi350x8, MI350X (gfx950, 256 CU), image rocm/atom-dev:sglang-latest with this branch overlaid (git archive of the branch).

  • csrc/ck_gemm_a4w4_blockscale/gemm_a4w4_blockscale_tune.py --run_config <2-row tuned csv> -i <missing file>: rc=0, both shapes OK (M=1, N=512, K=4096 ASM row 6.0 us; M=1, N=18432, K=16384 CK row 50.6 us). The same command with this file's main version: rc=1, AssertionError: Not exist untuned file.
  • csrc/gemm_a8w8_mxfp8_bpreshuffle/gemm_a8w8_mxfp8_bpreshuffle_tune.py --run_config <2-row mxscale csv> --mxscale_table -i <missing file>: rc=0, both shapes OK (5.5 us, 5.4 us; the checkAllclose warnings come from the kernels, not from this change).
  • Unit tests in the container (no GPU): the new file 7 passed, as a script and under pytest. With the main version of base_tuner.py, 4 of the 7 fail (the missing-file case, the flag, the existing-file read, and the mxfp8 tuner).
  • Lint: ruff 0.16.0 and black 26.10.1 (the version pinned on main), clean.
  • git merge-tree against origin/main: clean.
    Not verified:
  • Only the a4w4 and the mxfp8 tuners were run end to end. The other tuners whose pre_process reads the untuned file through get_untuned_gemm_list get the same empty frame; one that indexes columns beyond its keys of that empty frame would fail on a later line instead of on the assert, which is no worse than before.
  • A wrong path given to -i together with --run_config <file> is now ignored silently (the file is not needed).

PR-specific question

Should --run_config <file> with a missing -i file log that the untuned file is ignored? I left it silent because nothing reads it.

Changed op tests

op_tests/tuning_tests/test_run_config_no_untuned.py (new, CPU only, registered in split_tests.sh, runs as a script through unittest.main()):

  • a stub GemmCommonTuner: --run_config <csv> without the untuned file runs, pre_process still runs, and the shapes come from the tuned CSV;
  • --compare, --all and a bare --run_config still raise Not exist untuned file; an existing untuned file is still read; the flag is off outside the --run_config <file> case;
  • the real GemmA8W8MXFP8BpreshuffleTuner with --mxscale_table: _mxscale_table and the swapped tuned file are set when run_config runs.
    No other op test changes.

…uned CSV (Refs #6255)

--run_config <tuned_csv> reads its shapes from the tuned file, but _run_selected called
pre_process first and GemmCommonTuner.pre_process asserts that the untuned CSV exists, so
the run died on a machine without the default untuned file.

Skip only that read: while --run_config <file> is given without --compare or --all, a
missing untuned CSV reads as an empty frame. pre_process itself still runs, so a tuner's own
setup stays in place (gemm_a8w8_mxfp8_bpreshuffle sets _mxscale_table and its tuned file
there, and run_config uses both).
@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

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

Extended tests (opt-in via labels):

Label Tests
ci:mi300x Run Aiter standard tests on MI300X in PRs; main branch always runs them
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 Radeon R9700 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 8857 --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.

Reviews:
A reviewer is usually assigned within one working day after the PR is ready for review (see Code Review Process). If nobody has responded for about a week, mention the area contact listed in CONTACTS.md. Want to help review? See REVIEWERS.md.

This branch has not been deployed

No deployments
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