Skip to content

Commit e8a3e6d

Browse files
authored
[LLM:Bugfix] Pass calibration input IDs to AWQ position IDs (#4806)
1 parent 47a656e commit e8a3e6d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

transformers/llm/export/utils/awq_quantizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ def init_quant(self, n_samples=128, max_seq_len=512):
823823
new_tokens = 0
824824
best_device = AwqQuantizer.get_best_device()
825825
inps = self.model.embedding(samples).to(best_device)
826-
position_ids = self.model.get_position_ids(seq_len, new_tokens)
826+
position_ids = self.model.get_position_ids(seq_len, new_tokens, input_ids=samples)
827827
rotary_pos_emb = self.model.rotary(position_ids)
828828
attention_mask = self.model.get_attention_mask(seq_len, new_tokens)
829829
layer_kwargs["rotary_pos_emb"] = rotary_pos_emb.to(best_device)

0 commit comments

Comments
 (0)