Skip to content

[Triton/Gluon] Tuning scripts: write the largest tuned bucket as "any" - #6922

Merged
Boss2002n merged 1 commit into
mainfrom
satya/tuning_any_m8192
Oct 29, 2026
Merged

Boss2002n merged 1 commit into
mainfrom
satya/tuning_any_m8192

Conversation

@Boss2002n

@Boss2002n Boss2002n commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

The installer of the GEMM tuning scripts writes "any" as a copy of the "any" of DEFAULT.json. "any" is the config for M above the largest bound (8192). The DEFAULT.json config is not tuned for the shape. For the gfx1250 Gluon GEMMs at M = 16384, it is 2.72x slower (geomean of 113 files) than the M_LEQ_8192 config of the same file. #6921 changes the merged files.

Technical details

  • write_best_configs.py: "any" is a copy of the bucket of the largest bound. This is M_LEQ_8192 for the standard bounds and M_LEQ_2048 for GEMM-A16W16-gated. The installer writes it again on every install, so "any" follows a new tune of that bucket.
  • A file without that bucket keeps a copy of the "any" of DEFAULT.json. This occurs for a new shape when M = 8192 is not swept. A tile that is tuned for a smaller M never becomes "any".
  • The installer prints the source of "any".
  • Docs: invariant 5 in the tuning AGENTS.md, the tuning README.md, configs/AGENTS.md and the sweep_configs.py docstrings.

Test plan

The checks of the tuning AGENTS.md, on gfx1250 (MI455X) with upstream Triton main 2c9fb87df:

  1. _utils, kernels and space import without torch. black --check . and ruff check . pass. Every DEFAULT.json key is in SEARCH_SPACE.
  2. harness.py gemm_afp4wfp4_preshuffle --M 64 --N 7168 --K 16384 --plan.
  3. sweep_configs.py gemm_afp4wfp4_preshuffle --M 4 64 --N 256 --K 512 --gpu 0. This makes a new file without M_LEQ_8192, so "any" must be the "any" of DEFAULT.json.
  4. sweep_configs.py gemm_afp4wfp4_preshuffle --all-buckets --N 256 --K 512 --gpu 0 1 2 3. "any" must be equal to the new M_LEQ_8192.
  5. verify_configs.py gemm_afp4wfp4_preshuffle --M 64 --N 256 --K 512 --expect-tuned. Then delete the test file.

Test results

  1. Pass (71 DEFAULT.json files).
  2. Pass.
  3. Pass. The file has M_LEQ_4 and M_LEQ_64, and "any" is equal to the "any" of DEFAULT.json. The installer prints any: a copy of the any of DEFAULT.json.
  4. Pass. The file has 13 buckets, and "any" is equal to M_LEQ_8192 (128x256x256, 4 warps, NUM_BUFFERS 2, num_ctas 4). The installer prints any: a copy of M_LEQ_8192 and validates the 13 buckets through the loader.
  5. Pass: is_tuned is True, 1.419 us.

@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 6922 --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.

@Boss2002n
Boss2002n marked this pull request as ready for review October 25, 2026 23:44
@Boss2002n
Boss2002n requested review from a team and a balanced review from Copilot October 25, 2026 23:44

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

The convention change still needs the required shared documentation updates.

2 open issues
What changed in this PR

This PR changes the GEMM tuning installer to use the largest-bound tuned bucket for "any", rather than always copying the family default.

Changes:

  • Refresh "any" on each install, using DEFAULT.json when the largest-bound bucket is absent.
  • Print which bucket supplies "any".
  • Update tuning and config documentation to describe the policy.
File Description
aiter/​ops/​triton/​utils/​_triton/​tuning/​write_best_configs.py Selects and reports the source of "any".
aiter/​ops/​triton/​utils/​_triton/​tuning/​sweep_configs.py Updates docstrings for the new policy.
aiter/​ops/​triton/​utils/​_triton/​tuning/​README.md Documents largest-bound selection and default fallback.
aiter/​ops/​triton/​utils/​_triton/​tuning/​AGENTS.md Revises the installer invariant.
aiter/​ops/​triton/​configs/​AGENTS.md Updates specialized config guidance.

Review effort: Balanced

Comment thread aiter/ops/triton/configs/AGENTS.md Resolved
@aiter-bot

Copy link
Copy Markdown

NOT READY FOR HUMAN REVIEW

PR Self-Review

Revision cc3c63d5268e · 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. Which exact workload keys consume these configuration changes, and what evidence shows that unrelated shapes keep their previous selection?
  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

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

@Boss2002n
Boss2002n merged commit 96175f6 into main Oct 29, 2026
142 checks passed
@Boss2002n
Boss2002n deleted the satya/tuning_any_m8192 branch October 29, 2026 22:19
solinzby1 pushed a commit that referenced this pull request Nov 2, 2026
shantipriya-amd pushed a commit to shantipriya-amd/aiter that referenced this pull request Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants