CoreML run on GPU on macOS via metal?

I'm trying to figure out if I can run a coreml model on GPU on macOS. This doesnt seem to be documented anywhere. I assume if it can run via metal on mac, then it would run on GPU, but I don't see anything about that either.


Anyone know? Thanks!

Replies

Hello,


Taken straight from the CoreML overview page at https://developer.apple.com/machine-learning/:

"Because it’s built on top of low level technologies like Metal and Accelerate, Core ML seamlessly takes advantage of the CPU and GPU to provide maximum performance and efficiency."


So, if CoreML deems using the GPU to be more efficient for a particular model, then it will run on the GPU. You can force a model to only use the CPU for computation when making a prediction by setting the usesCPUOnly property.