[V1 Loader] Support DeepSeekV3(bf16) (#3294)

* Support new loader for DeepSeekV3(bf16)

* update paddle version

* remove useless attr
This commit is contained in:
Zero Rains
2025-08-11 13:39:28 +08:00
committed by GitHub
parent e0aeac58e1
commit 42af0b4b64
5 changed files with 141 additions and 5 deletions

View File

@@ -78,9 +78,13 @@ def default_weight_loader(fd_config: FDConfig) -> None:
if param.dtype != loaded_weight.dtype:
loaded_weight = loaded_weight.cast(param.dtype)
assert param.shape == loaded_weight.shape, (
f" Attempted to load weight ({loaded_weight.shape}) " f"into parameter ({param.shape})"
)
if param.shape != loaded_weight.shape:
try:
param = param.reshape(loaded_weight.shape)
except ValueError as e:
raise ValueError(
f" Attempted to load weight ({loaded_weight.shape}) into parameter ({param.shape}). {e}"
)
param.copy_(loaded_weight, False)
except Exception: