attention_tiled — LLMCORE attend op

• Data kinds: tokens × tokens × tokens → tokens

• Call: import fullseye as fs; fs.ledger.attention_tiled(query, key, value, tile: 'int' = 64, mask=None, window=None, scale=None) -> 'np.ndarray' (to call the implementation directly, import llmcore; llmcore.attention_tiled(query, key, value, tile: 'int' = 64, mask=None, window=None, scale=None) -> 'np.ndarray'; from the registry, opsllmcore.get("attention_tiled"))

Usage

Attention with tiles + online softmax (the core of FlashAttention) → tokens. Not an approximation.

Dao et al. 2022. Reads key/value tile rows at a time and adds them up while correcting the running maximum and denominator on the spot. The only intermediate matrix it builds is (T, tile); (T, T) is never built — the speed comes not from approximation but from where things are kept. The relative difference from attention_softmax is 1.2e-15 even with 128 tiles (8.2e-16 with 1 tile, so 128 times as many tiles gives only 1.5 times the difference).

Args:

query: (T, d) float.

key: (S, d) float.

value: (S, dv) float.

tile: number of key/value rows read at once. Smaller means a smaller intermediate matrix and more tiles.

mask: None / "causal" / "window" / (T, S) bool array.

window: window width when mask="window".

scale: score multiplier. None means 1/√d.

Returns:

tokens (T, dv) float: matches attention_softmax to machine precision.

Detailed usage guide

• llmcore family guide

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Runnable examples (verified samples that actually call this op)

• poc_attention_identities — py -3.11 examples/poc_attention_identities.py

Ops the type connects to (they accept tokens as input)

rms_norm · rope_rotate · attention_scores · attention_apply · attention_softmax · attention_linear · attention_grouped · kv_cache_decode

Same category (attend)

attention_softmax · attention_linear · attention_grouped


*Provenance: llmcore.py — LLMCORE operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.