Skip to content

[Feat][Ops]: BmmFwdOp: manifest + kernel/op + tests + bench (fp16/bf16/fp8) #1663

Description

@RuneFang

Parent Issue

Sub-issue of #400.

I'd be happy to implement the next two operators.

Task Type

  • Manifest / Spec (required for any public Op)
  • Kernel / Op Implementation
  • Correctness Tests / Workloads
  • Benchmark / Performance

Description

Track the BMM slice of #400. The 2 nominal ops listed there (bmm_fp16, bmm_fp8) map to 2 TileOPs ops, following the same input-inferred / call-time-JIT design as GemmOp:

nominal op Realized as Scope
bmm_fp16 BmmFwdOp (fp16 + bf16) this issue
bmm_fp8 BmmFp8Op (fp8, epilogue-scale + block-scaled paths) follow-up sub-issue

Semantics (settled):

  • Strict torch.bmm contract — 3D×3D only, a=[B, M, K], b=[B, K, N]d=[B, M, N]. No batch-dim broadcasting, no matmul-style shape promotion.
  • Transpose-free primary layout matching torch.bmm inputs; NT / other layouts are separate manifest entries if demand appears.
  • Fully input-inferred: batch, m, n, k, and dtype are read from a / b at forward() time; nothing pinned at construction. Roofline binds these dims via func mode.
  • Reference API: torch.bmm. Dtype coverage: float16, bfloat16. Accumulation in float32.

Checklist

  • Public Op has a tileops/manifest/ entry (or updates an existing entry).
  • Manifest signature declares inputs, outputs, params, shape rules, and dtype coverage.
  • Manifest workloads declare benchmark shapes/dtypes; unit-test edge cases are not generated from manifest workloads.
  • Manifest roofline is present and consumable by op.eval_roofline().
  • Manifest source declares kernel, op, test, bench, and source.kernel_map when dispatching kernels.
  • Op constructor, forward(), and default_kernel_map match the manifest entry.
  • Tests use an independent reference implementation and cover relevant FP16/BF16 and edge cases.
  • Benchmarks consume manifest workloads and record at least one non-tileops baseline unless explicitly justified.
  • PR title and commits follow the current [Feat][Scope] / [Perf][Scope] / [Fix][Scope] convention.
  • Implementation follows Google Python Style for code and docstrings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions