Skip to content

[Plugin] Import drop_presort_on_error, which fused_moe already uses - #8179

Merged
gyohuangxin merged 1 commit into
mainfrom
opus/fix-drop-presort-import
Nov 18, 2026
Merged

gyohuangxin merged 1 commit into
mainfrom
opus/fix-drop-presort-import

Conversation

@zufayu

@zufayu zufayu commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Summary

import aiter.fused_moe raises on main. One name is used as a decorator but not imported.

What happens

#8075 added @drop_presort_on_error to the routed custom op in aiter/fused_moe.py:2824. The import block at line 74 lists only drop_presort_after. Both are defined side by side in aiter/presorted_moe.py (lines 220 and 238); only one was listed.

aiter/fused_moe.py:2824: in <module>
    @drop_presort_on_error
NameError: name 'drop_presort_on_error' is not defined

import aiter still works, because aiter/__init__.py does not import fused_moe. So this surfaces only for callers that reach the module -- which includes tests/test_plugin_routed_ops.py. That file fails during collection, so the plugin suite cannot run on main at all.

Testing

  • import aiter.fused_moe succeeds
  • pytest tests/test_plugin_routed_ops.py tests/test_plugin_contracts.py -- 77 passed (collection error gone)
  • black --check clean
  • ruff check clean

Documentation

  • No documentation change is needed; this restores an import the file already depends on.

Dependencies

  • No new third-party dependencies added

Breaking Changes

None. This only makes an existing decorator resolvable.

🤖 Generated with Claude Code

`aiter/fused_moe.py` gained `@drop_presort_on_error` on the routed custom op
in #8075, but the import block below it lists only `drop_presort_after`.
Importing the module therefore raises at decoration time:

    aiter/fused_moe.py:2824: in <module>
        @drop_presort_on_error
    NameError: name 'drop_presort_on_error' is not defined

`import aiter` still works -- `aiter/__init__.py` does not import `fused_moe`
-- so this surfaces only for callers that reach the module, which includes
`tests/test_plugin_routed_ops.py`. That file now fails during collection, so
the plugin suite cannot run on main at all.

Both names are defined side by side in `aiter/presorted_moe.py`; only one
was listed.

Verified: `import aiter.fused_moe` succeeds, and
`tests/test_plugin_routed_ops.py tests/test_plugin_contracts.py` is 77 passed.
black and ruff clean.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@zufayu
zufayu requested a review from a team November 18, 2026 09:37
@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 8179 --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

Copy link
Copy Markdown

WAITING ON AUTHOR

PR Self-Review

Revision 8288a2866028 · 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 is the most important boundary or failure mode introduced by this change, and what evidence covers it?
  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.

@gyohuangxin
gyohuangxin merged commit a6c759b into main Nov 18, 2026
@gyohuangxin
gyohuangxin deleted the opus/fix-drop-presort-import branch November 18, 2026 09:51
ZLkanyo009 added a commit that referenced this pull request Nov 18, 2026
…n route

aiter/fused_moe.py conflicted with three main commits:

- #8075 (ee71544) routes fused_moe_ through the kernel plugin interface
  and decorates the public fused_moe with drop_presort_after instead of
  drop_presort_on_error. Taken as is. fused_moe_'s _eager_body is now the
  plugin's routed wrapper, so the eager call that skips the torch.ops
  dispatch still asks the providers first; the plan cache and scratch sort
  sit below the route, in the native body. The op test checks that the
  directly called body is the fused_moe route.
- #7135 (ca7cfa1) sizes the config lookup by config_M / config_topk
  (_config_shape). The plan's recorded get_2stage_cfgs arguments use them,
  and a call with _config_shape takes no plan, like one with
  _stage2_override.
- #8179 (a6c759b) imports drop_presort_on_error again; taken as is.
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.

4 participants