Registry / ai-ml / pyobjc-framework-mlcompute

pyobjc-framework-mlcompute

JSON →
library12.2pypypiunverified

PyObjC-framework-MLCompute provides Python wrappers for Apple's MLCompute framework on macOS, enabling Python applications to leverage GPU acceleration for machine learning tasks. It is part of the larger PyObjC project, currently at version 12.1, with releases typically tied to macOS SDK updates and Python version support.

pip install pyobjc-framework-mlcompute
INSTALL
IMPORT
SIG · PYOBJC-FRAMEWORK-M
P
pyobjc-framework-mlcompute
ai-mlpythonv12.2
Install
Import
Disk
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v? · pip install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.940 runs
build_error
glibc
py 3.103.940 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MLCDevice
from MLCompute import MLCDevice
MLCGraph
from MLCompute import MLCGraph

Demonstrates how to import MLCompute classes and query available CPU and GPU devices. MLCompute provides classes like MLCDevice and MLCGraph for building and executing machine learning models using Apple's Metal Performance Shaders.

from MLCompute import MLCDevice, MLCDeviceTypeCPU, MLCDeviceTypeGPU def quickstart_mlcompute(): # Get the default CPU device cpu_device = MLCDevice.cpuDevice() print(f"CPU Device: {cpu_device.description()} (Type: {cpu_device.deviceType()})") # Get the default GPU device if available gpu_device = MLCDevice.gpuDevice() if gpu_device: print(f"GPU Device: {gpu_device.description()} (Type: {gpu_device.deviceType()})") else: print("No GPU device found or MLCompute is running on a Mac without a Metal GPU.") # Get a device of any type (prefers GPU if available) any_device = MLCDevice.deviceWithAnyType() print(f"Any Device: {any_device.description()} (Type: {any_device.deviceType()})") quickstart_mlcompute()
Debug
Known issues
breakingPyObjC 12.0 and later dropped support for Python 3.9. Attempting to install or run on Python 3.9 will result in errors.
fix
Upgrade your Python environment to 3.10 or later.
affects: >=12.0
breakingPyObjC 11.0 and later dropped support for Python 3.8. Attempting to install or run on Python 3.8 will result in errors.
fix
Upgrade your Python environment to 3.9 or later (for PyObjC < 12.0) or 3.10 or later (for PyObjC >= 12.0).
affects: >=11.0
breakingThe `IMServicePlugIn` framework bindings were entirely removed in PyObjC 10.0 as the framework was deprecated by Apple in macOS 10.13 and completely removed in macOS 14.
fix
Refactor code to use alternative macOS APIs or pin PyObjC to a version less than 10.0 if this framework is essential for legacy applications.
affects: >=10.0
gotchaFrom PyObjC 11.1, the core bridge's behavior for initializer methods (those in the 'init' family) was updated to align with Clang's Automatic Reference Counting (ARC) documentation. Init methods now correctly model stealing a reference to `self` and returning a new one.
fix
Most Python code should not be directly affected. However, low-level Objective-C integrations or code relying on specific reference counting behavior might require review. Consult the PyObjC 11.1 release notes for details.
affects: >=11.1
gotchaPyObjC versions 10.3 and later introduced specific limitations regarding the interaction between `__init__` and `__new__` in custom Python subclasses of Objective-C classes. While 10.3.1 partially re-enabled `__init__` for user-implemented `__new__` methods, code using PyObjC's provided `__new__` still cannot use `__init__`.
fix
If implementing `__new__` in a Python subclass, carefully manage initialization logic. Refer to the PyObjC 10.3 and 10.3.1 release notes for precise behavior and workarounds.
affects: >=10.3
Upgrade
Version history
12.2latest on PyPI · released May 30, 2026
Audit
Dependencies
pyobjc-corerequiredCore PyObjC bridge functionality
Agent activity
7 hits · last 30 days
node
6
OpenAI (training)
1
Resources
pyobjc-framework-mlcompute — pip install pyobjc-framework-mlcompute · libregistry