attention_softmax — LLMCORE attend op

• Data kinds: tokens × tokens × tokens → tokens

• Call: import fullseye as fs; fs.ledger.attention_softmax(query, key, value, mask=None, window=None, scale=None) -> 'np.ndarray' (implementation को सीधे call करना हो तो import llmcore; llmcore.attention_softmax(query, key, value, mask=None, window=None, scale=None) -> 'np.ndarray', registry से लेना हो तो opsllmcore.get("attention_softmax"))

उपयोग

एक बार में attention (reference implementation) → tokens। इस family के मिलान का आधार।

(T, T) score matrix को सच में बनाकर फिर softmax करना, लिखने का सबसे सीधा तरीका। attention_tiled / attention_linear / attention_grouped इससे मेल खाकर अपनी सही होने को दिखाते हैं।

Args:

query: (T, d) float।

key: (S, d) float।

value: (S, dv) float।

mask: None / "causal" / "window" / (T, S) का bool array।

window: mask="window" होने पर window की चौड़ाई।

scale: score का गुणक। None हो तो 1/√d।

Returns:

tokens (T, dv) float: attention से मिलाई गई sequence।

उपयोग की विस्तृत guide

• llmcore family guide

संदर्भ (sample data, साहित्य)

• Sample data catalog (DL URL / license) — 2-D के लिए skimage.data (BSD/public) + synthetic, 3-D के लिए real data sources (Stanford/PDS आदि) के DL URL।

• Operators का स्रोत और संदर्भ — इस op family के मूल research/methods के स्रोत।

• Algorithm का मानक स्रोत (लेखक, वर्ष) और उपयोग ऊपर की family usage guide में दिए गए हैं।

चलाए जा सकने वाले उदाहरण (verified samples जो सच में यह op call करते हैं)

• poc_attention_identities — py -3.11 examples/poc_attention_identities.py

वे अगले ops जिनसे type जुड़ता है (tokens को input के रूप में लेते हैं)

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

इसी category के (attend)

attention_tiled · attention_linear · attention_grouped


*Provenance: llmcore.py — LLMCORE operator registry. यह per-op note tools/opdocs.py md से अपने-आप generate होता है (हाथ से edit न करें)।*

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