Repository navigation
[Triton/Gluon] Import tests and benchmarks through the categorized paths - #5093
Conversation
`_BACKWARD_COMPAT_MAP` in aiter/ops/triton/__init__.py exists for old external
callers; in-tree code is required to import from the categorized path. Five
sites still went through the flat compat names:
aiter.ops.triton.causal_conv1d -> ...conv.causal_conv1d
aiter.ops.triton.causal_conv1d_update_single_token -> ...conv....
aiter.ops.triton.mha -> ...attention.mha
aiter.ops.triton import extend_attention, -> ...attention import ...
prefill_attention
Each target was resolved from _BACKWARD_COMPAT_MAP and every imported symbol
verified to exist there. The import blocks move section because ruff's isort
classifies the compat names as third party (no such file exists) and the real
modules as first party.
The two `test_legacy_gluon_import_path_warns` tests keep their legacy strings --
they assert the shim still warns.
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
PR title tags: |
There was a problem hiding this comment.
Pull request overview
This PR updates Triton/Gluon test and benchmark modules to import ops via the categorized package paths (e.g., aiter.ops.triton.conv.*, aiter.ops.triton.attention.*) instead of legacy flat imports under aiter.ops.triton.*, aligning call sites with the repository’s required folder/import structure.
Changes:
- Update conv test imports to use
aiter.ops.triton.conv.*categorized paths. - Update attention benchmark imports to use
aiter.ops.triton.attention.*categorized paths. - Minor import reordering/spacing to keep third-party imports grouped separately from project imports.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| op_tests/triton_tests/conv/test_causal_conv1d.py | Switches causal conv1d imports to aiter.ops.triton.conv.causal_conv1d and normalizes import grouping. |
| op_tests/triton_tests/conv/test_causal_conv1d_update_single_token.py | Switches PAD_SLOT_ID / update-single-token imports to categorized aiter.ops.triton.conv.* modules. |
| op_tests/op_benchmarks/triton/bench_fav3_sage.py | Switches flash_attn_func import to aiter.ops.triton.attention.mha categorized path. |
| op_tests/op_benchmarks/triton/bench_extend_attention.py | Switches imports to aiter.ops.triton.attention submodules for extend/prefill attention. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
Suppressed comments (1)
op_tests/op_benchmarks/triton/bench_fav3_sage.py:17
- This benchmark directly imports and calls an internal kernel module (
aiter.ops.triton._triton_kernels...). Repo convention is that_triton_kernels/entry points are launched only from the public wrapper layer underaiter.ops.triton.*; tests/benchmarks should call the wrapper API instead (e.g.aiter.ops.triton.attention.mha_v3.flash_attn_fp8_func(...)/flash_attn_func(...)).
import aiter
from aiter.ops.triton._triton_kernels.flash_attn_triton_amd import flash_attn_3
from aiter.ops.triton.attention.fav3_sage import (
No description provided.