Skip to content

[Docs] [RFC #7240] How to serve an AITER op from an out-of-tree kernel library - #7695

Merged
zufayu merged 2 commits into
ROCm:mainfrom
zufayu:codex/aklr-plugin-readme
Nov 10, 2026
Merged

zufayu merged 2 commits into
ROCm:mainfrom
zufayu:codex/aklr-plugin-readme

Conversation

@zufayu

@zufayu zufayu commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

The interface is on main and nothing says how to use it. The next library
that wants to serve an AITER op has to read 1200 lines of implementation to
discover that installing a provider does nothing until a framework calls
configure(), or that select() has to be pure because explain() calls it
without running anything.

This is not a second RFC. #7240
holds the rationale, the open questions and the deprecation policy. This holds
the smallest provider that works, the entry-point declaration, what select()
must honour, and the four reads that answer "I installed it and nothing
happens"
.

Two things stated that are easy to get wrong by omission

No op is routed on main today. The interface is complete and tested; the
first ops to pass through it arrive in #7484. A provider can be written,
installed, enabled and inspected right now — and every call still goes native.
Saying so plainly is better than letting someone conclude their provider is
broken.

Nothing checks your run against the contract yet. The arity check comes
with #7484. Until it lands, a kernel bound to the wrong contract runs silently.

The failure section is real incidents, not invented ones

Four things that cost actual debugging time on the first provider to use this
interface:

  • a kernel bound to a layout instead of a contract — the bpreshuffle
    kernel offered for the blockscale contract, seven arguments about to reach
    a six-argument kernel;
  • matching hardware on get_device_name(), which reads AMD Radeon Graphics
    on MI355X under rocm/atom-dev, instead of on gcnArchName
    (gfx950:sramecc+:xnack-). Zero kernels loaded, every call declined, the
    interface looking broken while behaving exactly as specified;
  • reporting offline validation timings as though they described the call in
    hand;
  • treating a decline as a failure.

The arity point earns its space. Even once #7484 lands, the check compares
argument counts, not meaning.
mla_sparse_prefill_v4 and _v41 both take 15
arguments, and their second parameter is q_rope in one and q_scale in the
other. A provider bound to the wrong one reads a scale tensor as a RoPE
component — silently, with every gate green.

Verification

Every API name, keyword argument, status() key and reason string in the file
was checked programmatically against aiter/plugin/__init__.py at this commit.
The single reference to something that does not exist on main yet
(reason="contract-mismatch") is marked as arriving with #7484.

Merge order — this one has a hard prerequisite

⚠️ Do not merge this before #7654.

No git dependency: this branch sits on main, touches one new file and
conflicts with nothing. The dependency is in the content. The second commit
describes KernelCandidate.latency_us, which #7654 adds. Merged first, this
file documents a field that does not exist — the one failure mode that makes
documentation worse than none.

#7484 has landed, so the routed-op list and the arity check in here are now
true. latency_us is the only part still waiting.

Downstream: #7696 references aiter/plugin/README.md by path, so it wants to
land after this one.

#7654  →  this PR  →  #7696

PR Self-Review

Reviewed revision

0c607440a9

Behavior and intent

No behaviour changes: one new file, aiter/plugin/README.md, and nothing
imports it. The intent is that the next provider author does not have to read
the implementation to learn the enablement model, and does not have to
rediscover the four failures above.

The judgement worth reviewing is what was left out. Rationale, alternatives and
open questions stay in #7240 — duplicating them here creates two documents that
drift. What is here is only what someone writing a provider needs in hand.

Validation and unverified scope

Checked against the module at this commit: every plugin.* name referenced
exists, ENTRY_POINT_GROUP == "aiter.plugins", API_VERSION == 1, every
KernelCandidate keyword is a real field, every status() key referenced is
really returned, and every reason string quoted is really produced — with the
one exception marked as #7484's.

Unverified: the example provider is illustrative and is not executed by any
test. If the interface changes, nothing here goes red — the file has to be
updated by whoever changes it. That is the standing cost of documentation that
is not executable, and it is the reason this sits next to the module rather
than in a wiki.

PR-specific question

Should the example provider become an executable test, so the contract this
document describes cannot drift from the one the module implements?
It would
cost a test that is mostly prose-shaped, and it would catch exactly the failure
mode documentation has.

Changed op tests

None. This PR adds aiter/plugin/README.md only. No code, no test, no file
under op_tests/.

🤖 Generated with Claude Code

@zufayu
zufayu requested a review from a team November 10, 2026 02:32
@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 7695 --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.

@github-actions github-actions Bot added the Docs label Nov 10, 2026
@aiter-bot

aiter-bot commented Nov 10, 2026 •

Copy link
Copy Markdown

READY FOR HUMAN REVIEW

PR Self-Review

Revision 0c607440a9f9 · mode shadow

Author self-review accepted. Readiness report:

Author answers

  • PASS — current-SHA answers are present and structurally specific
Show the author's self-review answers

Behavior and intent

No behaviour changes: one new file, `aiter/plugin/README.md`, and nothing
imports it. The intent is that the next provider author does not have to read
the implementation to learn the enablement model, and does not have to
rediscover the four failures above.

The judgement worth reviewing is what was left out. Rationale, alternatives and
open questions stay in #7240 — duplicating them here creates two documents that
drift. What is here is only what someone writing a provider needs in hand.

Validation and unverified scope

Checked against the module at this commit: every `plugin.*` name referenced
exists, `ENTRY_POINT_GROUP == "aiter.plugins"`, `API_VERSION == 1`, every
`KernelCandidate` keyword is a real field, every `status()` key referenced is
really returned, and every `reason` string quoted is really produced — with the
one exception marked as #7484's.

Unverified: the example provider is illustrative and is not executed by any
test. If the interface changes, nothing here goes red — the file has to be
updated by whoever changes it. That is the standing cost of documentation that
is not executable, and it is the reason this sits next to the module rather
than in a wiki.

PR-specific question

*Should the example provider become an executable test, so the contract this
document describes cannot drift from the one the module implements?* It would
cost a test that is mostly prose-shaped, and it would catch exactly the failure
mode documentation has.

Changed op tests

None. This PR adds `aiter/plugin/README.md` only. No code, no test, no file
under `op_tests/`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

PR state

  • PASS — pull request is marked ready for review

Copilot findings

  • PASS — no active Copilot finding lacks a substantive author reply
  • ADVISORY — Copilot did not review the current head SHA

Code and op-test hygiene

  • PASS — no committed artifact or conflict marker detected

Required CI

  • PASS — Black: passed
  • PASS — Ruff: passed
  • PASS — Repository dependency: passed

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

zufayu and others added 2 commits November 10, 2026 05:25
The interface is on main and nothing says how to use it. The next library that
wants to serve an op has to read 1200 lines of implementation to find out that
installing a provider does nothing until a framework calls configure(), or that
`select()` has to be pure because `explain()` calls it without running anything.

Deliberately not a second RFC. ROCm#7240 holds the rationale, the open questions and
the deprecation policy; this holds the smallest provider that works, the entry
point declaration, what `select()` must honour, and the four reads that answer
"I installed it and nothing happens".

Two things stated here that are easy to get wrong by omission:

- **no op is routed on main today.** The interface is complete and tested, and
  the first ops to pass through it arrive in ROCm#7484. A provider can be written,
  installed, enabled and inspected right now, and every call still goes native.
  Saying so is better than letting someone conclude their provider is broken.
- **nothing checks your `run` against the contract yet.** The arity check comes
  with ROCm#7484. Until then a kernel bound to the wrong contract runs silently.

The failure section is four things that cost real debugging time on the first
provider to use this interface, rather than invented examples: a kernel bound
to a layout instead of a contract; matching hardware on `get_device_name()`
(which reads "AMD Radeon Graphics" on MI355X under rocm/atom-dev) instead of
`gcnArchName`; reporting offline validation timings as if they described the
call in hand; and treating a decline as a failure.

The arity point is worth the space it takes. Even once ROCm#7484 lands, the check
compares argument counts, not meaning — `mla_sparse_prefill_v4` and `_v41` both
take 15 arguments and their second parameter is `q_rope` in one and `q_scale`
in the other. A provider bound to the wrong one reads a scale tensor as a RoPE
component with every gate green.

Every API name, keyword, status() key and reason string in this file was
checked against the module on this commit. The one reference to something that
does not exist on main yet (`contract-mismatch`) is marked as arriving with
ROCm#7484.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Three statements in this file were written against a main where the interface
existed and nothing used it. ROCm#7484 changed that, and ROCm#7654 adds the cost field,
so:

- "no op is routed on main today" becomes the actual list of five, with the
  pointer to tests/plugin_contracts.json as the description that cannot drift;
- "nothing checks your run against the contract yet" becomes the arity check
  that now exists — and keeps the warning that matters more, that arity is not
  meaning: v4 and v41 both take 15 arguments with a different second one;
- a section on `latency_us`: what it means, why an offline validation ratio is
  not it, and why omitting beats extrapolating.

Documentation that describes a main it is not merging into is worse than none,
which is why this waits for ROCm#7654 rather than landing in two passes.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@zufayu
zufayu force-pushed the codex/aklr-plugin-readme branch from a5a317a to 0c60744 Compare November 10, 2026 05:25
@zufayu
zufayu merged commit ab2f5b3 into ROCm:main Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants