huggingface / peft

🤗 PEFT: State-of-the-art Parameter-Efficient Fine-Tuning.
https://huggingface.co/docs/peft
Apache License 2.0
16.46k stars 1.62k forks source link

Unaligned blit request with RoBERTa #2069

Closed vrmer closed 3 weeks ago

vrmer commented 2 months ago

System Info

System: MacBook M1 Pro (MPS)

accelerate==0.33.0 peft==0.12.0 torch==2.4.1 transformers==4.44.0

Who can help?

No response

Information

Tasks

Reproduction

I have trained a LoRA adapter using MPS for both the BERT and RoBERTa models but while I can easily load the BERT LoRA after training, when loading it with RoBERTa, I get the following error messages:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/IC18EG/PycharmProjects/probing_shv/src/attribution.py", line 111, in <module>
    model = PeftModelForSequenceClassification.from_pretrained(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Caskroom/miniforge/base/envs/probing_shv/lib/python3.11/site-packages/peft/peft_model.py", line 545, in from_pretrained
    model.load_adapter(
  File "/opt/homebrew/Caskroom/miniforge/base/envs/probing_shv/lib/python3.11/site-packages/peft/peft_model.py", line 1117, in load_adapter
    load_result = set_peft_model_state_dict(
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Caskroom/miniforge/base/envs/probing_shv/lib/python3.11/site-packages/peft/utils/save_and_load.py", line 395, in set_peft_model_state_dict
    load_result = model.load_state_dict(peft_model_state_dict, strict=False)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Caskroom/miniforge/base/envs/probing_shv/lib/python3.11/site-packages/torch/nn/modules/module.py", line 2215, in load_state_dict
    raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for PeftModelForSequenceClassification:
    While copying the parameter named "base_model.model.roberta.embeddings.LayerNorm.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.0.attention.self.query.base_layer.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.0.attention.self.key.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.0.attention.self.value.base_layer.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.0.attention.output.dense.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.0.attention.output.LayerNorm.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.0.intermediate.dense.bias", whose dimensions in the model are torch.Size([3072]) and whose dimensions in the checkpoint are torch.Size([3072]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.0.output.dense.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.0.output.LayerNorm.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.1.attention.self.query.base_layer.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.1.attention.self.key.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.1.attention.self.value.base_layer.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.1.attention.output.dense.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.1.attention.output.LayerNorm.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.1.intermediate.dense.bias", whose dimensions in the model are torch.Size([3072]) and whose dimensions in the checkpoint are torch.Size([3072]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.1.output.dense.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.1.output.LayerNorm.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.2.attention.self.query.base_layer.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.2.attention.self.key.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.2.attention.self.value.base_layer.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.2.attention.output.dense.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.2.attention.output.LayerNorm.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.2.intermediate.dense.bias", whose dimensions in the model are torch.Size([3072]) and whose dimensions in the checkpoint are torch.Size([3072]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.2.output.dense.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.2.output.LayerNorm.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.3.attention.self.query.base_layer.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.3.attention.self.key.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.3.attention.self.value.base_layer.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.3.attention.output.dense.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.3.attention.output.LayerNorm.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.3.intermediate.dense.bias", whose dimensions in the model are torch.Size([3072]) and whose dimensions in the checkpoint are torch.Size([3072]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.3.output.dense.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.3.output.LayerNorm.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.4.attention.self.query.base_layer.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.4.attention.self.key.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.4.attention.self.value.base_layer.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.4.attention.output.dense.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.4.attention.output.LayerNorm.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.4.intermediate.dense.bias", whose dimensions in the model are torch.Size([3072]) and whose dimensions in the checkpoint are torch.Size([3072]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.4.output.dense.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.4.output.LayerNorm.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.5.attention.self.query.base_layer.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.5.attention.self.key.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.5.attention.self.value.base_layer.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.5.attention.output.dense.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.5.attention.output.LayerNorm.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.5.intermediate.dense.bias", whose dimensions in the model are torch.Size([3072]) and whose dimensions in the checkpoint are torch.Size([3072]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.5.output.dense.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.5.output.LayerNorm.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.6.attention.self.query.base_layer.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.6.attention.self.key.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.6.attention.self.value.base_layer.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.6.attention.output.dense.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.6.attention.output.LayerNorm.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.6.intermediate.dense.bias", whose dimensions in the model are torch.Size([3072]) and whose dimensions in the checkpoint are torch.Size([3072]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.6.output.dense.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.6.output.LayerNorm.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.7.attention.self.query.base_layer.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.7.attention.self.key.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.7.attention.self.value.base_layer.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.7.attention.output.dense.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.7.attention.output.LayerNorm.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.7.intermediate.dense.bias", whose dimensions in the model are torch.Size([3072]) and whose dimensions in the checkpoint are torch.Size([3072]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.7.output.dense.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.7.output.LayerNorm.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.8.attention.self.query.base_layer.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.8.attention.self.key.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.8.attention.self.value.base_layer.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.8.attention.output.dense.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.8.attention.output.LayerNorm.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.8.intermediate.dense.bias", whose dimensions in the model are torch.Size([3072]) and whose dimensions in the checkpoint are torch.Size([3072]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.8.output.dense.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.8.output.LayerNorm.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.9.attention.self.query.base_layer.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.9.attention.self.key.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.9.attention.self.value.base_layer.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.9.attention.output.dense.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.9.attention.output.LayerNorm.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.9.intermediate.dense.bias", whose dimensions in the model are torch.Size([3072]) and whose dimensions in the checkpoint are torch.Size([3072]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.9.output.dense.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.9.output.LayerNorm.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.10.attention.self.query.base_layer.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.10.attention.self.key.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.10.attention.self.value.base_layer.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.10.attention.output.dense.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.10.attention.output.LayerNorm.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.10.intermediate.dense.bias", whose dimensions in the model are torch.Size([3072]) and whose dimensions in the checkpoint are torch.Size([3072]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.10.output.dense.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.10.output.LayerNorm.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.11.attention.self.query.base_layer.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.11.attention.self.key.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.11.attention.self.value.base_layer.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.11.attention.output.dense.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.11.attention.output.LayerNorm.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.11.intermediate.dense.bias", whose dimensions in the model are torch.Size([3072]) and whose dimensions in the checkpoint are torch.Size([3072]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.11.output.dense.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).
    While copying the parameter named "base_model.model.roberta.encoder.layer.11.output.LayerNorm.bias", whose dimensions in the model are torch.Size([768]) and whose dimensions in the checkpoint are torch.Size([768]), an exception occurred : ('destOffset % 4 == 0 INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/Copy.mm":119, please report a bug to PyTorch. Unaligned blit request',).

For reference, this is where this error is thrown:

model = PeftModelForSequenceClassification.from_pretrained(
        model=model,
        model_id=finetuned_model)

finetuned_model is a path that points to the folder containing the relevant adapter_config.json and adapter_model.safetensors files. The size of the adapter_model.safetensors files are 2.4 MB and 5 MB for BERT and RoBERTa respectively.

Expected behavior

Successfully loading already trained RoBERTa adapters as it already works with the BERT adapters.

BenjaminBossan commented 2 months ago

I'm honestly at a loss here. This appears to be some implementation issue deep down in the PyTorch MPS code. As it says, this error should be reported to PyTorch.

If it's possible for you, you could share your adapter file (as safetensors format) and the loading code with me and I can check if I can successfully load it on my machine, but I don't have a MacBook for testing, so probably I won't be able to reproduce it.

One idea that comes to mind: Could you try loading on CPU and after it's finished move it to MPS?

github-actions[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.