microsoft / vert-papers

This repository contains code and datasets related to entity/knowledge papers from the VERT (Versatile Entity Recognition & disambiguation Toolkit) project, by the Knowledge Computing group at Microsoft Research Asia (MSRA).
MIT License
266 stars 93 forks source link

Migration Problem of Code on Apple M1 Chip #50

Open Elody-Chen opened 1 year ago

Elody-Chen commented 1 year ago

Hi, in the process of testing the code, I found that the function .cuda() of this line cannot run on M1 chip. Previously, PyTorch was able to use M1 chips for GPU acceleration, but this line did not work. May I ask if you have any solutions?

kanswer commented 1 year ago

.cuda() cannot be used in M1 chip, instead which u should use gpu like "x = torch.ones((1024 12, 1024 12), dtype=torch.float32,device='mps')".