Skip to content

Commit

Permalink
FIX Prefix tuning test w/ rotary emb on multi GPU (#2311)
Browse files Browse the repository at this point in the history
See
huggingface/transformers#35235 (comment)
for context.

There has been a refactor in transformers that resulted in the rotary
embedding of Mistral (and probably others) moving to the model level.
This led to a device map used in one of the tests to being incorrect.
This PR fixes the device map.

Note that this fix doesn't really have anything to do with prefix
tuning, the error occurred even before prefix tuning is used.
  • Loading branch information
BenjaminBossan authored Jan 10, 2025
1 parent af637ac commit 0b0ff9a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/test_gpu_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -4043,6 +4043,7 @@ def test_prefix_tuning_multiple_devices_decoder_model(self):
"model.layers.0": 0,
"model.layers.1": 1,
"model.norm": 1,
"model.rotary_emb": 1,
"lm_head": 1,
}
model = AutoModelForCausalLM.from_pretrained(model_id, device_map=device_map)
Expand Down

0 comments on commit 0b0ff9a

Please sign in to comment.