Skip to content

Commit fd4e8b0

Browse files
justinchubyCopilot
andcommitted
Force Qwen MoE reference to float32
Materialize all floating reference parameters and buffers as float32 after loading the exact dequantized GGUF values. Copilot-Session: ad2de961-a4dc-4ed1-b9c4-ac9a826214cb Co-authored-by: Copilot App <[email protected]> Signed-off-by: Justin Chu <[email protected]>
1 parent 3c44fe2 commit fd4e8b0

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎tests/gguf_small_model_runtime_integration_test.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,12 +495,11 @@ def _load_qwen35moe_same_value_reference(
495495
state_dict = {name: value.float() for name, value in state_dict.items()}
496496

497497
hf_config = AutoConfig.from_pretrained(repository, revision=revision)
498-
hf_config.dtype = torch.float32
499498
reference = AutoModelForCausalLM.from_config(hf_config)
500499
missing, unexpected = reference.load_state_dict(state_dict, assign=True)
501500
assert not missing
502501
assert not unexpected
503-
return reference.eval()
502+
return reference.to(dtype=torch.float32).eval()
504503

505504

506505
def _run_promoted_ort(

0 commit comments

Comments
 (0)