Archived
n-gram table: --ngram-table ram reads it from a locked copy in RAM
embed_lookup_q reads the n-gram table through a row cache and direct reads, and about half of a step's rows are first-seen, so steps wait on the drive. --ngram-table ram (default disk, unchanged) copies the table into locked huge pages in the background, checks the copy against the mapping and then serves the gather from memory. MemAvailable, RLIMIT_MEMLOCK and the cgroup limit are checked first; if any is short the table stays on disk. The flag reaches the plugin as an optional `resident` parameter of embed_lookup_q.
This commit is contained in:
1 parent
4252353bc2
commit
e6c8a3d7fa
18 files changed
+363
-56
No files matched your search
@@ -595,6 +595,9 @@ struct Geom {
|
||||
* message anyway. Straight through to `all_reduce`'s `min_bytes`; 0 leaves the choice to
|
||||
* the kernel plugin, which has the measured default. */
|
||||
int64_t wire_min_bytes = 0;
|
||||
/* 1 = keep a file-backed table a host gather reads in RAM (--ngram-table ram). Straight
|
||||
* through to `embed_lookup_q`'s `resident`; RadBuildCtx says what it costs and buys. */
|
||||
int ngram_ram = 0;
|
||||
float eps = 1e-6f;
|
||||
/* GemmaRMSNorm's `1 +`. Qwen3.5, Qwen3-Next and Gemma normalise with `x_hat * (1 + w)` and
|
||||
* store `w` around 0.1, not around 1.0 -- so reading the gain as a plain RMSNorm gain shrinks
|
||||
@@ -732,6 +735,7 @@ inline int geom_from(Geom& g, const RadModelMeta* m, const RadBuildCtx* c,
|
||||
g.world = c->world_size ? c->world_size : 1;
|
||||
g.wire_exact= c->tp_wire_lossy ? 0 : 1;
|
||||
g.wire_min_bytes = c->tp_wire_min_bytes;
|
||||
g.ngram_ram = c->ngram_table_ram ? 1 : 0;
|
||||
g.eps = m->rms_eps;
|
||||
g.theta = m->rope_theta;
|
||||
g.rope_scale= m->rope_scale ? m->rope_scale : 1.0f;
|
||||
|
||||
Reference in new issue
Block a user