A step of the mistr_native implementation. Called by mistr_mistral_block.
See the file header for the source the module follows.
Usage
mistr_grouped_query_attention(
Q,
K,
V,
n_heads,
n_kv_heads,
mask = NULL,
positions = NULL,
base = 10000
)Arguments
- Q
A matrix; passed to
as.matrix.- K
A matrix; passed to
as.matrix.- V
A matrix; passed to
as.matrix.- n_heads
A count; the body uses it as
seq_len(...).- n_kv_heads
Numeric; combined arithmetically in the body.
- mask
Optional; may be
NULL. A matrix; indexed by row and column.- positions
Optional; may be
NULL. A vector; its length is taken.- base
Passed to
mistr_apply_rope. Defaults to10000.
