SBU-BMI / wsinfer

🔥 🚀 Blazingly fast pipeline for patch-based classification in whole slide images
https://wsinfer.readthedocs.io
Apache License 2.0
56 stars 9 forks source link

Support MPS on Apple Silicon #132

Closed petebankhead closed 1 year ago

petebankhead commented 1 year ago

See https://pytorch.org/docs/stable/notes/mps.html

Testing this with one image using a Mac Studio (M1 Max) the processing time decreased from ~21 minutes to ~2 minutes.

I'm not sure if the change in utils.py is necessary, nor if there should be changes in other places - it looks like the report in infer.py should be updated if this is accepted.

Also updated .gitignore for more Mac (and PyCharm) friendliness.

kaczmarj commented 1 year ago

@petebankhead - thank you! let me test this on an M1/M2 mac and will merge afterwards.

kaczmarj commented 1 year ago

thanks @petebankhead !