vocabulary: hc_project -- a control vector's direction, projected out of the wide stream

h[s] -= scale * (h[s] . v) * v        for each of the hyper-connection streams s

llama.cpp's --cvec-mode project semantics: the dot is per stream, because the patch applies it to
the [n_embd, hc, tokens] view where mul_mat(v, cur) reduces over dim 0. v is one layer's unit
direction (f32), scale is the norm its file stored, and 'on' is a per-row int32 switch: a zero row
is skipped without a read or a write, so an unprojected request is byte-identical to a deployment
with no vector loaded.

libref is the oracle and the host fallback, libavx carries it at every ISA level, libr4d (one
workgroup per (row, stream), LDS reduction) serves the card. docs/OPS.md gains the row and the
operation's three facts.
This commit is contained in:
C_Tamas authored and StillDeadcode committed 2026-10-21 09:26:17 +02:00
1 parent 64adee3ece
commit 459dd4f42d
14 files changed
+362 -11

No files matched your search

+2
View File
@@ -339,6 +339,7 @@ int r4d_rad_dflash_select (const RadArgs*, RadStream);
/* -- the gated residual (r4d_hc_bf16.hip) -- */
int r4d_rad_hc_enter (const RadArgs*, RadStream);
int r4d_rad_hc_project (const RadArgs*, RadStream);
int r4d_rad_mhc_pre(const RadArgs*, RadStream);
int r4d_rad_mhc_pre_partial(const RadArgs*, RadStream);
int r4d_rad_mhc_pre_finish(const RadArgs*, RadStream);
@@ -751,6 +752,7 @@ int r4d_shape_mhc_contract(const RadParam*, int, int, RadOpdDesc*);
int r4d_shape_mtp_enter (const RadParam*, int, int operand, RadOpdDesc*);
int r4d_shape_hc_read (const RadParam*, int, int operand, RadOpdDesc*);
int r4d_shape_hc_write (const RadParam*, int, int operand, RadOpdDesc*);
int r4d_shape_hc_project (const RadParam*, int, int operand, RadOpdDesc*);
int r4d_shape_binary (const RadParam*, int, int operand, RadOpdDesc*);
int r4d_shape_mul_weight (const RadParam*, int, int operand, RadOpdDesc*);
int r4d_shape_scatter_rows_bf16(const RadParam*, int, int operand, RadOpdDesc*);