Skip to content

Commit d1d2c81

Browse files
committed
dflash: add support for qwen3.5/3.6 moe models
1 parent 28ad034 commit d1d2c81

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/models/qwen35moe.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,20 @@ llm_build_qwen35moe::llm_build_qwen35moe(const llama_model & model, const llm_gr
2626
for (int il = 0; il < n_layer; ++il) {
2727
ggml_tensor * inpSA = inpL;
2828

29+
// DFlash: Extract intermediate layer features from target model
30+
if (dflash && cparams.dflash_extract_enabled && !dflash->extract_layer_indices.empty()) {
31+
static const char * dflash_extract_names[] = {
32+
"dflash_extract_0", "dflash_extract_1", "dflash_extract_2",
33+
"dflash_extract_3", "dflash_extract_4"
34+
};
35+
for (size_t i = 0; i < dflash->extract_layer_indices.size() && i < 5; ++i) {
36+
if (dflash->extract_layer_indices[i] == il) {
37+
cb(inpL, dflash_extract_names[i], il);
38+
break;
39+
}
40+
}
41+
}
42+
2943
cur = build_norm(inpL, model.layers[il].attn_norm, nullptr, LLM_NORM_RMS, il);
3044
cb(cur, "attn_norm", il);
3145

0 commit comments

Comments
 (0)