multiple mps for base X86 Mac with multiples gpus #102436
Labels
module: mps
Related to Apple Metal Performance Shaders framework
triaged
This issue has been looked at a team member, and triaged and prioritized into an appropriate module
馃殌 The feature, motivation and pitch
Overview
Your app can use multiple GPUs on an Intel-based Mac, including any built-in and external GPUs. Start by getting a list of all the system鈥檚 available GPUs, and then submit workloads to those appropriate for your app鈥檚 tasks.
Note
Mac computers with Apple silicon have a single, high-performance, and energy-efficient GPU.
Get a List of GPU Devices
Your app can get an array of聽
MTLDevice
聽instances, each of which represents an available GPU, by calling the聽MTLCopyAllDevices()
聽function.However, that function provides a list of GPUs that are available at that moment in time. To get the current list and register for device update notifications, provide a handler to Metal by calling the聽
MTLCopyAllDevicesWithObserver(_:_:)
聽function.Metal calls your handler to tell your app when the system adds or removes an聽
MTLDevice
聽from the system.Note
Metal calls your app鈥檚 handler when a device may change its state in the future, such as when a person makes a safe disconnect request. For more information, see聽Handling External GPU Additions and Removals.
Your app can deregister its observer when it no longer needs GPU device updates from the system by calling the聽
MTLRemoveDeviceObserver(_:)
聽function.Identify Each GPU by Type
Each GPU on a Mac computer鈥檚 system can be one of three types: integrated, discrete, or external. You can identify each聽
MTLDevice
聽instance鈥檚 type by inspecting its聽isLowPower
聽and聽isRemovable
聽properties.Docs Related
Alternatives
As you can see, there are 2021 Intel-based Mac Pros on the market with costs reaching up to $70,000 that demonstrate remarkable performance when training on a single GPU using PyTorch. There are also many in the community who will continue to use MacBook Pros for a significant period. As such, it would be incredible to add support for multiple GPUs. Despite the advent of new ARM-based models, there remains extensive activity in the Intel sector, and we can expect support from Apple to continue for quite some time. A very straightforward issue to check would be whether the ARM or ARM64 system is single GPU, and if it's x86, does it have access to multiple GPUs.
Additional context
No response
cc @kulinseth @albanD @malfet @DenisVieriu97 @razarmehr @abhudev
The text was updated successfully, but these errors were encountered: