Archived
radiance 1.0.10
- Four-rank Qwen3.8-Flash-Next (PRs 14 and 16 by keptn42): the all-reduce runs fused with the hyper-connection's write, and with the MoE gather in front of it, on decode and verify steps on the exact wire. The routed experts are split in four classes, so every rank computes the same share; moe_gemm_q_mod4 is the new grouped GEMM. The oracle now checks moe_gemm_q on w4nl and w5nl containers. - --embedding-placement and --ngram-placement, each auto | vram | ram | disk. The token embedding can live in the pinned host pool, read in place over the link (from PR 17 by mechkbfan). An n-gram table can be copied into locked RAM at load instead of read from the container (from PR 15 by keptn42). auto takes the fastest tier with room once every other weight is placed, and startup prints what it chose and why. A tier that cannot be honoured stops the start with the reason; the embedding on disk and the n-gram table in VRAM are refused, since nothing can serve them. - The expert_tiered placement no longer spends the pinned host pool twice when it falls back to layer offload, and a lossy-wire request for a four-rank fused write is a selection miss rather than a startup abort.
This commit is contained in:
1 parent
2f56e3c477
commit
e466fa07e2
56 files changed
+1804
-761
No files matched your search
+27
-26
@@ -57,16 +57,19 @@ static const Flag g_flags[] = {
|
||||
{ "--vram-kv-mib", "N", "the paged KV pool; 0 derives it from the card" },
|
||||
{ "--kv-cache-dtype", "T", "bf16 | fp8 -- fp8 halves what a token of context costs" },
|
||||
{ "--host-pool-mib", "N", "pinned host tier" },
|
||||
{ "--host-weights", "NAMES", "embedding tables to keep in the pinned host pool, read in place\n"
|
||||
" over the link: comma-separated weight names, a trailing *\n"
|
||||
" matching a prefix (token_embd.weight)" },
|
||||
{ "--embedding-placement", "WHERE", "auto (default) | vram | ram: where the token embedding lives. ram\n"
|
||||
" keeps it in the pinned host pool, read over the link in place;\n"
|
||||
" auto keeps it on the card unless the KV cache could then not\n"
|
||||
" hold one --max-model-len sequence. disk is refused: the lookup\n"
|
||||
" writes the card's activations, which no host read can reach" },
|
||||
{ "--ngram-placement", "WHERE", "auto (default) | ram | disk: where an n-gram embedding table\n"
|
||||
" lives (Qwen3.8-Flash-Next: 47.7 GiB). disk reads its rows from\n"
|
||||
" the container; ram copies it into locked memory at load; auto\n"
|
||||
" takes ram when free memory, the memlock limit and the cgroup\n"
|
||||
" allow it. vram is refused: only a host kernel reads the table" },
|
||||
{ "--weights-disk-tier", nullptr, "read weights that fit neither VRAM nor the host pool from the\n"
|
||||
" container on disk (O_DIRECT); a routed expert is read a layer\n"
|
||||
" at a time, so a step is paced by the drive" },
|
||||
{ "--ngram-table", "MODE", "disk (default) or ram: where the n-gram embedding's host gather\n"
|
||||
" reads its rows. ram copies the table into locked host memory\n"
|
||||
" in the background from the first request and reads the copy\n"
|
||||
" (Qwen3.8-Flash-Next: 47.7 GiB; needs a memlock limit that large)" },
|
||||
{ "--prefix-cache-host-mib", "N", "copy finished conversations' KV to host memory, up to N MiB,\n"
|
||||
" so their VRAM can go to experts and a return restores\n"
|
||||
" instead of re-prefilling. 0 is off. Part of it holds\n"
|
||||
@@ -217,6 +220,17 @@ void config_usage(const char* argv0) {
|
||||
"benchmarks do not reproduce.\n");
|
||||
}
|
||||
|
||||
/* The four names exactly, lower case: what a table's placement costs is the operator's to state,
|
||||
* so a spelling this build does not know stops the server rather than picking a tier. */
|
||||
static bool parse_table_placement(const char* v, TablePlacement* out) {
|
||||
if (!std::strcmp(v, "auto")) *out = TablePlacement::Auto;
|
||||
else if (!std::strcmp(v, "vram")) *out = TablePlacement::Vram;
|
||||
else if (!std::strcmp(v, "ram")) *out = TablePlacement::Ram;
|
||||
else if (!std::strcmp(v, "disk")) *out = TablePlacement::Disk;
|
||||
else return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
static std::vector<std::string> split_commas(const std::string& s) {
|
||||
std::vector<std::string> out;
|
||||
size_t i = 0;
|
||||
@@ -384,30 +398,17 @@ int config_parse(int argc, char** argv, Config* c) {
|
||||
}
|
||||
}
|
||||
else if (S("--host-pool-mib")) { if (!(v = need(i))) return RAD_E_INVAL; c->host_pool_mib = atoll(v); }
|
||||
else if (S("--host-weights")) {
|
||||
else if (S("--embedding-placement") || S("--ngram-placement")) {
|
||||
const bool emb = S("--embedding-placement");
|
||||
if (!(v = need(i))) return RAD_E_INVAL;
|
||||
c->host_weights.clear();
|
||||
for (std::string p : split_commas(v)) {
|
||||
p.erase(0, p.find_first_not_of(" \t"));
|
||||
p.erase(p.find_last_not_of(" \t") + 1);
|
||||
if (p.empty() || p == "*") {
|
||||
RAD_ERR("--host-weights: '%s' is not a weight name", p.c_str());
|
||||
return RAD_E_INVAL;
|
||||
}
|
||||
c->host_weights.push_back(p);
|
||||
}
|
||||
if (c->host_weights.empty()) {
|
||||
RAD_ERR("--host-weights: no weight names in '%s'", v);
|
||||
TablePlacement p;
|
||||
if (!parse_table_placement(v, &p)) {
|
||||
RAD_ERR("%s takes auto, vram, ram or disk, not '%s'", a.c_str(), v);
|
||||
return RAD_E_INVAL;
|
||||
}
|
||||
(emb ? c->embedding_placement : c->ngram_placement) = p;
|
||||
}
|
||||
else if (S("--weights-disk-tier")) { c->weights_disk_tier = true; }
|
||||
else if (S("--ngram-table")) {
|
||||
if (!(v = need(i))) return RAD_E_INVAL;
|
||||
if (!std::strcmp(v, "disk")) c->ngram_table_ram = false;
|
||||
else if (!std::strcmp(v, "ram")) c->ngram_table_ram = true;
|
||||
else { RAD_ERR("--ngram-table takes disk or ram, not '%s'", v); return RAD_E_INVAL; }
|
||||
}
|
||||
else if (S("--prefix-cache-host-mib")) { if (!(v = need(i))) return RAD_E_INVAL; c->prefix_cache_host_mib = atoll(v); }
|
||||
else if (S("--prefix-cache-dir")) { if (!(v = need(i))) return RAD_E_INVAL; c->prefix_cache_dir = v; }
|
||||
else if (S("--prefix-cache-disk-mib")) { if (!(v = need(i))) return RAD_E_INVAL; c->prefix_cache_disk_mib = atoll(v); }
|
||||
|
||||
Reference in new issue
Block a user