Skip to content

[Triton/Gluon] [Plugin] Route fused_dual_rmsnorm_mxfp8_quant - #7875

Merged
zufayu merged 4 commits into
mainfrom
codex/route-dual-rmsnorm
Nov 13, 2026
Merged

zufayu merged 4 commits into
mainfrom
codex/route-dual-rmsnorm

Conversation

@zufayu

@zufayu zufayu commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Routes fused_dual_rmsnorm_mxfp8_quant, which ATOM calls on the V4 MXFP8 path (atom/model_ops/layernorm.py), using route(..., fake=...) from #7850.

The out-param form cannot be a routed contract

This op both writes through yq/sq/yk and returns them:

if yq is None:
    yq = torch.empty(...)
...
return yq, sq, yk

Registered over the full signature, that is an op returning one of its own arguments, while the schema it is registered under declares that its results do not alias its inputs. Measured, rather than argued:

fake compiled, buffer passed
allocates a fresh tensor compiles fine, and the caller's buffer is never written — the return value is correct, so a caller reading its own buffer afterwards reads stale data and nothing reports it
hands the argument back works — but only by asserting the aliasing its own schema denies

opcheck reports the contradiction either way: Argument out is not defined to alias output but was aliasing.

An earlier revision of this PR said register_fake may not return an argument. That is not true — it may, and it works. The true statement is narrower, and it is the one that motivates the bypass: the contradiction is real, the silent half of it is the dangerous half, and neither resolution belongs in a contract.

So the contract is the allocating form, and passing any of the three buffers bypasses routing:

if yq is None and sq is None and yk is None:
    return _fused_dual_rmsnorm_mxfp8_quant_routed(...)   # 7 parameters, no out-params
return _fused_dual_rmsnorm_mxfp8_quant_native(...)        # what the caller asked for

The mechanism is not new: pa_fwd(backend=...) already bypasses routing when a caller pins what to run. Naming output buffers is the same kind of instruction. The reason is written in the docstring, not just the conclusion, so the next person reading "why do these three parameters skip routing" does not have to re-derive it.

ATOM's only call site passes none of them, so every call it makes is routed.

Structure

Three parts, mirroring pa_fwd / _pa_fwd_routed / _pa_fwd_native from #7807:

  • _fused_dual_rmsnorm_mxfp8_quant_native — the existing body, renamed, unchanged;
  • _fused_dual_rmsnorm_mxfp8_quant_routed — 7 parameters, carries @route and the contract docstring;
  • fused_dual_rmsnorm_mxfp8_quant — the public name, picks a branch.

Validation

On gfx942, torch 2.9.1, against this tree:

check result
routed branch vs. _native all three outputs bit-identical
bypass branch returns the buffers it was given (data_ptr checked), values agree with the routed branch
tests/test_plugin_contracts.py, tests/test_plugin_selector_arity.py 20 passed
baseline regenerated with routed_contracts(), 17 -> 18
black, ruff check clean

