diff --git a/src/program/generate.cpp b/src/program/generate.cpp index ba00f94d..770468e0 100644 --- a/src/program/generate.cpp +++ b/src/program/generate.cpp @@ -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()