Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/SETTINGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ A number or a word is set like any environment variable, for example `STRATA_KVA
(`terminal/strata-<model>.json`), which the server passes to the engine. The Strata project's Terminal writes it there with
`strata launch --set NAME=value`.

## Switches you can turn on (368)
## Switches you can turn on (369)

Off unless you set them. The last column says where each one is described.

Expand Down Expand Up @@ -265,6 +265,7 @@ Off unless you set them. The last column says where each one is described.
| `STRATA_PIPELINE_DEBUG` | on / off | NVIDIA and AMD, Intel Arc | [MULTI_GPU.md](MULTI_GPU.md) |
| `STRATA_PIPE_ADAPT_EVERY` | text | NVIDIA and AMD | [BATCHING.md](BATCHING.md), [release-notes-0.2.7.md](release-notes-0.2.7.md) |
| `STRATA_PIPE_BYIELD_NODRAIN` | on / off | NVIDIA and AMD | [BATCHING.md](BATCHING.md) |
| `STRATA_PLE_CACHE_ROWS` | number | NVIDIA and AMD, Mac | - |
| `STRATA_PLE_COMPACT` | on / off | NVIDIA and AMD | [DETAILS.md](DETAILS.md) |
| `STRATA_PLE_COPY_STREAM` | on / off | NVIDIA and AMD | [DETAILS.md](DETAILS.md) |
| `STRATA_POLY_PIN_WORKERS` | on / off | NVIDIA and AMD | [GLM.md](GLM.md) |
Expand Down
1 change: 1 addition & 0 deletions engine/metal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ if(STRATA_METAL_POLY)
add_executable(strata-poly ${S}/poly/main.cpp ${S}/poly/engine.cpp ${S}/poly/basinkv.cpp ${S}/poly/qwen35.cpp ${S}/poly/qwen4.cpp
${S}/poly/gemma4.cpp ${S}/poly/lfm2moe.cpp ${S}/poly/glm5next.cpp ${S}/poly/deepseek4.cpp ${S}/poly/flint.cpp
${S}/poly/kolibri1.cpp ${S}/poly/inkling2.cpp ${S}/poly/inkling2_pictures.cpp ${S}/poly/cpu_experts.cpp ${S}/poly/spill.cpp ${S}/platform/memory.cpp
${S}/ngram/ple_reader.cpp ${S}/platform/direct_file.cpp ${S}/platform/io_priority.cpp
${S}/core/conversation_memory.cpp ${S}/core/conversation_file.cpp ${S}/spec/draft_policy.cpp
${S}/spec/suffix_drafter.cpp)
# the CPU experts' rows and the tensor types read on the host are the Strata quant layer's: no ggml
Expand Down
3 changes: 3 additions & 0 deletions engine/src/poly/engine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ struct Options {
///< step()); 0: one sequence
bool batch_mtp = false; ///< step() takes a guess beside each sequence's token (steps_guesses())
bool all_logits = false; ///< size wlogits_ / Mmq::work for sliced eval_all_logits()
int ple_direct = -1; ///< Qwen4 PLE table I/O: -1 = auto (direct when host RAM < table + 8 GiB),
///< 0 = force mmap (--ple-mmap), 1 = force direct PleReader (--ple-direct)
uint64_t ple_cache_rows = 1048576; ///< Qwen4 PleReader row cache capacity in rows (0 disables; STRATA_PLE_CACHE_ROWS)
};

/// A thing a model's file may call by other names than the engine does: converters differ.
Expand Down
25 changes: 25 additions & 0 deletions engine/src/poly/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2233,6 +2233,10 @@ void usage() {
" into --cold-lut / pool; else pins into pinned memory or locked file pages\n"
" --cold-lut repack RAM-resident cold experts into T-MAC bit-plane LUT format at load\n"
" --cold-q2-lut quantize and repack RAM-resident cold experts into 2-bit T-MAC LUT format\n"
" --ple-direct Qwen4: read the PLE n-gram table with unbuffered direct I/O + bounded row cache\n"
" (STRATA_PLE_DIRECT=1; default: auto when host RAM < table + 8 GiB;\n"
" STRATA_PLE_CACHE_ROWS sets row cache size, default 1048576, 0 disables)\n"
" --ple-mmap Qwen4: force memory-mapped PLE table I/O (STRATA_PLE_DIRECT=0)\n"
" --prompt-batch N prompt tokens read at a time (default 1024); about 1.4 MiB of VRAM each\n"
" --stage-mib N VRAM the experts outside the cache pass through in a prompt batch (default\n"
" 128 on an NVIDIA card where a longer read widens it, else 2048; never more\n"
Expand Down Expand Up @@ -2389,6 +2393,25 @@ int main(int argc, char** argv) {
bool stagger = false; // --check-stagger
std::string images, pinned, pin_dir;
std::vector<int32_t> ids, eos, follow;
if (const char* v = std::getenv("STRATA_PLE_DIRECT"); v && *v) {
std::string s(v);
for (char& c : s) c = (char) std::tolower((unsigned char) c);
if (s == "1" || s == "on" || s == "true") o.ple_direct = 1;
else if (s == "0" || s == "off" || s == "false") o.ple_direct = 0;
else if (s == "auto") o.ple_direct = -1;
else std::fprintf(stderr, "strata-poly: unknown STRATA_PLE_DIRECT=%s (expected 0, 1 or auto); using auto\n", v);
}
if (const char* v = std::getenv("STRATA_PLE_CACHE_ROWS"); v && *v) {
char* end = nullptr;
const unsigned long long n = v[0] == '-' ? 0ULL : std::strtoull(v, &end, 10);
if (v[0] == '-' || end == v || *end != '\0' || n > (1ULL << 26)) {
std::fprintf(stderr,
"strata-poly: bad STRATA_PLE_CACHE_ROWS=%s (expected 0..67108864); using default %llu\n",
v, (unsigned long long) o.ple_cache_rows);
} else {
o.ple_cache_rows = (uint64_t) n;
}
}
for (int i = 1; i < argc; ++i) {
const std::string a = argv[i];
auto val = [&]() -> const char* {
Expand Down Expand Up @@ -2426,6 +2449,8 @@ int main(int argc, char** argv) {
else if (a == "--lock-experts") o.lock_experts = true;
else if (a == "--cold-lut") o.cold_lut = true;
else if (a == "--cold-q2-lut") o.cold_q2_lut = true;
else if (a == "--ple-direct") o.ple_direct = 1;
else if (a == "--ple-mmap") o.ple_direct = 0;
else if (a == "--no-graphs") o.graphs = false;
else if (a == "--kv-whole") o.kv_grow = false;
else if (a == "--kv-resident") o.kv_resident = std::atoi(val());
Expand Down
Loading
Loading