Cherry pick weight_checker _weight_fp32 buffer skip from #22663 (#24534)

Co-authored-by: JD <jaedon.guo@gmail.com>
This commit is contained in:
fzyzcjy
2026-05-06 21:21:12 +08:00
committed by GitHub
co-authored by JD
parent 0d40931b08
commit 491051c622
+2 -1
View File
@@ -38,7 +38,7 @@ class WeightChecker:
def _reset_tensors(self):
for name, param in self._model_state():
if "cos_sin_cache" in name or "freqs_cis" in name:
if "cos_sin_cache" in name or "freqs_cis" in name or "_weight_fp32" in name:
continue
param.copy_(_random_like(param))
@@ -131,6 +131,7 @@ def _postprocess_tensors(
non_persistent_buffer_patterns = [
"cos_sin_cache", # RoPE cache
"inv_freq", # RoPE inverse frequency (if it exists as buffer)
"_weight_fp32", # FP32 cache of gate weight (e.g. Glm4MoeGate)
]
for name in raw: