Skip to content

Commit d646c9d

Browse files
ggerganovCISC
andauthored
convert : skip bias_vl tensor in DeepSeek-V4 DSpark conversion (ggml-org#28294)
* convert : skip bias_vl tensor in DeepSeek-V4 DSpark conversion The DFLASH arch does not include FFN_EXP_PROBS_B_VL, so the DSpark conversion failed when it tried to write the mtmd-only hash routing tensor ffn.gate.bias_vl. Drop it like the tid2eid tensor; the DFLASH draft only consumes ffn.gate.bias via FFN_EXP_PROBS_B. Assisted-by: pi:llama.cpp/DeepSeek-V4-Flash-0731 * cont : fix Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@huggingface.co> --------- Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@huggingface.co>
1 parent 5ec4eab commit d646c9d

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎conversion/deepseek.py‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,6 +1007,13 @@ def _map_dsv4_tensor_name(self, name: str, bid: int | None) -> tuple[gguf.MODEL_
10071007
return self._DSPARK_ROOT_MAP[name]
10081008
return super()._map_dsv4_tensor_name(name, bid)
10091009

1010+
def modify_tensors(self, data_torch: Tensor, name: str, bid: int | None) -> Iterable[tuple[str, Tensor]]:
1011+
# the DFlash draft uses the plain exp-probs bias (ffn.gate.bias -> FFN_EXP_PROBS_B);
1012+
# the mtmd-only hash routing tensors (bias_vl, tid2eid) are not part of the DFLASH arch
1013+
if name.endswith(".ffn.gate.bias_vl"):
1014+
return
1015+
yield from super().modify_tensors(data_torch, name, bid)
1016+
10101017
def set_vocab(self):
10111018
if self.target_model_dir is None:
10121019
raise ValueError("DeepSeek-V4 DSpark requires --target-model-dir with the target tokenizer")

0 commit comments

Comments
 (0)