diff --git a/core/server/dashboard.cpp b/core/server/dashboard.cpp index 64626724..320c3d05 100644 --- a/core/server/dashboard.cpp +++ b/core/server/dashboard.cpp @@ -3061,7 +3061,7 @@ async function identify() { } catch (err) { /* the header simply keeps its placeholder */ } } -/* THE SPEED PROJECTION, asked when the Model view opens. It is not a polled value: it changes only +/* THE CONTROL VECTOR, asked when the Model view opens. It is not a polled value: it changes only * when this page (or an admin call) flips it, and a control that silently reverted under the * reader would be worse than one that is a second old. A deployment without a control vector * answers 404 and the panel stays hidden. */ diff --git a/docs/GUIDE.md b/docs/GUIDE.md index 27e4a55f..d577e51f 100644 --- a/docs/GUIDE.md +++ b/docs/GUIDE.md @@ -1456,7 +1456,7 @@ the `control_vector` request field with nothing else to configure; every quantis shares it, because the file names the architecture and the width, not the quant. The operation's parameters come from the package's own JSON (`layer_range`, `scale`, `mode`), so there is no flag for them either: a file that does not fit this container is reported and skipped, never served. The -default for *requests* stays off in all cases. +default for *requests* is off at startup. - **Only a compatible container accepts it.** The file must be a GGUF `controlvector` whose `controlvector.model_hint` (when present) is this model's architecture (`qwen4exp`), whose diff --git a/libavx/README.md b/libavx/README.md index 1b713975..a3391c46 100644 --- a/libavx/README.md +++ b/libavx/README.md @@ -123,11 +123,11 @@ engine would load. It checks, in order: schema agreement (a copy of the loader's before any arithmetic, because the loader refuses the whole plugin on one disagreement), coverage, the numbers, and every ISA level. Each level prints: - 522 checked, 522 passed, 0 failed, 0 declined, 0 skipped, 0 missing. worst rel_l2 = 3.556e-04 + 807 checked, 807 passed, 0 failed, 0 declined, 0 skipped, 0 missing. worst rel_l2 = 3.556e-04 worst case: rmsnorm M=3 n=645 eps=1e-05 dtype=bf16 wadd=1 - 522 rerun on 4 threads, byte for byte - hand-built: 198 checked, 0 failed - zero rows: 116 ops checked, 0 failed + 807 rerun on 4 threads, byte for byte + hand-built: 429 checked, 0 failed + zero rows: 155 ops checked, 0 failed against `rad-kbench`'s tolerance table, ids (i32, u32, i64 outputs) exactly; the worst case differs per level. Every conversion is also checked exhaustively: all 256 or 65536 bit patterns of each diff --git a/libr4d/r4d_hc_bf16.hip b/libr4d/r4d_hc_bf16.hip index fb7b2217..1e3ffb46 100644 --- a/libr4d/r4d_hc_bf16.hip +++ b/libr4d/r4d_hc_bf16.hip @@ -1,4 +1,5 @@ -// r4d_hc_bf16.hip -- the gated residual (hyper-connections): hc_enter, hc_read and hc_write. +// r4d_hc_bf16.hip -- the gated residual (hyper-connections): hc_enter, hc_read, +// hc_write and hc_project. // // Qwen4-Exp carries a residual stream `hc` times the model width, with no pre-norm and no residual // add: every block reads a data-dependent mix of the hc sub-streams and writes its output back into diff --git a/libr4d/r4d_rows.cpp b/libr4d/r4d_rows.cpp index 822d32ff..67d2d63b 100644 --- a/libr4d/r4d_rows.cpp +++ b/libr4d/r4d_rows.cpp @@ -477,9 +477,6 @@ static const RadOperandSpec oGdnConvRecurrentUpdate[] = { { "o_scale", RAD_OPD_OUT, 1 }, }; -/* The gated residual. `hc_enter` and `hc_write` share a parameter list; `hc_read` adds the two - * switches its operand list depends on: `inject` 0 is the final mixer and `group` 0 a read whose - * consumer wants bf16. Both default on, as every trunk connection uses both. */ /* The control vector's projection (r4d_hc_bf16.hip, with the other gated-residual kernels): a bf16 * stream, one unit f32 direction for every stream, an int32 switch per row. */ static const RadParamSpec pHcProject[] = { P_INT("M"), P_INT("n"), P_INT("hc"), P_F64("scale"), @@ -490,6 +487,9 @@ static const RadOperandSpec oHcProject[] = { static const RadConstraint cHcProject[] = { C_GE("M", 1), C_GE("n", 1), C_GE("hc", 2), C_LE("hc", 8), C_IN("dtype", "bf16"), }; +/* The gated residual. `hc_enter` and `hc_write` share a parameter list; `hc_read` adds the two + * switches its operand list depends on: `inject` 0 is the final mixer and `group` 0 a read whose + * consumer wants bf16. Both default on, as every trunk connection uses both. */ static const RadParamSpec pHcPlain[] = { P_INT("M"), P_INT("n"), P_INT("hc"), P_STR("dtype"), }; diff --git a/tests/projection_test.cpp b/tests/projection_test.cpp index 343d4685..98d149a4 100644 --- a/tests/projection_test.cpp +++ b/tests/projection_test.cpp @@ -14,8 +14,9 @@ * documents: h -= scale * (h . v) v per hyper-connection stream, and an untouched row where * the mask is 0. * - * The kernel parity check (libavx against libref, and libr4d on a card) is rad-kbench's - * `hc_project` case (libavx/avx_cases.cpp); this file pins the meaning. + * The kernel parity check (libavx against libref) is libavx/avx_cases.cpp, fed to rad-avx-check; + * libr4d's device kernel has no in-tree parity case yet (the rad-kbench fixture is still missing). + * This file pins the meaning. */ #include "rad_test.h" @@ -27,7 +28,6 @@ #include #include #include -#include #include #include @@ -132,8 +132,8 @@ TEST(the_derivation_refuses_a_buffer_too_small) { TEST(the_reference_projection_removes_the_direction_per_stream) { /* Directly the operation the package's README states, on a synthetic stream: after one - * application every stream's component along v is scale * |d| times what it was, and with a - * unit direction at the stored scale 1 the projection is exactly h -= (h.v) v. */ + * application every stream's component along v is (1 - scale) times what it was, and with a + * unit direction at the stored scale 1 it is exactly zero, i.e. h -= (h.v) v. */ const int64_t n = 8, hc = 2, rows = 2; std::vector h((size_t) (rows * hc * n)); std::vector v((size_t) n); diff --git a/tests/server_test.cpp b/tests/server_test.cpp index b1311b3c..882fcbd5 100644 --- a/tests/server_test.cpp +++ b/tests/server_test.cpp @@ -4570,6 +4570,18 @@ TEST(the_control_vector_field_overrides_the_default_or_is_refused) { CHECK_EQ(r2.status, 200); CHECK(f.sched.last_sp.use_control_vector); + /* Both spellings in one body: the field's own name wins over Strata's alias, whichever + * order the parser happens to read them in. */ + HttpResponse r3 = f.post("/v1/chat/completions", + R"({"messages":[{"role":"user","content":"hi"}], + "max_tokens":4, + "experimental_speed_projection":true, + "control_vector":false})"); + if (r3.streaming()) drain(r3); + f.sched.join_all(); + CHECK_EQ(r3.status, 200); + CHECK(!f.sched.last_sp.use_control_vector); + const HttpResponse g = f.get("/admin/control-vector"); CHECK_EQ(g.status, 200); CHECK(g.body.find("\"default\":true") != std::string::npos);