public class GroupedQueryAttention implements AutoClosable
Stateful single-sequence causal grouped-query attention on the selected CPU/GPU. Query projection interleaves a query and sigmoid gate per head. Keys/queries use zero-centered RMS normalization and partial text rotary embeddings. KV caches and linear-size score scratch stay resident on that device. Create one instance per layer and independent sequence; concurrent use is not supported.
attention = GroupedQueryAttention(16l, 4l, 256l, 2048l, 64l)
| Modifier and Type | Member | Description |
|---|---|---|
| public readonly property | positionposition as Long |
Number of tokens already appended. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | GroupedQueryAttention | Allocates sequence-owned caches. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | closeclose() as Void |
Releases device caches while preserving host values. |
| public | step | Appends one projected token and computes attention into a reusable buffer. |