I want to run the notebooks on my computer to get a better understanding. I have a error in week 3, on 2.2 where it states “Placeholder storage has not been allocated on MPS device!” I work on a M1 or M2 mac computer. On the internet I got some information it has something to do with the processor. Can anyone give me a tip on how to solve this?
Hi,
Had the same error. In the import section of the program (1.x), inserted the following:
from transformers import TrainingArguments
training_args = TrainingArguments(output_dir=“test_trainer”, use_mps_device=True)
That got me to run it up to 2.1.
The in 2.2 I had to replace two lines of code as follows:
'# toxicity_tokenizer = AutoTokenizer.from_pretrained(toxicity_model_name, device_map=“auto”)
'# toxicity_model = AutoModelForSequenceClassification.from_pretrained(toxicity_model_name, device_map=“auto”)
toxicity_tokenizer = AutoTokenizer.from_pretrained(toxicity_model_name)
toxicity_model = AutoModelForSequenceClassification.from_pretrained(toxicity_model_name)
Now… I wished this was the last thing. However, after all this, I still have one more error in 3.1 “TypeError: BFloat16 is not supported on MPS”
From what I read this has to do with some not(yet) supported data types on the M1 chip. Now I could change the entire model to pick “cpu” instead of “mps” (yet to try) but that will likely make it run…much… slower.
So 90% there.