Merge perf-PR group cuda86 (f-145-pp-cuda86)

This commit is contained in:
Niko1221 committed 2026-10-16 10:46:42 +02:00
commit 5a6f4ed5fb
39 files changed
+4686 -186

No files matched your search

+15
View File
@@ -3427,6 +3427,15 @@ int main(int argc, char** argv) {
std::fprintf(stderr, "strata generate: layer split: CUDA0 loads the dense weights of layers 0-%lld only\n",
(long long) split_at[0] - 1);
}
// STRATA_HC_REQ8=1 (opt-in, changes the output): the hyper-connection projections are not loaded as BF16;
// load_hc_q8 below requantizes them to int8 + an fp32 scale per 32 values (~0.56x the bytes), and the freed VRAM
// goes to the expert cache like any other. (Upstream's STRATA_HC_Q8 is a different thing: the GGUF's Q8_0 bytes.)
const bool hc_req8_env = std::getenv("STRATA_HC_REQ8") != nullptr && std::atoi(std::getenv("STRATA_HC_REQ8")) != 0;
if (hc_req8_env && multi_gpu)
std::fprintf(stderr, "strata generate: WARNING: STRATA_HC_REQ8 does not support a layer split yet - the BF16 "
"projections are used\n");
const bool hc_q8 = hc_req8_env && !multi_gpu;
if (hc_q8) strata::core::WeightTable::hc_q8_names(g.n_layers, skip);
uint64_t pool_bytes = 0;
if (!strata::core::WeightTable::pool_bytes(o.pack, pool_bytes, err, skip.empty() ? nullptr : &skip)) {
std::fprintf(stderr, "strata generate: %s\n", err.c_str());
@@ -3476,6 +3485,12 @@ int main(int argc, char** argv) {
std::fprintf(stderr, "strata generate: %s\n", err.c_str());
return 1;
}
if (hc_q8) {
uint64_t qb = 0;
if (!wt.load_hc_q8(o.pack, qb, err)) { std::fprintf(stderr, "strata generate: %s\n", err.c_str()); return 1; }
std::fprintf(stderr, "strata generate: STRATA_HC_REQ8: hyper-connection projections as int8 + fp32/32 scales, "
"%llu MiB\n", (unsigned long long) (qb >> 20));
}
std::fprintf(stderr, "strata generate: %llu MiB of weights loaded from %s in %.1f s (%zu canonical tensors "
"skipped: served natively)\n",
(unsigned long long) (pool_bytes >> 20), o.pack.c_str(), load_s(), skip.size());