engine: a pack folder without native_experts.txt says so before the AVX-512 refusal (#2347)

The refusal 'this CPU cannot run the expert kernel' belongs to the canonical Q2_0 pack. An NVFP4, i-quant or
Unsloth pack is a native pack (native_experts.txt in the --pack folder) and its rows have AVX2 kernels, but a
config whose --pack points at the wrong folder reads like a CPU that is too old. On a CPU without AVX-512 the
engine now says the file is missing, and where it sits when it is one level down (<pack>/pack).
This commit is contained in:
Niko1221 committed 2026-10-14 07:02:11 +02:00
1 parent b8ec9bbf94
commit ed7c7f339d
1 file changed
+21 -2
+21 -2
View File
@@ -2896,8 +2896,27 @@ int main(int argc, char** argv) {
}
}
// the canonical Q2_0 pack's CPU kernels are AVX-512 only; a native pack runs on AVX2 CPUs as well
if (!native_pack) strata::kernels::cpu::cpu_require_expert_support();
else if (!strata::kernels::cpu::cpu_avx512_ok())
if (!native_pack) {
// #2347: an NVFP4 / i-quant / Unsloth pack IS a native pack and runs on an AVX2 CPU (its rows have AVX2
// kernels). This refusal is the canonical Q2_0 pack's, reached when the --pack folder has no
// native_experts.txt - a hand-written config pointing --pack at the wrong folder reads as "this CPU is too
// old". Say so before the refusal, and where the file is when it sits one level down (a pack/ subfolder).
if (!strata::kernels::cpu::cpu_features().usable()) {
std::error_code ec;
const std::filesystem::path pk(o.pack);
std::fprintf(stderr, "strata generate: %s has no native_experts.txt, so it is read as the canonical Q2_0 "
"pack, whose CPU kernel needs AVX-512.\n"
" An NVFP4, i-quant or Unsloth pack has that file in the folder given as --pack "
"and runs on an AVX2 CPU as well;\n",
o.pack.c_str());
if (std::filesystem::exists(pk / "pack" / "native_experts.txt", ec))
std::fprintf(stderr, " it is in %s: use that folder as --pack.\n", (pk / "pack").generic_string().c_str());
else
std::fprintf(stderr, " if this is one of those packs, the folder is incomplete or the wrong one "
"(setup writes it; run setup again).\n");
}
strata::kernels::cpu::cpu_require_expert_support();
} else if (!strata::kernels::cpu::cpu_avx512_ok())
std::fprintf(stderr, "strata generate: this CPU has no AVX-512: the expert kernels run on %s "
"(multi-token for the i-quant gate/up rows)\n",
!strata::kernels::cpu::cpu_avx2_ok()