Go to file
Cao Ying 6e0b507b42
[Refactor][Workloads] Align workloads/ops/ naming with tileops/ops/ layout (#939)
## Summary

Align `workloads/ops/` file naming and directory structure 1:1 with the
post-#928 `tileops/ops/` layout. Pure file-move/rename refactor — no
workload logic changes.

- Drop `_fwd` suffix from mamba, attention, deltanet, and gated_deltanet
workloads
- Rename `mean_pooling_ops.py` to `mean_pooling.py`
- Move attention workloads into `workloads/ops/attention/` subpackage
- Update all imports across the repo

Closes #931

## Test plan

- [x] **AC-1**: All `from workloads.ops.<name>` imports updated for
moved/renamed files — verified by importing all 20 renamed/moved
workload classes and grep confirming zero old import paths remain
- [x] **AC-2**: `python -c "from workloads.ops.attention import ..."`
resolves for all 15 moved attention workload classes
- [x] **AC-3**: Full test suite passes — 2361 passed, 22 skipped, 0
failed (233.76s at commit 4dc54b7)
- [x] **AC-4**: No orphaned files remain after migration — all 11 old
filenames confirmed absent; `mhc_post.py`, `mhc_pre.py` at
`workloads/ops/` root; `nsa_utils.py` at `workloads/` root

## Follow-up

No follow-up issues or suggestions.

---------

Co-authored-by: Ibuki 🍃 — a wind born from Claude Opus <Ibuki-wind@users.noreply.github.com>
2026-04-13 10:44:06 +08:00
.claude [Chore][Manifest] Enable bench_manifest_driven for 19 reduction ops (#882) 2026-04-10 18:06:36 +08:00
.foundry [Test][Softmax] Add non-aligned edge-case shapes for softmax-family ops (#914) 2026-04-12 11:17:34 +08:00
.github [Benchmark][CI] Resolve nightly perf history artifact lookup (#838) 2026-04-08 12:41:01 +08:00
assets [Doc] Add development doc and update readme (#75) 2026-01-05 09:14:25 +08:00
benchmarks [Refactor][Workloads] Align workloads/ops/ naming with tileops/ops/ layout (#939) 2026-04-13 10:44:06 +08:00
docs [Refactor][Workloads] Align workloads/ops/ naming with tileops/ops/ layout (#939) 2026-04-13 10:44:06 +08:00
scripts [Refactor][Benchmark] Extract ManifestBenchmark base class and shared helpers (#915) 2026-04-12 12:28:43 +08:00
tests [Refactor][Workloads] Align workloads/ops/ naming with tileops/ops/ layout (#939) 2026-04-13 10:44:06 +08:00
tileops [Refactor][Manifest] Update convolution kernel paths to flat module (#935) 2026-04-13 00:01:01 +08:00
workloads [Refactor][Workloads] Align workloads/ops/ naming with tileops/ops/ layout (#939) 2026-04-13 10:44:06 +08:00
.gitignore [Chore][Manifest] Add cleanup gate and orchestrator discipline to spec skills (#784) 2026-04-04 22:28:19 +08:00
.pre-commit-config.yaml [CI][Tooling] Unify issue and PR auto-labeling into a single workflow (#280) 2026-03-02 19:26:01 +08:00
CLAUDE.md [Doc][CI] Add commit message style guideline to CLAUDE.md (#806) 2026-04-06 19:31:10 +08:00
LICENSE [Chore] Update README, pre-commit hooks and reformat. (#82) 2026-01-05 18:20:15 +08:00
Makefile [Fix][CI] Install external baseline libraries in nightly benchmarks (#673) 2026-03-26 15:06:45 +08:00
README.md [Doc][TrustModel] Fix pipeline order, remove workflow.md (#793) 2026-04-05 20:52:39 +08:00
pyproject.toml [CI][Bench] Add flashinfer-python to benchmark dependencies (#721) 2026-04-03 11:23:44 +08:00

README.md

TileOPs

Spec-driven GPU operator library for LLMs — designed for AI agents to build, evaluate, and optimize

Built on TileLang

Installation | Quick Start | Docs

Status: TileOPs is under active development. APIs may change.

Overview

TileOPs is a GPU operator library for LLM training and inference, built on TileLang. Beyond providing a growing collection of production-quality operators, TileOPs explores a spec-driven development model where AI agents can read declarative operator specifications, generate kernel implementations, and evaluate them against hardware-theoretical performance bounds — with minimal human scaffolding.

Architecture

Every operator is split into two layers with a strict boundary:

  • Op (L2) — stateless Python entry point. Handles validation, dtype casting, and memory layout. Compatible with CUDA-Graph and torch.compile.
  • Kernel (L1) — TileLang GPU implementation with hardware-specific optimizations (Ampere, Hopper).

This separation keeps user-facing behavior independent of GPU strategy, allowing agents and developers to modify either layer without side effects on the other.

Key Properties

  • Spec-driven — each operator is declared in a machine-readable manifest (ops_manifest.yaml) that specifies signatures, workloads, and roofline formulas, serving as the entry point for both agent code generation and automated validation
  • Roofline-evaluated — kernel performance is measured against Speed-of-Light hardware bounds, not relative baselines
  • Auto-tuning — built-in search over tile sizes, pipelines, and scheduling parameters
  • Lightweight — depends only on TileLang, PyTorch, and einops

Installation

TileOPs can be installed from PyPI or built from source. A CUDA-capable GPU is required.

Prerequisites

  • Python >= 3.10
  • PyTorch >= 2.1
  • CUDA Toolkit
  • NVIDIA GPU: Hopper (SM_90)
  • TileLang == 0.1.8

From PyPI

pip install tileops

From source

git clone https://github.com/tile-ai/TileOPs
cd TileOPs
make install    # dev dependencies + pre-commit hooks

[!NOTE] If CUDA and TileLang are already installed system-wide and you encounter build issues: PIP_NO_BUILD_ISOLATION=1 pip install -e '.[dev]' -v && pre-commit install

Verify:

python -m pytest tests/ -q    # requires a CUDA GPU

Quick Start

import torch
from tileops.ops import GemmOp

M, N, K = 1024, 1024, 512
dtype = torch.float16

gemm = GemmOp(M, N, K, dtype=dtype)

A = torch.randn(M, K, device="cuda", dtype=dtype)
B = torch.randn(K, N, device="cuda", dtype=dtype)

C = gemm(A, B)

Documentation

Design docs and development guides are in docs/. The full API reference and performance tables are published at TileOPs.github.io.

Contributing

See docs/ for design docs. Branch and commit conventions are in .claude/conventions/types.sh.

License

TileOPs is released under the MIT License.