Skip to content

Commit

Permalink
Merge branch 'huggingface:main' into varlen
Browse files Browse the repository at this point in the history
  • Loading branch information
jiqing-feng authored Dec 12, 2024
2 parents b792875 + bb51139 commit 422134f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions optimum/exporters/ipex/modeling_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,9 +662,9 @@ def __init__(self, module, config) -> None:
if use_bias:
concat_bias = torch.concat(bias_list, 0).contiguous()
self.concat_linear.bias = nn.Parameter(concat_bias)
self.q_slice = self.q_proj.out_features
self.k_slice = self.q_slice + self.k_proj.out_features
self.v_slice = self.k_slice + self.v_proj.out_features
self.q_slice = self.q_proj.weight.shape[0]
self.k_slice = self.q_slice + self.k_proj.weight.shape[0]
self.v_slice = self.k_slice + self.v_proj.weight.shape[0]
if self.module_device.type == "cpu":
if module.o_proj.__class__.__name__ not in ["LinearAllreduce"]:
self.mha_linear_add = LinearAdd(module.o_proj)
Expand Down

0 comments on commit 422134f

Please sign in to comment.