The RWKV-7 ("Goose") recurrence. Where RWKV-6 decays the state by a vector,
RWKV-7 applies a rank-1 update built from a and b alongside the
decay w, giving the state a richer transition.
ggml_rwkv_wkv7(ctx, r, w, k, v, a, b, state)A tensor [S * H, n_tokens + S * n_seqs]
GGML context
Receptance, [S, H, n_tokens]
Decay, [S, H, n_tokens]
Keys, [S, H, n_tokens]
Values, [S, H, n_tokens]
Removal (state update term), [S, H, n_tokens]
Addition (state update term), [S, H, n_tokens]
Initial state, S * S * H * n_seqs elements
r, w, k, v, a and b are
[S, H, n_tokens]; state holds S * S * H * n_seqs
elements. All must be contiguous. The result is
[S * H, n_tokens + S * n_seqs], outputs then final state -- see
ggml_rwkv_output.
n_tokens counts the tokens of all sequences together, so it
must be a multiple of n_seqs.
GGML_OP_RWKV_WKV7 has no backward pass in ggml.
ggml_rwkv_wkv6, ggml_rwkv_output
Other state-space:
ggml_gated_linear_attn(),
ggml_gated_linear_attn_back(),
ggml_rwkv_output(),
ggml_rwkv_wkv6(),
ggml_rwkv_wkv6_back(),
ggml_rwkv_wkv7_back(),
ggml_ssm_conv(),
ggml_ssm_conv_back(),
ggml_ssm_scan(),
ggml_ssm_scan_back(),
ggml_ssm_scan_output()