Skip to content

fix(torch_guard): drop redundant aiter:: prefix from define schema for torch 2.13 - #4593

Merged
valarLip merged 2 commits into
mainfrom
fix/torch213-double-ns-qualname
Aug 6, 2026
Merged

valarLip merged 2 commits into
mainfrom
fix/torch213-double-ns-qualname

Conversation

@ZhangLirong-amd

@ZhangLirong-amd ZhangLirong-amd commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

aiter_lib=Library("aiter",...) already adds the ns, so a schema of "aiter::" makes torch>=2.13 store a doubled "aiter::aiter::" in _op_defs in 2.13.

Motivation

Technical Details

Test Plan

Test Result

Submission Checklist

@ZhangLirong-amd
ZhangLirong-amd requested review from a team and a lite review from Copilot August 6, 2026 05:50
@github-actions

github-actions Bot commented Aug 6, 2026

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:triton-300x Run an additional Triton test job on MI300X in PRs; main branch always runs both MI35X and MI300X
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: GPT-OSS-120B, DeepSeek-R1-0528, Kimi-K2.5
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 4593 --add-label <label>

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.

Pull request overview

Adjusts Torch op registration in torch_guard so that torch.library.Library("aiter", ...) does not end up defining ops with a doubled namespace (aiter::aiter::<op>) on torch>=2.13.

Changes:

  • Remove the redundant aiter:: prefix from the schema string passed to aiter_lib.define(...).
  • Add a clarifying comment documenting why the schema must be unqualified.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

aiter_lib=Library("aiter",...) already adds the ns, so a schema of
"aiter::<op>" makes torch>=2.13 store a doubled "aiter::aiter::<op>" in
_op_defs (2.12 stripped it). At shutdown _clear_torch_ops_cache does
qualname.split("::") expecting 2 parts and raises "too many values to
unpack". Pass the bare "<op>" to define(); impl()/_register_fake() keep
the qualified name. torch.ops.aiter.<op> is unchanged.
@ZhangLirong-amd
ZhangLirong-amd force-pushed the fix/torch213-double-ns-qualname branch from 55bcf7d to ed3572f Compare August 6, 2026 06:03
@valarLip
valarLip merged commit 86cc388 into main Aug 6, 2026
81 of 90 checks passed
@valarLip
valarLip deleted the fix/torch213-double-ns-qualname branch August 6, 2026 14:21
micah-wil added a commit that referenced this pull request Nov 4, 2026
AMD's whl-next index has torch 2.13.0+rocm10.0.0 and +rocm10.1.0 for
cp310 and cp312. The torch 2.13 op-name teardown crash behind the
torch<2.13 default was fixed in #4593. ROCm 7.14 stays on
2.12.0+rocm7.14.1 (2.13.0 exists only for ROCm 7.14.0).

Co-authored-by: Cursor <[email protected]>
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