apple / corenet

CoreNet: A library for training deep neural networks
Other
6.72k stars 518 forks source link

Corenet detect M2 GPU #26

Open antodifrancisco opened 2 months ago

antodifrancisco commented 2 months ago

I run the "train_a_new_model_on_a_new_dataset_from_scratch" notebook on my M2 and no GPUs are detected, the script moves to using CPUs. Is it possible to configure Corenet to detect the M2 GPU?

Aprilistic commented 2 months ago

There's one way to do it quickly. If you are trying to use OpenELM, you will use LLM-Adapters and lm-evaluation-harness. I just searched and replaced ' "cpu" ' with' "mps" ' throughout the files. Also, I added the mps selection code in corenet file. (https://github.com/apple/corenet/pull/22/files). Worked well on M1 Pro.