Merge PR #559 (blange48, crazyaimachine): batch slots, pipelined layer split, parking with a split

Conflicts with 0.1.39: --trim-stage-weights is now the same switch as STRATA_STAGE_TRIM=1 (PR #639's
implementation, already in 0.1.39); the #533 VRAM command is taken between batch windows only when no slot
is decoding.
This commit is contained in:
Niko1221 committed 2026-10-03 23:29:40 +02:00
commit 89351a799d
17 files changed
+2021 -106

No files matched your search

+8 -2
View File
@@ -1,4 +1,5 @@
#include "strata/core/native_dense.hpp"
#include <cstdlib>
#include "strata/core/weights.hpp"
#include "strata/artifact/gguf_reader.hpp"
#include "strata/kernels/native_mmvq.hpp"
@@ -77,7 +78,12 @@ NativeDense::~NativeDense() {
}
bool NativeDense::load(const std::vector<std::string>& shards, WeightTable& table, std::string& err,
bool include_ple_key) {
bool include_ple_key, int64_t layer_lo, int64_t layer_hi) {
auto outside = [&](const std::string& name) { // a blk.<l>. tensor of another stage's layers
if (layer_hi < 0 || name.rfind("blk.", 0) != 0) return false;
const long l = std::strtol(name.c_str() + 4, nullptr, 10);
return l < layer_lo || l >= layer_hi;
};
if (scratch_ || !weights_.empty()) { err = "native dense: already loaded"; return false; }
if (shards.empty()) { err = "native dense: at least one GGUF shard is required"; return false; }
try {
@@ -146,7 +152,7 @@ bool NativeDense::load(const std::vector<std::string>& shards, WeightTable& tabl
}
}
for (const auto& tensor : gguf.tensors()) {
if (!eligible(tensor, include_ple_key)) continue;
if (!eligible(tensor, include_ple_key) || outside(tensor.name)) continue;
if (!in_range(tensor.name) && tensor.name.find("ple") == std::string::npos) continue;
if (!seen.insert(tensor.name).second) {
err = "native dense: duplicate tensor " + tensor.name; return false;