mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2026-09-04 02:37:27 +02:00
convert : skip bias_vl tensor in DeepSeek-V4 DSpark conversion (#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 <[email protected]> --------- Co-authored-by: Sigbjørn Skjæret <[email protected]>
This commit is contained in:
co-authored by
Sigbjørn Skjæret
parent
5ec4eab69e
commit
d646c9d155
@@ -1007,6 +1007,13 @@ class DeepseekV4DSparkModel(DeepseekV4Model):
|
|||||||
return self._DSPARK_ROOT_MAP[name]
|
return self._DSPARK_ROOT_MAP[name]
|
||||||
return super()._map_dsv4_tensor_name(name, bid)
|
return super()._map_dsv4_tensor_name(name, bid)
|
||||||
|
|
||||||
|
def modify_tensors(self, data_torch: Tensor, name: str, bid: int | None) -> Iterable[tuple[str, Tensor]]:
|
||||||
|
# the DFlash draft uses the plain exp-probs bias (ffn.gate.bias -> FFN_EXP_PROBS_B);
|
||||||
|
# the mtmd-only hash routing tensors (bias_vl, tid2eid) are not part of the DFLASH arch
|
||||||
|
if name.endswith(".ffn.gate.bias_vl"):
|
||||||
|
return
|
||||||
|
yield from super().modify_tensors(data_torch, name, bid)
|
||||||
|
|
||||||
def set_vocab(self):
|
def set_vocab(self):
|
||||||
if self.target_model_dir is None:
|
if self.target_model_dir is None:
|
||||||
raise ValueError("DeepSeek-V4 DSpark requires --target-model-dir with the target tokenizer")
|
raise ValueError("DeepSeek-V4 DSpark requires --target-model-dir with the target tokenizer")
|
||||||
|
|||||||
Reference in New Issue
Block a user