TileOPs-Metax/docs
Ang Gao c2e98526de
[Feat][Ops] Infer shape metadata from op inputs (#1651)
## Summary

Closes #1648.

This updates the initial #1648 scope so derivable shape metadata is
inferred from op inputs instead of being required as constructor
arguments:

- Norm family: `FusedAddLayerNormFwdOp`, `FusedAddRMSNormFwdOp`,
`AdaLayerNormFwdOp`, `AdaLayerNormZeroFwdOp`
- Scan family: `CumsumFwdOp`, `CumprodFwdOp`
- MoE leaf ops: `FusedTopKOp`, `MoePermuteNopadFwdOp`

The old explicit constructor arguments remain supported as
compatibility/strict-validation commitments, while the preferred API
derives `M`, `N`, token counts, top-k shape, hidden size, and dtype from
the input tensors at `forward()` time. Kernels are built lazily and
cached by the inferred specialization.

## Manifest / callers

- Removed input-derivable `static_dims` from the affected norm and scan
manifest entries.
- Updated `MoePermuteNopadFwdOp` manifest params/workloads/roofline to
treat `hidden_states` and `topk_ids` shapes as the source of truth,
keeping `num_experts` explicit.
- Updated direct benchmarks and composite call sites to use the
preferred input-inferred APIs.
- Added compatibility and cache-reuse/changing-shape test coverage.

## Testing

Using the TileOpsGov runner image
`ghcr.io/tile-ai/tileops-runner:65dbc98-torch2.10` on H200 GPU:

- `python -m pytest -q tests/ops/test_cumulative.py
tests/ops/test_fused_add_layer_norm.py
tests/ops/test_fused_add_rms_norm.py tests/ops/test_ada_layer_norm.py
tests/ops/test_ada_layer_norm_zero.py tests/ops/test_moe_fused_topk.py
tests/ops/test_moe_permute_nopad.py -m smoke --tb=short --timeout=900
--timeout-method=thread`
  - `67 passed, 52 deselected, 14 warnings`
- `python -m pytest -q tests/ops/test_cumulative.py
tests/ops/test_fused_add_layer_norm.py
tests/ops/test_fused_add_rms_norm.py tests/ops/test_ada_layer_norm.py
tests/ops/test_ada_layer_norm_zero.py tests/ops/test_moe_fused_topk.py
tests/ops/test_moe_permute_nopad.py --tb=short --timeout=900
--timeout-method=thread`
  - `119 passed, 14 warnings`
- `python scripts/validate_manifest.py`
  - `All manifest checks passed`

Note: the validator reports an advisory warning that
`MoePermuteNopadFwdOp.num_experts` has an `__init__` default of `None`
while the manifest has no default. This is intentional to preserve old
positional construction compatibility; `forward()` still requires
`num_experts` to be provided.
2026-07-06 17:51:47 +08:00
..
design [Feat][Ops] Infer shape metadata from op inputs (#1651) 2026-07-06 17:51:47 +08:00
perf [Doc][Trace] Doc-ready docstrings + in-kernel timeline tutorial (#1640) 2026-06-30 13:27:07 +08:00
README.md [Refactor][Skill] review-tileops prompt: trim redundancy, fold verify into Task (#1127) 2026-04-30 23:44:14 +08:00
known-issues.md [Doc] introduce docs/known-issues.md with logical reduction perf entry (#1452) 2026-05-14 17:19:50 +08:00
tileops-skills.md [Feat][Manifest] strict parity CI for status: implemented ops (#1292) 2026-05-08 17:33:05 +08:00

README.md

TileOPs Documentation

Design-first, spec-driven documentation for TileOPs. tileops/manifest/ and the documents below are the authoritative spec; code conforms to the spec, not the other way around.

Design

Document Scope
architecture.md System modules (M1M8), data flow, agent production loop, directory structure.
manifest.md tileops/manifest/ spec: signature, workloads, roofline fields, source.
ops-design.md Op interface execution guide — how to add a new op.
ops-design-reference.md Op interface detail reference: interface tables, codegen, naming, protocol.
roofline.md tileops/manifest/ roofline field spec: performance model, authoring, and per-consumer contracts (validator, benchmark, M5, op codegen).

Process

Document Scope
trust-model.md Trust boundaries between manifest → test → implementation → benchmark; workloads layer contract.
testing.md Test and benchmark framework: core abstractions, tolerances, reporting rules.
tileops-skills.md Developer decision guide: which repo-provided skill to use for which task, with composition diagram.

Performance Guides

Empirical performance guidance lives under perf/. Each op category has a checklist plus the evidence backing it.

External

  • TileOPs.github.io — auto-generated documentation site (API reference, perf tables, support matrix).