The fake allocates (M, KQ) fp8 e4m3fn, (M, KQ // 32) uint8 and (M, KK) in k's dtype — read off the same expressions the kernel path uses, not off the docstring.

Limits

The buffered branch is covered by identity rather than by value alone: a fake that
allocates returns the right value while leaving the caller's buffer unwritten, which
comparing values cannot see. ci:all is set, and this touches aiter/ops/triton/**,
so the Triton suite runs.

🤖 Generated with Claude Code

PR Self-Review

Reviewed revision

54f7a44a16

Behavior and intent

ATOM calls this op on the V4 MXFP8 path and no provider can serve it. Routing it needs one decision first: the op writes through yq/sq/yk and returns them, so an op registered over the full signature would return one of its own arguments — which a custom op's schema forbids, register_fake refuses, and opcheck rejects. The routed contract is therefore the allocating form, and naming any output buffer bypasses routing.

That bypass is not a new rule: pa_fwd(backend=...) already skips routing when a caller pins what to run, and naming the buffers to write is the same kind of instruction. ATOM's only call site names none of them, so every call it makes is routed.

Validation and unverified scope

Verified on gfx942, torch 2.9.1, against this tree:

  • routed branch vs. _native: all three outputs bit-identical;
  • bypass branch: returns the buffers it was given (data_ptr compared, not inferred), values agreeing with the routed branch;
  • _fused_dual_rmsnorm_mxfp8_quant_routed registers — OpOverloadPacket under torch.ops.aiter_routed;
  • tests/test_plugin_contracts.py and tests/test_plugin_selector_arity.py: 20 passed;
  • baseline regenerated with routed_contracts() rather than edited, 17 -> 18;
  • black and ruff check clean.

Added in 54f7a44a16, answering a Copilot review that the MXFP8 tests only made
allocating eager calls, so neither the fake nor the buffered boundary had regression
coverage — four tests in tests/test_plugin_routed_ops.py, each pinning which path
ran rather than only that the call returned something:

  • the allocating form is what a provider serves — decision asserted to be
    ("provider", "aklr"), one select call;
  • naming any one output buffer bypasses routing — parametrised over yq, sq, yk
    separately, because the branch reads all three and a test passing them together
    would still pass with two conditions dropped; the provider must come out with zero
    select calls;
  • the buffered form writes and returns the caller's buffers — asserted on data_ptr,
    not on values;
  • the routed form runs inside a compiled region — shape, dtype and value against the
    eager call, so a fake whose metadata drifts from the kernel fails there.

6 passed on gfx942 / torch 2.9.1; black and ruff check clean.

Unverified: the bypass tests replace the native body, so they pin which branch the
public name picks, not what the kernel computes — the latter is what the data_ptr
test under @requires_cuda covers. There is no dedicated op_tests/ target for this
op to name.

The boundary this introduces, and what covers it

The split itself: one public name, two paths, and a caller lands on the wrong one only by passing a buffer — in which case it gets AITER's own kernel, which is what naming the buffer asked for. The risk is the reverse direction, a routed call quietly not being routed, and that is covered by the data_ptr check: the bypass branch is proven to be the branch that returns an argument, so the routed branch provably is not.

The fake's shapes are read off the same expressions the kernel path uses — KQ // _QUANT_BLOCK_SIZE, k.dtype — rather than off the docstring, so a change to either moves both together.

PR-specific question

Which exact workload keys consume these configuration changes, and what evidence shows that unrelated shapes keep their previous selection?

No configuration or tuning keys change, and no selection logic is touched. The one branch this PR adds reads whether yq, sq and yk are None — never a shape, a dtype, an arch or a tuning key. _fused_dual_rmsnorm_mxfp8_quant_native is the original body, renamed and otherwise unchanged, so every shape reaches the same Triton launch with the same BLOCK_SIZE_KQ / BLOCK_SIZE_KK / NUM_PRGMS it computed before.

The evidence is the equivalence run: the routed branch and _native produce bit-identical output for all three tensors, and the bypass branch returns the exact buffers it was handed (data_ptr compared). Since selection cannot depend on anything this PR introduces, there is no shape for which it could differ.

Changed op tests

None. The regression coverage added in 54f7a44a16 lives in
tests/test_plugin_routed_ops.py, beside the other routed-contract tests, because what
it pins is a routing boundary rather than kernel numerics. No op_tests/ file changed.

The op writes through yq/sq/yk and returns them, so registering it over
the full signature would be an op returning its own argument -- which a
custom op's schema forbids and register_fake rejects. The routed contract
is therefore the allocating form, and naming any output buffer bypasses
routing, the way pa_fwd(backend=...) already does. ATOM's only call site
names none of them.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@zufayu
zufayu requested a review from a team November 12, 2026 10:50
@zufayu zufayu added the ci:all label Nov 12, 2026
@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 7875 --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.

@aiter-bot

aiter-bot commented Nov 12, 2026 •

Copy link
Copy Markdown

READY FOR HUMAN REVIEW

PR Self-Review

Revision 54f7a44a16fa · 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

ATOM calls this op on the V4 MXFP8 path and no provider can serve it. Routing it needs one decision first: the op writes through `yq`/`sq`/`yk` and returns them, so an op registered over the full signature would return one of its own arguments — which a custom op's schema forbids, `register_fake` refuses, and `opcheck` rejects. The routed contract is therefore the allocating form, and naming any output buffer bypasses routing.

That bypass is not a new rule: `pa_fwd(backend=...)` already skips routing when a caller pins what to run, and naming the buffers to write is the same kind of instruction. ATOM's only call site names none of them, so every call it makes is routed.

Validation and unverified scope

Verified on gfx942, torch 2.9.1, against this tree:

- routed branch vs. `_native`: all three outputs bit-identical;
- bypass branch: returns the buffers it was given (`data_ptr` compared, not inferred), values agreeing with the routed branch;
- `_fused_dual_rmsnorm_mxfp8_quant_routed` registers — `OpOverloadPacket` under `torch.ops.aiter_routed`;
- `tests/test_plugin_contracts.py` and `tests/test_plugin_selector_arity.py`: 20 passed;
- baseline regenerated with `routed_contracts()` rather than edited, 17 -> 18;
- `black` and `ruff check` clean.

Added in `54f7a44a16`, answering a Copilot review that the MXFP8 tests only made
allocating eager calls, so neither the fake nor the buffered boundary had regression
coverage — four tests in `tests/test_plugin_routed_ops.py`, each pinning *which* path
ran rather than only that the call returned something:

- the allocating form is what a provider serves — decision asserted to be
  `("provider", "aklr")`, one select call;
- naming any one output buffer bypasses routing — parametrised over `yq`, `sq`, `yk`
  separately, because the branch reads all three and a test passing them together
  would still pass with two conditions dropped; the provider must come out with zero
  select calls;
- the buffered form writes and returns the caller's buffers — asserted on `data_ptr`,
  not on values;
- the routed form runs inside a compiled region — shape, dtype and value against the
  eager call, so a fake whose metadata drifts from the kernel fails there.

`6 passed` on gfx942 / torch 2.9.1; `black` and `ruff check` clean.

**Unverified:** the bypass tests replace the native body, so they pin which branch the
public name picks, not what the kernel computes — the latter is what the `data_ptr`
test under `@requires_cuda` covers. There is no dedicated `op_tests/` target for this
op to name.

PR-specific question

*Which exact workload keys consume these configuration changes, and what evidence shows that unrelated shapes keep their previous selection?*

No configuration or tuning keys change, and no selection logic is touched. The one branch this PR adds reads whether `yq`, `sq` and `yk` are `None` — never a shape, a dtype, an arch or a tuning key. `_fused_dual_rmsnorm_mxfp8_quant_native` is the original body, renamed and otherwise unchanged, so every shape reaches the same Triton launch with the same `BLOCK_SIZE_KQ` / `BLOCK_SIZE_KK` / `NUM_PRGMS` it computed before.

The evidence is the equivalence run: the routed branch and `_native` produce bit-identical output for all three tensors, and the bypass branch returns the exact buffers it was handed (`data_ptr` compared). Since selection cannot depend on anything this PR introduces, there is no shape for which it could differ.

Changed op tests

None. The regression coverage added in `54f7a44a16` lives in
`tests/test_plugin_routed_ops.py`, beside the other routed-contract tests, because what
it pins is a routing boundary rather than kernel numerics. No `op_tests/` file changed.

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
  • PASS — Aiter Test Gate: 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.

The docstring claimed register_fake may not return an argument. Measured:
it may, and doing so works. What is true is narrower and the reason the
bypass exists: the schema declares results do not alias inputs, opcheck
reports the contradiction, and a fake that allocates leaves the caller's
buffer unwritten under compile while returning the right value -- no
error, stale buffer. Dropping the buffers from the contract removes the
contradiction rather than picking a side of it.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@github-actions github-actions Bot changed the title [Plugin] Route fused_dual_rmsnorm_mxfp8_quant [Triton/Gluon] [Plugin] Route fused_dual_rmsnorm_mxfp8_quant Nov 12, 2026
@Boss2002n
Boss2002n requested a balanced review from Copilot November 12, 2026 15:20

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

Compiled calls and provider routing with supplied output buffers lack regression coverage, and the documented yk dtype conflicts with native and fake output behavior.

2 open issues
What changed in this PR

This PR adds plugin routing for fused_dual_rmsnorm_mxfp8_quant, allowing providers to serve ATOM’s allocating MXFP8 path while preserving native execution for caller-supplied output buffers.

Changes:

  • Splits the wrapper into public dispatch, routed allocation, and unchanged native execution.
  • Adds a fake implementation for custom-op registration and documents the buffer bypass.
  • Adds the allocating signature to the plugin contract baseline.
File Description
tests/​plugin_contracts.json Records the new routed contract and fingerprint.
aiter/​ops/​triton/​quant/​fused_mxfp8_quant.py Adds routing, fake output allocation, and native buffer bypass.

Review effort: Balanced

fangche123
fangche123 previously approved these changes Nov 13, 2026
Copilot review. Both the K-side description and the Returns line of the
routed contract promised bf16 for yk, but an fp16 k yields fp16 in the
native allocation and in the fake. Providers must implement the actual
dtype, so the contract now says what it is: yk follows k.dtype.

Co-Authored-By: Claude Code <[email protected]>
Copilot review: the MXFP8 tests only made allocating eager calls, so neither
the fake nor the buffered routing boundary had regression coverage.

Four tests, each pinning WHICH path ran rather than only that the call
returned something. The risk here is one-directional: landing on the
buffered path by naming a buffer gets AITER's own kernel, which is what
naming it asked for. The failure that matters is the reverse -- a call that
looks routed quietly not being routed.

  * the allocating form is what a provider serves -- provider enabled, and
    the decision is asserted to be ("provider", "aklr") with one select call;
  * naming any one output buffer bypasses routing -- parametrised over yq,
    sq and yk separately, because the branch reads all three and a test
    passing them together would still pass with two conditions dropped. The
    provider stays enabled and must come out with zero select calls;
  * the buffered form writes and returns the caller's buffers -- asserted on
    `data_ptr`, not on values. A fake that allocates compiles fine and
    returns the right value while leaving the caller's buffer unwritten;
    comparing values alone cannot see that;
  * the routed form runs inside a compiled region -- shape, dtype and value
    against the eager call, so a fake whose metadata drifts from the kernel
    fails here.

The bypass tests replace the native body, so they need no device: what is
under test is which branch the public name picks. What the kernel computes
is covered by the `data_ptr` test under `@requires_cuda`.

Verified on gfx942, torch 2.9.1: 6 passed; black and ruff clean.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@zufayu
zufayu merged commit aae644c into main Nov 13, 2026
@zufayu
zufayu deleted the codex/route-dual-rmsnorm branch November 13, 2026 13:06
zufayu added a commit that referenced this pull request Nov 20, 2026
Five contracts carried an optional output buffer and returned it. That shape
cannot be registered as a custom op: the schema declares that results do not
alias inputs, so opcheck rejects it, and under compile a fake that allocates
leaves the caller's buffer unwritten while still returning the right value --
no error, stale buffer, nothing says so.

Each public spelling keeps its buffer argument and bypasses routing when one
is named, as #7875 does. The routed contract drops it and gains a fake, so
the op registers and a caller's graph no longer splits when a provider is
enabled.

  gemm_a8w8_blockscale_bpreshuffle  v1 -> v2
  mla_sparse_prefill                v1 -> v2
  mla_sparse_prefill_v41            v2 -> v3
  inverse_rope_group_quant          v1 -> v2
  pa_decode_bf16                    v1 -> v2

Each declares the older version in supersedes=: the only change is removing
an OPTIONAL buffer, so a provider built for the older shape sees it as None
and allocates, which is the new semantics exactly. (rmsnorm v1 was left out
of its own supersedes for the opposite reason: a v1 kernel handed a v2 call
writes the caller's input.)

_NOT_REGISTERED drops from 12 entries to 7; registered routed ops go from 7
to 12.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
fangche123 pushed a commit that referenced this pull request Nov 20, 2026
…8291)

* [RFC #7240] Drop the output buffer from five routed contracts

Five contracts carried an optional output buffer and returned it. That shape
cannot be registered as a custom op: the schema declares that results do not
alias inputs, so opcheck rejects it, and under compile a fake that allocates
leaves the caller's buffer unwritten while still returning the right value --
no error, stale buffer, nothing says so.

Each public spelling keeps its buffer argument and bypasses routing when one
is named, as #7875 does. The routed contract drops it and gains a fake, so
the op registers and a caller's graph no longer splits when a provider is
enabled.

  gemm_a8w8_blockscale_bpreshuffle  v1 -> v2
  mla_sparse_prefill                v1 -> v2
  mla_sparse_prefill_v41            v2 -> v3
  inverse_rope_group_quant          v1 -> v2
  pa_decode_bf16                    v1 -> v2

Each declares the older version in supersedes=: the only change is removing
an OPTIONAL buffer, so a provider built for the older shape sees it as None
and allocates, which is the new semantics exactly. (rmsnorm v1 was left out
of its own supersedes for the opposite reason: a v1 kernel handed a v2 call
writes the caller's input.)

_NOT_REGISTERED drops from 12 entries to 7; registered routed ops go from 7
to 12.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* Address the review: keep the public registration, declare mutation, pin it

Five findings from the bot review of 5416969, each verified before fixing.

**The public name stopped being registered.** Moving `@torch_compile_guard`
onto the renamed `_gemm_a8w8_blockscale_bpreshuffle_native` moved the
registration with it -- the guard registers under the decorated function's
own name -- so `torch.ops.aiter.gemm_a8w8_blockscale_bpreshuffle` and the
public spelling's `_eager_body` both disappeared, and
`op_tests/test_gemm_host_dispatch_cache.py` used both. The guard now sits on
the public dispatcher, which carries the name. Confirmed by comparing the
registered names against an unpatched main tree: the same three are present
on both.

Worth noting that CI did not catch this. The Aiter Test Gate went green on
the revision where those two attributes were already gone.

**The schemas claimed every input was mutated.** The new routes passed
`fake=` but not `mutates_args=[]`, so each registered as
`(Tensor(a0!) XQ, Tensor(a1!) WQ, ...)` and earned an
`auto_functionalized_v2` wrap under compile -- on ops whose unguarded public
spellings previously traced through. Four of the five now declare `[]`, which
is what their own docstrings say.

`pa_decode_bf16` deliberately does not. Dropping `out` removes the buffer it
RETURNED, but `split_o`, `split_lse` and `work_info` still reach the asm
binding as split-KV scratch and nothing in the tree establishes they are
read-only. `route()` says the conservative default costs a wrap while a
declared list that lies is undefined behaviour, so the wrap is the cheaper of
the two until someone can state it per buffer.

**The nested group32 call became provider-offerable.** `gemm_a8w8_blockscale`
reached its bpreshuffle sibling through `_eager_body` to avoid dispatching a
second time; with the split, that body is the dispatcher, which routes when no
buffer is named -- a second dispatch, and a different kernel inside what the
caller asked AITER to compute. It now targets the native body directly. The
comment and the test's patch target move with it.

**Nothing asserted the contracts reach torch.** The AST gate checks that
`fake=` was passed and the registry check reads the plugin's own dict; neither
calls into torch, and `_as_custom_op` returns None silently on failure. A new
parametrised test resolves each of the five under `torch.ops.aiter_routed` and
compares the registered parameter list against the recorded contract --
against the baseline rather than a list of likely buffer names, because
`x_scale` is an output buffer for one of these ops and an input for another.

**No CI label.** `ci:all` added, so the label-gated downstream jobs run
against the new opaque nodes rather than nothing.

Verified: `tests/test_plugin_contracts.py tests/test_plugin_routed_ops.py
op_tests/test_mla_sparse_prefill_v41_asm.py
op_tests/test_gemm_host_dispatch_cache.py` is 137 passed, 145 skipped on
gfx942. black and ruff clean.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* Let the registry hold superseded op versions of its own

`test_status_lists_what_is_deprecated_and_when_it_goes` asserted that
`status()["deprecations"]` held exactly the two entries it created, which
held only while no op in the tree declared `supersedes=`. These five now
do, so the test selects its own two subjects instead.

The coverage that assertion really provided -- that a superseded op
version is announced at all -- moves to the contract test, where it is
checked per op against that op's own version.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* [RFC #7240] Drop the output buffer from pa_fwd, and cover its routed path

`pa_fwd` is the sixth contract with an optional output buffer it returns,
and the last one this series leaves. Registered, that is an op returning one
of its own arguments while its schema declares results do not alias inputs.

v1 -> v2 removes the buffer from the contract. Both public spellings keep
their signatures; naming `out_` bypasses routing and runs AITER's own kernel,
which is what naming it asked for. v1 is declared in `supersedes=`: the only
change is removing an OPTIONAL buffer, so a v1 provider sees `out_=None` and
allocates, which is v2's semantics exactly.

`_NOT_REGISTERED` goes from 19 entries to 18; registered routed ops 15 -> 16.

Unlike the five in the previous commit, this op has callers that pass the
buffer -- five, all in `op_tests` -- so after this change they exercise the
bypass and nothing exercises the routed path. Six tests restore that
coverage, each pinning WHICH path ran rather than that the call returned:

  * both spellings route when no buffer is named. `pa_fwd_asm` reads like a
    backend pin and is not: it predates the neutral name, so an ordinary call
    through it routes. Testing only `pa_fwd` would leave half the callers
    unrouted without anyone noticing.
  * naming `out_` bypasses, from either spelling.
  * `kernelName` bypasses on its own, kept separate from the `out_` reason so
    the two cannot be merged into one.
  * the buffered form returns the caller's buffer, asserted on `data_ptr`.
    A fake that allocates returns the right value while leaving that buffer
    unwritten; comparing values alone cannot see it.

Verified: `tests/test_plugin_contracts.py tests/test_plugin_routed_ops.py`
is 83 passed; `pa_fwd` appears in `torch.ops.aiter_routed` after a real
`import aiter`; `op_tests/test_pa_block_id_truncation.py`, which passes
`out_`, is 56 passed 8 skipped on gfx942. black and ruff clean.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

---------

Co-authored-by: zufayu <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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.

5 participants