Skip to content

Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.

C++

dsv41: Strata AVX2 i-quant rows opt-in (DS4_GG_IQ256=1) until the engine A/B

Niko122120fed551ba2c
diff --git a/src/dsv41/ds4_gg_cpu.cpp b/src/dsv41/ds4_gg_cpu.cpp
index 4f5a46d64..a1ea5cf6e 100644
--- a/src/dsv41/ds4_gg_cpu.cpp
+++ b/src/dsv41/ds4_gg_cpu.cpp
@@ -74,7 +74,7 @@ void gg_cpu_quant(int act, const float* x, int k, void* dst) {
}
// Strata's AVX2 multi-token rows for the i-quants (iq256_rows: each 32-value chunk decoded once, every token applies it;
-// the integer sums are ggml's, only the float additions come in another order). DS4_GG_IQ256=0: ggml-cpu's row dots.
+// the integer sums are ggml's, only the float additions come in another order). Opt-in until the end-to-end A/B is done: DS4_GG_IQ256=1.
static int g_iq256 = -1; // -1: from the environment and the CPU, 0 off, 1 on
void gg_cpu_set_iq256(int mode) { g_iq256 = mode; }
static bool use_iq256(int type) {
@@ -85,7 +85,7 @@ static bool use_iq256(int type) {
__builtin_cpu_init();
avx2 = __builtin_cpu_supports("avx2") && __builtin_cpu_supports("fma") && __builtin_cpu_supports("f16c");
#endif
- g_iq256 = avx2 && (v == nullptr || std::atoi(v) != 0) ? 1 : 0;
+ g_iq256 = avx2 && v != nullptr && std::atoi(v) != 0 ? 1 : 0;
}
return g_iq256 == 1 && strata::kernels::cpu::iq256_supported(type);
}
diff --git a/src/dsv41/ds4_gguf_cpu.hpp b/src/dsv41/ds4_gguf_cpu.hpp
index e9e093f15..9eb00f810 100644
--- a/src/dsv41/ds4_gguf_cpu.hpp
+++ b/src/dsv41/ds4_gguf_cpu.hpp
@@ -52,7 +52,7 @@ bool gg_cpu_fmt(int tg, int td, int n_embd, int n_ff, IqCpu& f, std::string& err
void gg_cpu_quant(int act, const float* x, int k, void* dst);
void gg_cpu_gate_up(const IqCpu& f, const uint8_t* gate, const uint8_t* up, const void* const* act, int nt, float* const* ff,
int r0, int r1, float limit);
-/// -1: i-quant rows from Strata's AVX2 kernels when the CPU has AVX2 (DS4_GG_IQ256=0 turns it off), 0 ggml-cpu, 1 forced (benches).
+/// -1: from the environment (DS4_GG_IQ256=1 turns Strata's AVX2 i-quant rows on, default off), 0 ggml-cpu, 1 forced (benches).
void gg_cpu_set_iq256(int mode);
void gg_cpu_down(const IqCpu& f, const uint8_t* down, const void* const* hq, int nt, float* const* out, int r0, int r1);