@@ -9575,7 +9575,7 @@ static struct ggml_tensor * llm_build_rwkv6_time_mix(
9575
9575
struct ggml_tensor * cur,
9576
9576
struct ggml_tensor * x_prev,
9577
9577
struct ggml_tensor ** wkv_state) {
9578
- size_t n_embed = cur->ne[0];
9578
+ size_t n_embd = cur->ne[0];
9579
9579
size_t n_seq_tokens = cur->ne[1];
9580
9580
size_t n_seqs = cur->ne[2];
9581
9581
@@ -9586,8 +9586,8 @@ static struct ggml_tensor * llm_build_rwkv6_time_mix(
9586
9586
9587
9587
struct ggml_tensor * sx = ggml_sub(ctx, x_prev, cur);
9588
9588
9589
- sx = ggml_reshape_2d(ctx, sx, n_embed , n_tokens);
9590
- cur = ggml_reshape_2d(ctx, cur, n_embed , n_tokens);
9589
+ sx = ggml_reshape_2d(ctx, sx, n_embd , n_tokens);
9590
+ cur = ggml_reshape_2d(ctx, cur, n_embd , n_tokens);
9591
9591
9592
9592
struct ggml_tensor * xxx = ggml_add(ctx, ggml_mul(ctx, sx, layer->time_mix_lerp_x), cur);
9593
9593
@@ -9612,11 +9612,11 @@ static struct ggml_tensor * llm_build_rwkv6_time_mix(
9612
9612
xxx
9613
9613
);
9614
9614
9615
- struct ggml_tensor *mw = ggml_view_2d(ctx, xxx, n_embed , n_tokens, xxx->nb[1], 0);
9616
- struct ggml_tensor *mk = ggml_view_2d(ctx, xxx, n_embed , n_tokens, xxx->nb[1], n_embed * n_tokens * sizeof(float));
9617
- struct ggml_tensor *mv = ggml_view_2d(ctx, xxx, n_embed , n_tokens, xxx->nb[1], n_embed * n_tokens * 2 * sizeof(float));
9618
- struct ggml_tensor *mr = ggml_view_2d(ctx, xxx, n_embed , n_tokens, xxx->nb[1], n_embed * n_tokens * 3 * sizeof(float));
9619
- struct ggml_tensor *mg = ggml_view_2d(ctx, xxx, n_embed , n_tokens, xxx->nb[1], n_embed * n_tokens * 4 * sizeof(float));
9615
+ struct ggml_tensor *mw = ggml_view_2d(ctx, xxx, n_embd , n_tokens, xxx->nb[1], 0);
9616
+ struct ggml_tensor *mk = ggml_view_2d(ctx, xxx, n_embd , n_tokens, xxx->nb[1], n_embd * n_tokens * sizeof(float));
9617
+ struct ggml_tensor *mv = ggml_view_2d(ctx, xxx, n_embd , n_tokens, xxx->nb[1], n_embd * n_tokens * 2 * sizeof(float));
9618
+ struct ggml_tensor *mr = ggml_view_2d(ctx, xxx, n_embd , n_tokens, xxx->nb[1], n_embd * n_tokens * 3 * sizeof(float));
9619
+ struct ggml_tensor *mg = ggml_view_2d(ctx, xxx, n_embd , n_tokens, xxx->nb[1], n_embd * n_tokens * 4 * sizeof(float));
9620
9620
9621
9621
struct ggml_tensor * xw = ggml_add(
9622
9622
ctx,
@@ -9685,7 +9685,7 @@ static struct ggml_tensor * llm_build_rwkv6_time_mix(
9685
9685
)
9686
9686
);
9687
9687
9688
- w = ggml_add(ctx, w, ggml_reshape_1d(ctx, layer->time_mix_decay, n_embed ));
9688
+ w = ggml_add(ctx, w, ggml_reshape_1d(ctx, layer->time_mix_decay, n_embd ));
9689
9689
w = ggml_exp(ctx, ggml_neg(ctx, ggml_exp(ctx, w)));
9690
9690
w = ggml_reshape_4d(ctx, w, 1, head_size, head_count, n_tokens);
9691
9691
@@ -9694,21 +9694,21 @@ static struct ggml_tensor * llm_build_rwkv6_time_mix(
9694
9694
r = ggml_transpose(ctx, r);
9695
9695
9696
9696
struct ggml_tensor * wkv_output = ggml_rwkv_wkv(ctx, k, v, r, layer->time_mix_first, w, *wkv_state);
9697
- cur = ggml_view_1d(ctx, wkv_output, n_embed * n_tokens, 0);
9698
- *wkv_state = ggml_view_1d(ctx, wkv_output, n_embed * head_size * n_seqs, n_embed * n_tokens * sizeof(float));
9697
+ cur = ggml_view_1d(ctx, wkv_output, n_embd * n_tokens, 0);
9698
+ *wkv_state = ggml_view_1d(ctx, wkv_output, n_embd * head_size * n_seqs, n_embd * n_tokens * sizeof(float));
9699
9699
9700
9700
// group norm with head_count groups
9701
- cur = ggml_reshape_3d(ctx, cur, n_embed / head_count, head_count, n_tokens);
9701
+ cur = ggml_reshape_3d(ctx, cur, n_embd / head_count, head_count, n_tokens);
9702
9702
cur = ggml_norm(ctx, cur, 64e-5f);
9703
9703
9704
9704
// Convert back to regular vectors.
9705
- cur = ggml_reshape_2d(ctx, cur, n_embed , n_tokens);
9705
+ cur = ggml_reshape_2d(ctx, cur, n_embd , n_tokens);
9706
9706
cur = ggml_add(ctx, ggml_mul(ctx, cur, layer->time_mix_ln), layer->time_mix_ln_b);
9707
9707
9708
9708
cur = ggml_mul(ctx, cur, g);
9709
9709
cur = llm_build_lora_mm(lctx, ctx, layer->time_mix_output, cur);
9710
9710
9711
- return ggml_reshape_3d(ctx, cur, n_embed , n_seq_tokens, n_seqs);
9711
+ return ggml_reshape_3d(ctx, cur, n_embd , n_seq_tokens, n_seqs);
9712
9712
}
9713
9713
9714
9714
static struct ggml_tensor * llm_build_rwkv6_channel_mix(
0 commit comments