Skip to content

[Triton/Gluon] simplify triton docs - #6499

Merged
Boss2002n merged 10 commits into
mainfrom
satya/simplify_triton_docs
Oct 14, 2026
Merged

Boss2002n merged 10 commits into
mainfrom
satya/simplify_triton_docs

Conversation

@Boss2002n

Copy link
Copy Markdown
Contributor

Rewrite the Triton README, the Copilot review rules, the config rules (configs/CLAUDE.md), the Triton test README and the Triton part of CONTRIBUTE.md. Each one starts with a short list of rules. The text uses ASD-STE100 (Simplified Technical English).

Rewrite the Triton README, the Copilot review rules, the config rules
(configs/CLAUDE.md), the Triton test README and the Triton part of
CONTRIBUTE.md. Each one starts with a short list of rules. The text uses
ASD-STE100 (Simplified Technical English).

The rules stay the same, with two additions: comments are one or two
sentences, and docs, comments and PR descriptions use ASD-STE100. The
old Triton tips in CONTRIBUTE.md (block sizes, pipelining, cache
modifiers) are removed. The kpack rule in configs/CLAUDE.md now agrees
with the README: only gfx942 configs can have kpack.
The Triton docs now tell contributors to use only M_LEQ_<x> keys and
"any" for the M buckets of a GEMM config. The README has a new rule for
this. The config rules and the Copilot review rules agree with it.

The config rules and the Copilot review rules also say that you can use
cache_modifier on all archs, also on gfx1250. Copilot must not flag it
in a gfx1250 config.
Codex, Copilot and Claude Code all read AGENTS.md. This commit only
renames the file. The next commit adds the files that point to it.
Claude Code, Codex and Copilot now read the Triton rules from the same
files. No rule is written twice.

- aiter/ops/triton/AGENTS.md lists the rule files: the README, the
  config rules, the test README and the Copilot review checks. Claude
  Code imports the two README files from it.
- op_tests/triton_tests/AGENTS.md and
  op_tests/op_benchmarks/triton/AGENTS.md point to it.
- aiter/ops/triton/CLAUDE.md only imports the four AGENTS.md files.
  Claude Code does not read AGENTS.md files when the repository root
  has a CLAUDE.md, or in versions before v2.1.277. The imports work in
  all cases.
- The links to configs/CLAUDE.md now go to configs/AGENTS.md. This
  includes three code comments.
- Copilot flags a new CLAUDE.md file, and a new AGENTS.md file that
  aiter/ops/triton/CLAUDE.md does not import.
- Copilot code review does not read nested AGENTS.md files. The review
  checks stay in .github/instructions/aiter-ops-triton.instructions.md.
@Boss2002n
Boss2002n requested review from a team and a balanced review from Copilot October 13, 2026 19:23
@Boss2002n Boss2002n linked an issue Oct 13, 2026 that may be closed by this pull request
@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 6499 --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 simplify triton docs [Triton/Gluon] simplify triton docs Oct 13, 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.

🟡 Changes recommended

The new guidance has conflicting file rules and inaccurate config documentation.

3 open findings
What changed in this PR

This PR simplifies and centralizes Triton/Gluon contributor and agent guidance.

Changes:

  • Rewrites kernel, config, test, and review documentation.
  • Moves config guidance from CLAUDE.md to AGENTS.md.
  • Updates references to the new documentation paths.
File Description
.github/​instructions/​aiter-ops-triton.instructions.md Simplifies review rules.
CONTRIBUTE.md Replaces detailed examples with core rules.
aiter/​ops/​triton/​AGENTS.md Adds the agent guidance index.
aiter/​ops/​triton/​CLAUDE.md Adds Claude-specific imports.
aiter/​ops/​triton/​README.md Rewrites the maintainer guide.
aiter/​ops/​triton/​configs/​AGENTS.md Adds simplified config rules.
aiter/​ops/​triton/​configs/​CLAUDE.md Removes the former config guide.
aiter/​ops/​triton/​gemm/​basic/​gemm_afp8wfp8.py Updates a documentation reference.
aiter/​ops/​triton/​utils/​_triton/​tuning/​README.md Updates the config guide path.
aiter/​ops/​triton/​utils/​config_utils.py Updates a docstring reference.
aiter/​ops/​triton/​utils/​tuned_config_utils.py Updates a comment reference.
op_tests/​op_benchmarks/​triton/​AGENTS.md Adds benchmark agent guidance.
op_tests/​triton_tests/​AGENTS.md Adds test agent guidance.
op_tests/​triton_tests/​README.md Simplifies test rules.

