Skip to content

[Prototype] Validate AITER kernel provider interface - #7086

Closed
zufayu wants to merge 2 commits into
ROCm:mainfrom
zufayu:codex/aklr-provider-spike
Closed

zufayu wants to merge 2 commits into
ROCm:mainfrom
zufayu:codex/aklr-provider-spike

Conversation

@zufayu

@zufayu zufayu commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • add an experimental aiter.plugin interface for lazily discovered, out-of-tree kernel providers
  • keep versioned op identity and public AITER signatures under AITER ownership
  • make provider arbitration deterministic and record the selected candidate's immutable provenance
  • define the fallback boundary: discovery, compatibility, selection, decline, and invalid candidates may use native AITER; once run() starts, errors propagate
  • add global, per-op, and forced-provider debug switches
  • gate dispatch on explicit enablement: installing a provider never makes it the default (AITER_PLUGIN_ENABLE, default deny)

Prototype scope

This is an interface-validation spike, not a merge-ready production rollout:

Ownership boundary

  • AITER owns the op contract (signatures, versions), the execution rules (isolation, fallback, no-fallback-after-run()), and observable provenance.
  • Providers own their kernels, their qualification evidence, and their lifecycle; KernelCandidate.qualification is self-reported provenance, not an AITER certification.
  • Frameworks and users own enablement: installing a provider never makes it the default. A provider serves only when explicitly enabled (AITER_PLUGIN_ENABLE) or forced (AITER_PLUGIN_FORCE).

A provider execution failure is not transparently retried through native AITER because that could repeat side effects and hide a broken kernel.

Validation

  • pytest -q tests/test_plugin.py — 12 passed
  • ruff check aiter/plugin/__init__.py tests/test_plugin.py setup.py
  • black --check aiter/plugin/__init__.py tests/test_plugin.py
  • git diff --check

Review focus

  1. Is the three-way ownership boundary correct: AITER owns the contract, providers own kernels and qualification evidence, frameworks/users own enablement?
  2. Is default-deny enablement (installed ≠ enabled) the right default?
  3. Is the no-fallback-after-run() rule acceptable?
  4. Is immutable candidate provenance sufficient for the first AKLR integration experiment?

Related

  • #7240 — RFC: Versioned Kernel Provider Interface for AITER. The umbrella RFC for this work: ownership model, semantic op contracts, failure boundary, and the two-op initial rollout.

  • RFC: decouple backend names from public op definitions (start with MoE) #7150 — RFC: decouple backend names from public op definitions. The provider interface makes op contracts backend-neutral; that RFC tracks removing backend suffixes from public op names so the rest of the op surface can route the same way.

Author self-review

Reviewed revision

1797490acb66e654f667a74369a15638ac2903c6

Behavior and intent

Adds an experimental aiter.plugin interface for lazily discovered, out-of-tree kernel providers. AITER keeps ownership of op identity, public signatures, and execution rules (isolation, fallback boundary, no fallback once run() starts); providers own their kernels and self-reported qualification evidence; frameworks and users own enablement — installing a provider never makes it the default (AITER_PLUGIN_ENABLE is default-deny). No production op is routed and no existing caller's behavior changes.

Validation and unverified scope

pytest -q tests/test_plugin.py — 12 passed; ruff check and black --check clean on the new files; git diff --check clean; required CI (Black, Ruff, repository dependency, Aiter Test Gate) green. Unverified: no GPU execution in this PR (the plugin tests use CPU-side fake providers), real entry-point discovery with multiple installed providers, and any production op routing — those land in the follow-up PR.

PR-specific question

What changes in dependency, cache or compilation behavior, and how did you verify both a clean build and an existing-cache path? The diff touches no compilation path: setup.py gains one declarative entry-point group string (aiter.kernel_providers), aiter/plugin/__init__.py is a new standalone module that nothing in aiter imports yet, and tests/test_plugin.py is test-only. No dependency, build step, or JIT cache key changes. Unverified: a from-scratch wheel build (wheel jobs skip on fork PRs).

Changed op tests

None — this PR adds tests/test_plugin.py (interface unit tests with fake providers); no op_tests/ file changes.

🤖 Generated with Claude Code

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

@aiter-bot

aiter-bot commented Oct 29, 2026 •

Copy link
Copy Markdown

NOT READY FOR HUMAN REVIEW

PR Self-Review

Revision 94ee9517bb5f · 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. What changes in dependency, cache or compilation behavior, and how did you verify both a clean build and an existing-cache path?
  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 — Reviewed revision must contain at least the first 7 characters of the current head SHA

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 5, 2026 04:26
Installing a provider never makes it the default: dispatch now serves a
provider only when it is explicitly enabled (AITER_PLUGIN_ENABLE) or
forced (AITER_PLUGIN_FORCE). This makes the ownership boundary concrete:
AITER owns the op contract and execution rules, providers own their
kernels and qualification evidence, frameworks and users own enablement.

- document the ownership boundary in the module docstring
- isolate invalid candidates returned by select(): fall back to native
  with reason "invalid-candidate" instead of raising AttributeError
- document that entry points must target an instance or zero-arg factory
- tests: installed-but-not-enabled is inert (select never called);
  non-candidate select() results fall back to native

Co-Authored-By: Claude Code <[email protected]>
@zufayu
zufayu force-pushed the codex/aklr-provider-spike branch from 1797490 to 94ee951 Compare November 5, 2026 04:27
@zufayu
zufayu removed the request for review from valarLip November 7, 2026 00:03
@zufayu

zufayu commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #7465, which contains both of these commits as its first two
layers and then implements the interface on top of them.

Keeping this open costs more than it saves: anyone arriving at the design now
has two open PRs for one interface and no way to tell which to read. The
prototype's history is preserved in #7465's own commits, so nothing is lost by
closing it here.

The series, split by who reviews it: #7465 the interface, #7466 its tests as a
CPU-only gate on every PR, #7484 the routed ops.

@zufayu zufayu closed this Nov 8, 2026
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