We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7440cb4 commit 64d9ca1Copy full SHA for 64d9ca1
vllm/model_executor/layers/fused_moe/layer.py
@@ -1249,8 +1249,12 @@ def _maybe_make_contiguous(
1249
# do nothing.
1250
return p
1251
assert p.ndim == 3
1252
- p.data = torch.transpose(p.data, 1, 2)
1253
- return p
+ # Do not update the layer paramater as the layer's MoE operations would
+ # expect the parameter's tensor to the same shape / stride. Instead,
1254
+ # make a new torch.nn.Parameter that is used just in the context of
1255
+ # EPLB.
1256
+ return torch.nn.Parameter(torch.transpose(p.data, 1, 2),
1257
+ requires_grad=False)
1258
1259
weights = list(self.named_parameters())
1260
weights = [(name, _maybe_make_contiguous(name, p)) for name, p in weights]
0 commit comments