BiaPyX / BiaPy

Open source Python library for building bioimage analysis pipelines
https://BiaPyX.github.io
MIT License
114 stars 28 forks source link

CLI installation of Biapy (torch) for MacOS: Docs update #84

Closed Mohinta2892 closed 1 week ago

Mohinta2892 commented 1 month ago

Hello Dani!

In your installation docs, it might be great to have the command to install torch for MacOS with MPS.

Currently it has this, but may not work on Macs.

pip install torch==2.2.0 torchvision==0.17.0 torchaudio==2.2.0 --index-url https://download.pytorch.org/whl/cu118

Best, Samia

danifranco commented 1 month ago

Thank you for your suggestion Samia. We will add it to the doc!

Mohinta2892 commented 1 month ago

Please add a mechanism to switch between cpu, cuda-gpu and mps as well. This would be super helpful. Many thanks.

danifranco commented 1 month ago

The installation related thing @pedgomgal1 is on that (maybe you could provide him some hints if you have already installed BiaPy env in your macOS).

Regarding the device switch, I've just updated the code and added SYSTEM.DEVICE option in the last commit. I think I have adapted all lines where the device "cpu" was used by default: now all the backends can be used. This is something that we have never done before. I hope you can use "mps" correctly but, please, do not hesitate to ping me if you think we can improve how we handle this or if you face any problem!

Mohinta2892 commented 4 weeks ago

Hi Dani,

One other thing, since Biapy can now work on Mac, perhaps tweaking the help message for biapy -h might also be helpful for people to know about it.

From --gpu GPU GPU number according to 'nvidia-smi' command

To --gpu GPU GPU number per 'nvidia-smi' command / MPS device (Apple Silicon)

danifranco commented 1 week ago

We have updated the doc/landing page with new instructions to support CPU/GPU installation. I'm closing this.