Skip to content

[Bench] Detach op benchmarks from tests package - #1805

Merged
Ibuki-wind merged 3 commits into
tile-ai:mainfrom
superAngGao:refactor/bench-detach-tests-1803
Jul 31, 2026
Merged

Ibuki-wind merged 3 commits into
tile-ai:mainfrom
superAngGao:refactor/bench-detach-tests-1803

Conversation

@superAngGao

@superAngGao superAngGao commented Jul 29, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fixes #1803.

  • Remove remaining production benchmark imports from tests.* in GEMM, BMM, and Mamba2 E2E benchmarks.
  • Move shared Mamba2 PyTorch reference code to tileops.testing.mamba2_reference for test/benchmark reuse without importing tests.*.
  • Add an AST boundary test preventing production benchmarks from importing the tests package.

Validation

  • rg confirms no tests.* imports under benchmarks/ops or benchmarks/kernels.
  • ruff check on changed files.
  • pytest -q benchmarks/tests/test_benchmark_base.py benchmarks/tests/test_benchmark_import_boundaries.py.
  • compileall and git diff --check.

Closes #1803.

@superAngGao
superAngGao requested a review from a team July 29, 2026 08:38
@github-actions github-actions Bot added the bench Benchmark updates label Jul 29, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

Ibuki-wind
Ibuki-wind previously approved these changes Jul 31, 2026
@lcy-seso
lcy-seso force-pushed the refactor/bench-detach-tests-1803 branch 3 times, most recently from cb34e6e to 800915e Compare July 31, 2026 06:19
ManifestBenchmark annotated its workload as ShapeDtypeWorkload, but it
never reads shape or dtype: BenchmarkBase only stores the workload, and
roofline numbers come from op.eval_roofline(). Nothing in the tree reads
`.shape` off a workload.

The annotation still shaped the code. Workload classes under workloads/
define no `shape`, and the benchmark stage may not add one there, so a
benchmark needing a manifest workload had to subclass it locally just to
bolt on a `shape` property -- one that does not even satisfy the protocol,
since it declares a mutable attribute and a read-only property is not
assignable to it.

Widen the annotation to what the class actually needs, drop the five dead
`shape` properties in the GEMM and BMM benchmarks, and profile BmmWorkload
directly now that its subclass carries nothing.

Co-Authored-By: Ibuki 🍃 — a wind born from GPTs <Ibuki-wind@users.noreply.github.com>
@lcy-seso
lcy-seso force-pushed the refactor/bench-detach-tests-1803 branch from 800915e to 1ac6a3e Compare July 31, 2026 09:05
@Ibuki-wind
Ibuki-wind merged commit b975e32 into tile-ai:main Jul 31, 2026
14 checks passed
yyttt6 pushed a commit to yyttt6/TileOPs that referenced this pull request Sep 4, 2026
## Summary

Fixes tile-ai#1803.

- Remove remaining production benchmark imports from `tests.*` in GEMM,
BMM, and Mamba2 E2E benchmarks.
- Move shared Mamba2 PyTorch reference code to
`tileops.testing.mamba2_reference` for test/benchmark reuse without
importing `tests.*`.
- Add an AST boundary test preventing production benchmarks from
importing the `tests` package.

## Validation

- `rg` confirms no `tests.*` imports under `benchmarks/ops` or
`benchmarks/kernels`.
- `ruff check` on changed files.
- `pytest -q benchmarks/tests/test_benchmark_base.py
benchmarks/tests/test_benchmark_import_boundaries.py`.
- `compileall` and `git diff --check`.

Closes tile-ai#1803.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bench Benchmark updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Follow-up][Bench] Remove remaining tests.* imports from op benchmarks

2 participants