[Core] Set linear_weights directly on the layer (#3977)

This commit is contained in:
Antoni Baum
2024-04-11 13:35:51 -07:00
committed by GitHub
parent 8afca50889
commit a10d3056da
8 changed files with 114 additions and 102 deletions

View File

@@ -73,7 +73,7 @@ def test_mixtral_moe(dtype: torch.dtype):
).cuda()
# Load the weights
vllm_moe.gate.linear_weights["weight"][:] = hf_moe.gate.weight.data
vllm_moe.gate.weight.data[:] = hf_moe.gate.weight.data
for i in range(config.num_local_experts):
weights = (hf_moe.experts[i].w1.weight.data,
hf_moe.experts[i].w3.weight.data)