MCPcopy Create free account
hub / github.com/Niko1221/Strata / eligible

Function eligible

engine/src/core/native_dense.cpp:180–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178 return out;
179}
180bool eligible(const strata::TensorInfo& tensor, bool include_ple_key) {
181 const auto& name = tensor.name;
182 if (name.rfind("blk.", 0) != 0) return false;
183 // Match the native PLE kernel: Q2_0, IQ3_XXS, IQ4_XS and Q8_0 (UD-Q4_K_XL). Other keys retain the packed BF16
184 // fallback.
185 if (name == "blk.1.ple_key.weight")
186 return include_ple_key && (tensor.type == 42 || tensor.type == 18 || tensor.type == 23 || tensor.type == 8);
187 static const char* suffixes[] = {".attn_qkv.weight", ".attn_gate.weight", ".ssm_out.weight",
188 ".attn_q.weight", ".attn_k.weight", ".attn_v.weight", ".attn_output.weight",
189 ".ffn_gate_shexp.weight", ".ffn_up_shexp.weight", ".ffn_down_shexp.weight",
190 // Include the split MLA query and KV projection weights.
191 ".attn_q_a.weight", ".attn_q_b.weight", ".attn_kv_a_mqa.weight",
192 ".ffn_gate.weight", ".ffn_up.weight", ".ffn_down.weight",
193 ".ffn_routed_down.weight", ".ffn_routed_up.weight",
194 ".hc_attn_fn.weight", ".hc_ffn_fn.weight",
195 ".indexer.attn_q_b.weight", ".indexer.attn_k.weight", ".indexer.proj.weight",
196 ".indexer_compressor_gate.weight", ".indexer_compressor_value.weight",
197 ".engram_kv.weight", ".nextn.eh_proj.weight"};
198 for (const char* suffix : suffixes) if (name.ends_with(suffix)) return true;
199 return false;
200}
201// #4741: a native-eligible projection a pack keeps unquantized (BF16, GGUF type 30; Heretic v2 IQ4_NL has its layer-0 attn_gate so)
202// has no native kernel. Its siblings are Q8_0, so it is served as Q8_0 made from the file's BF16 values (ggml's rounding), and
203// the dispatchers that need a native projection find one. The pack's BF16 copy stays where it is.

Callers 5

served_namesMethod · 0.70
weight_bytes_forMethod · 0.70
loadMethod · 0.70
prefill.cppFile · 0.50
mainFunction · 0.50

Calls

no outgoing calls

Tested by 1

mainFunction · 0.40