Go to file
ancient_rain fd035f6ba6
stale-issues / close-stale-issues (push) Has been cancelled Details
restore GroupCountFwdOp spec-only manifest
2026-08-04 11:44:53 +08:00
.claude [Feat][OPS] compile dispatch boundary; pool declarations; design-doc audit (#1757) 2026-07-26 10:36:34 +08:00
.foundry [Design] Trust-model rules become review lens; retire strict-mode auto-reject (#1424) 2026-05-11 18:16:25 +08:00
.github Update operator-manifest.en.md 2026-07-29 16:46:33 +08:00
3rdparty docs: add MetaX C500 summer-camp guide on top of upstream dev 2026-07-28 17:55:09 +00:00
assets [Doc] Add development doc and update readme (#75) 2026-01-05 09:14:25 +08:00
benchmarks docs: add MetaX C500 summer-camp guide on top of upstream dev 2026-07-28 17:55:09 +00:00
docs docs: simplify operator claim rules 2026-07-31 11:30:31 +08:00
scripts docs: add MetaX C500 summer-camp guide on top of upstream dev 2026-07-28 17:55:09 +00:00
tests docs: add MetaX C500 summer-camp guide on top of upstream dev 2026-07-28 17:55:09 +00:00
tileops restore GroupCountFwdOp spec-only manifest 2026-08-04 11:44:53 +08:00
workloads docs: add MetaX C500 summer-camp guide on top of upstream dev 2026-07-28 17:55:09 +00:00
.gitignore [Perf][Mamba] Tune SSD chunk state default tile config (#1512) 2026-05-21 19:44:28 +08:00
.gitmodules docs: add MetaX C500 summer-camp guide on top of upstream dev 2026-07-28 17:55:09 +00: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] move tileops-skills.md out of docs/design/ (#1108) 2026-04-29 11:01:38 +08:00
LICENSE docs: add MetaX C500 summer-camp guide on top of upstream dev 2026-07-28 17:55:09 +00:00
Makefile [Fix][CI] Install external baseline libraries in nightly benchmarks (#673) 2026-03-26 15:06:45 +08:00
README.en.md docs: add TileKernels-MACA operator migration list 2026-07-31 10:32:31 +08:00
README.md Update README.md 2026-07-31 10:44:34 +08:00
README.zh-CN.md docs: add TileKernels-MACA operator migration list 2026-07-31 10:32:31 +08:00
THIRD_PARTY_NOTICES.md [Perf][Linear-Attn] Add optimized Gated DeltaNet prefill op (#1596) 2026-07-07 21:10:18 +08:00
constraints.txt [CI] retire run-local venv across CI; install via image-baked stack (#1606) 2026-06-24 13:22:59 +08:00
pyproject.toml docs: add MetaX C500 summer-camp guide on top of upstream dev 2026-07-28 17:55:09 +00:00

README.en.md

简体中文 | English

TileOPs

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

Built on TileLang

Spec coverage Bench coverage

Installation | Quick Start | Docs

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

2026 Summer Camp

Summer-camp participants should use the summer-camp-2026 branch and follow the Chinese migration guide. The guide defines operator claiming, the two-PR Manifest/implementation workflow, MetaX GPU validation, benchmarking, Roofline evidence, and acceptance criteria; claimable projects are listed in the operator migration inventory.

We recommend renting online MetaX C500 compute through the Gitee AI Compute Marketplace and selecting the summer-camp image: PyTorch-Agent / 2.8.0 / Python 3.12 / MACA 3.7.1.5. See the detailed English guide for setup and environment self-check requirements.

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. Upstream TileOPs kernels declare their support range in NVIDIA architecture terms (Ampere, Hopper); this repository adds *_maca.py implementations for some operators, dispatched at the Op layer via is_maca(). See Operator availability on MetaX C500.

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 (tileops/manifest/) 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

An MXMACA-capable MetaX GPU is required at runtime.

Prerequisites

  • Python >= 3.10
  • PyTorch >= 2.1 (MetaX build, e.g. 2.8.0+metax3.7.1.3)
  • MetaX GPU: C500
  • TileLang: on MetaX, use the pre-built MACA version shipped in the container

[!WARNING] Inside a MetaX container, do not run make install, pip install tileops, or any pip command that resolves the tilelang dependency.

The container's TileLang is an in-place source build for MACA (e.g. /opt/tilelang-metax-v0.1.10), not a pip package — pip show tilelang finds nothing. pip therefore treats it as "not installed" and pulls the official CUDA wheel from the index into site-packages, shadowing the MACA build so kernels compile for the wrong backend.

For the same reason, do not use python3 -m venv without --system-site-packages: it cuts off the MetaX PyTorch build and the apache-tvm-ffi that libtilelang.so is ABI-coupled to.

Do not pass -c constraints.txt either. Those pins target the CUDA CI runner and would downgrade apache-tvm-ffi below what the in-place build was compiled against. Such a mismatch is invisible at import time and only fails when the first kernel compiles.

MetaX: use the container's pre-built TileLang

Nothing needs to be installed. Set PYTHONPATH and you are ready:

# Point at the container's pre-built MACA TileLang, plus this repository root
export PYTHONPATH=/opt/tilelang-metax-v0.1.10:/path/to/TileOPs-Metax:$PYTHONPATH

tileops imports without pip install; Manifest validation and tests run directly.

If you do need tileops registered in the environment (for example to run scripts from outside the repository), --no-deps is the only safe form:

python -m pip install -e . --no-deps --no-build-isolation

--no-deps is the essential part — it stops pip from resolving tilelang. The repository's CI uses exactly this form in scripts/ci/install_tileops.sh.

Verify:

# MetaX GPU status. If the output has a Sliced GPU section, the usable memory and compute
# are the slice quota, not the whole-card values shown in the first section
mx-smi
python --version
python -c "import torch; print(f'GPU available: {torch.cuda.is_available()}')"
# PyTorch must be the MetaX build (version string contains 'metax')
python -c "import torch; print(f'PyTorch {torch.__version__}')"
# TileLang must come from the container's MACA build, not a pip-installed CUDA wheel.
# The path should be under /opt/tilelang-metax-*; site-packages means it was overwritten
python -c "import tilelang; print(tilelang.__version__); print(tilelang.__file__)"
# The compilation backend must be maca, not cuda
python -c "from tilelang.utils.target import determine_target; print(determine_target('auto'))"
python -c "import einops; print('einops OK')"

Quick Start

import torch
from tileops.ops import GemmOp

M, N, K = 1024, 1024, 512

# GemmOp is input-inferred: m/n/k and dtype come from the forward inputs, so the
# constructor only declares layout. trans_b=False means B is stored [K, N];
# the default True corresponds to [N, K].
gemm = GemmOp(trans_a=False, trans_b=False)

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

C = gemm(A, B)          # [M, N]

[!NOTE] Set PYTHONPATH first (see Installation above).

On C500, GemmOp dispatches through is_maca() to tileops/kernels/gemm_maca.py. Not every operator has a MACA implementation — before picking an operator or a workload, read Operator availability on MetaX C500.

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.