setfit icon indicating copy to clipboard operation
setfit copied to clipboard

How to take advantage of Mac M1 GPUs?

Open secastro opened this issue 2 years ago • 1 comments

More than an issue, this is a request for help.

Do you have advice on how to take advantage of the Mac M1 Pro GPU for training a model, assuming the underlying Torch implementation provides support?

There are some tutorials on how to use Torch with the MPS driver, but I'm not sure how to signal SetFit to use a specific GPU.

secastro avatar Oct 20 '22 08:10 secastro

Hi @secastro as far as I know, sentence-transformers doesn't support the mps device needed to train / run inference (see this issue). If support becomes available, we can certainly add it to setfit!

lewtun avatar Oct 21 '22 12:10 lewtun

Any updates on this? What's needed to integrate support for mps? I'm happy to help as needed.

zachschillaci27 avatar Dec 09 '22 08:12 zachschillaci27

@secastro @zachschillaci27 https://github.com/UKPLab/sentence-transformers/issues/1736 solves it

turian avatar Apr 27 '23 14:04 turian

MPS is supported by sentence-transformers since https://github.com/UKPLab/sentence-transformers/pull/2342

joel-odlund avatar Jan 29 '24 15:01 joel-odlund

Indeed! As of Sentence Transformers v2.3.0 it should now automatically select MPS as the default device if relevant.

pip install -U sentence_transformers
  • Tom Aarsen

tomaarsen avatar Jan 29 '24 16:01 tomaarsen