🧠 Review effort: Balanced


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

Comment thread aiter/ops/triton/CLAUDE.md Resolved
Comment thread aiter/ops/triton/README.md Resolved
Comment thread aiter/ops/triton/configs/AGENTS.md Resolved
The README showed only <CONFIG_NAME>-N=<N>-K=<K>.json for specialized
config files. That pattern excludes valid names, such as batched
B=..-N=..-K=.. files, custom suffixes and MHC C=.. files. The README now
uses <CONFIG_NAME>-<suffix>.json, as configs/AGENTS.md does.

The CLAUDE.md rule could be read as "remove aiter/ops/triton/CLAUDE.md".
The docs now say that this file is the only CLAUDE.md, that it must
stay, and that Copilot must not flag it.
Copilot AI balanced review requested due to automatic review settings October 13, 2026 19:40

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.

🔵 Needs a closer look

The rewritten guidance contains conflicting rules and omits a documented PyTorch exception.

0 open findings

3 resolved since last review
Previously missed (3)

In code that hasn't changed since last review

Low severity Allow torch imports in the standalone tuning harness

aiter/​ops/​triton/​README.md:37

Rule 10 incorrectly bans torch from utils/_triton/tuning/, although that standalone-harness folder is the documented exception and already imports PyTorch. Add the exception so agents do not rewrite valid tuning tools.

Low severity Clarify that existing MHC and fused fallback searches are allowed

aiter/​ops/​triton/​configs/​AGENTS.md:18

This rule says that no fallback search exists, but lines 79–81 permit the MHC and fused_clamp_act_mul fallbacks. State that only new or general fallback searches are forbidden.

Low severity Split the tuning guide sentence into short ASD-STE100-compliant sentences

aiter/​ops/​triton/​utils/​_triton/​tuning/​README.md:80

This long sentence does not follow the new ASD-STE100 rule and makes four separate points. Split it into short sentences so the tuning guide follows the convention introduced by this PR.

🧠 Review effort: Balanced

Conflicts:
- aiter/ops/triton/README.md and the Copilot review rules: kept the
  short versions from this branch and added the changes of #6505. The
  shared @triton.jit device helpers are now in _triton_kernels/common/,
  and activation.py is not a flat wrapper any more.
- aiter/ops/triton/utils/_triton/tuning/README.md: took the new version
  from #6128.
#6128 added the tuning rules as a CLAUDE.md. Only Claude Code reads that
name. This commit only renames the file. The next commit links to it.
aiter/ops/triton/CLAUDE.md now imports the tuning rules, and the index
in aiter/ops/triton/AGENTS.md lists them. The tuning rules now link to
configs/AGENTS.md. They also say "only M_LEQ_* buckets are tuned" in
place of the M_GEQ sentence.
#6128 changed the GEMM loader and the tuning scripts. The config rules,
the Copilot review rules and the README now agree with it:

- A specialized file with "DEFAULT_FALLBACK": true gets its missing
  buckets from DEFAULT.json. Copilot does not flag such a file.
- is_tuned is True only for a bucket from the specialized file, not for
  "any" or a bucket from DEFAULT.json.
- DEFAULT.json sets the keys of a family, and the tuning scripts tune
  only these keys. Entries must have the keys of DEFAULT.json. The fixed
  list of ten keys is now an example: 25 of the 106 Triton GEMM
  DEFAULT.json files do not have all ten.
- For GEMM, the tuning scripts write the specialized file, and
  verify_configs.py --expect-tuned checks is_tuned.
The README said to log with "from aiter import logger". No library file
under aiter/ops/triton/ does that: 88 files use AiterTritonLogger() from
aiter/ops/triton/utils/logger.py, which reads AITER_TRITON_LOG_LEVEL.
Tests and benchmarks use "from aiter import logger", which reads
AITER_LOG_LEVEL.

The README, the test README and the Copilot review rules now say which
logger to use where. The test README also says how to see the debug
output of the library: AITER_TRITON_LOG_LEVEL=DEBUG with pytest
--log-cli-level=DEBUG. This logger has no handler of its own, so -s does
not show it.
Copilot AI balanced review requested due to automatic review settings October 14, 2026 04:42

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 rewritten rules omit supported normalization configs, legacy M_GEQ lookup behavior, and the tuning exception for PyTorch imports.

2 open findings

🧠 Review effort: Balanced

Comment thread aiter/ops/triton/README.md Resolved
Comment thread aiter/ops/triton/configs/AGENTS.md Resolved
Comment thread aiter/ops/triton/CLAUDE.md Resolved

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

LGTM except if you can clarify adding CLAUDE.md at the top.

@Boss2002n
Boss2002n merged commit 1dba932 into main Oct 14, 2026
@Boss2002n
Boss2002n deleted the satya/simplify_triton_docs branch October 14, 2026 15:57

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

I was checking .github/instructions/aiter-ops-triton.instructions.md and then I noticed the PR was merged!

I'm publishing my comments just so as not to discard them...

`*_asm.py`), CK (`csrc/ck_*`, `ck_tile`), OPUS (`aiter/ops/opus/`) and FlyDSL
(`aiter/ops/flydsl/`, `aiter/aot/flydsl/`). Triton and Gluon are one
backend. List the files of the other backend. When the parts depend on each
other, suggest stacked PRs. Tests and benchmarks belong to the backend that

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.

Suggestion: Add a link to stacked PR docs (https://docs.github.com/en/pull-requests/how-tos/stacked-pull-requests). It's a relatively new feature and users might not be used to it.

Comment on lines +66 to +68
(`from aiter.ops.triton.gemm_a16w16 import ...`). Use the category path.
- Flag relative imports. Use absolute imports
(`from aiter.ops.triton.<...> import ...`).

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.

Suggestion: Can you add an example of a category path and a relative import?

In MOE dispatch tables, flag:

- A new Gluon shape without all six buckets: `tiny`, `small`, `medium`,
`medium2`, `large`, `xlarge`.

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.

What's medium2? Is it supposed to be larger than medium and smaller than large?


## Configs: Python code

Tuning values are in JSON, never in Python. This applies to Triton and Gluon.

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.

Suggestion: I would also add that tuning configs shouldn't be shipped as CSV files.

- The test folder is the folder of the wrapper that the test imports:
- `attention/mla.py` → `op_tests/triton_tests/attention/test_mla.py`
- `gemm/basic/gemm_a8w8.py` → `gemm/basic/test_gemm_a8w8.py`
- `moe/moe_routing/routing.py` → `moe/moe_routing/`

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.

moe/moe_routing/test_routing.py instead of moe/moe_routing/?

A PR that changes a convention under `aiter/ops/triton/` must update
`aiter/ops/triton/README.md` and this file. Examples: a moved shared helper, a
change to the config layout or the loaders, or new folders. Flag a PR that
does not.

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.

Can you please add a sentence about keeping the exceptions updated?

For instance, we have this:

"Do not flag the old prints in gemm/basic/test_gemm_a8wfp4.py, quant/test_quant.py and conv/_helpers.py.

If a PR replaces print statements with proper logging in quant/test_quant.py then the exceptions must be removed.

By the way, conv/_helpers.py doesn't use print statements anymore:

    if suite.print_shapes:
        if _is_1x1_conv(R, S, dilation):
            kernel_type = "[1x1]"
        elif _is_3x3_conv(R, S):
            kernel_type = "[3x3]"
        else:
            kernel_type = "[general]"
        logger.info(
            "    %s %s: X%s W%s -> Y%s",
            name,
            kernel_type,
            tuple(x.shape),
            tuple(w.shape),
            tuple(y_ref.shape),
        )

Boss2002n added a commit that referenced this pull request Oct 14, 2026
Review comments on #6499:
- Link to the GitHub docs for stacked PRs (Copilot rules and README).
- Give examples of a category path and of a relative import.
- Give the M range of each MOE bucket: medium2 is M from 129 to 256,
  between medium and large (Copilot rules and config rules).
- Tuned configs are JSON files, never CSV files (Copilot rules, config
  rules and README).
- Use real test file names in the examples:
  moe/moe_routing/test_moe_routing.py and attention/test_mha.py.
- conv/_helpers.py has no print() calls now, so it is not an exception
  any more. A PR that fixes a file that an exception names must also
  remove the exception.
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.

Fix copilot reviews being too verbose.

4 participants