Registry / ai-ml / pyobjc-framework-metalperformanceshadersgraph

pyobjc-framework-metalperformanceshadersgraph

JSON →
library12.2pypypiunverified

PyObjC-framework-MetalPerformanceShadersGraph provides Python wrappers for Apple's MetalPerformanceShadersGraph framework on macOS. This framework enables high-performance, energy-efficient computation on Apple platforms by leveraging various hardware compute blocks, allowing users to generate symbolic compute graphs of operations for GPU execution. The library is actively maintained with frequent releases, often synchronized with new macOS SDK updates. Its current version is 12.1.

pip install pyobjc-framework-metalperformanceshadersgraph
INSTALL
IMPORT
SIG · PYOBJC-FRAMEWORK-M
P
pyobjc-framework-metalperformanceshadersgraph
ai-mlpythonv12.2
Install
—
Import
—
Disk
—
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.9–3.13
musl
3.9–3.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.10–3.920 runs
build_error
glibc
py 3.10–3.920 runs
build_error
Code
Verified usage

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

MPSGraph
✓ from MetalPerformanceShadersGraph import MPSGraph
PyObjC typically maps macOS frameworks directly to top-level Python packages.
NSObject
✓ from Foundation import NSObject
Many Cocoa classes, including `NSObject`, are found in the `Foundation` framework, which is wrapped by `pyobjc-framework-Foundation`.

This quickstart demonstrates the basic import and instantiation of an `MPSGraph` object using PyObjC. A full MetalPerformanceShadersGraph workflow involves complex setup with tensors, operations, and compilation for a specific Metal device, which is beyond the scope of a minimal quickstart. Users should consult Apple's official documentation for detailed MPSGraph usage.

from MetalPerformanceShadersGraph import MPSGraph from Foundation import NSObject # For general PyObjC interaction # Instantiate a Metal Performance Shaders Graph # Note: This is a minimal example. Actual graph creation involves defining # tensors, operations, and compiling for a Metal device. # Refer to Apple's MetalPerformanceShadersGraph documentation for usage. try: graph = MPSGraph.alloc().init() # Alternatively, for PyObjC 10.4+ a more Pythonic way often works: # graph = MPSGraph() print(f"Successfully instantiated MPSGraph: {graph}") print(f"MPSGraph options: {graph.options()}") except Exception as e: print(f"Failed to instantiate MPSGraph or access options: {e}") print("Ensure you are running on macOS with Metal support.") # Example of a basic NSObject to confirm PyObjC is working generally obj = NSObject.alloc().init() print(f"Successfully instantiated NSObject: {obj}")
Debug
Known issues
breakingPyObjC has dropped support for older Python versions. PyObjC 12.0 dropped support for Python 3.9, and PyObjC 11.0 dropped support for Python 3.8.
fix
Upgrade your Python environment to Python 3.10 or newer to use PyObjC 12.x.
affects: >=11.0
breakingThe behavior of `__init__` and object instantiation was significantly changed in PyObjC 10.3 and 11.1. PyObjC 10.3 initially broke `__init__` for classes not defining their own `__new__`, though 10.3.1 partially reverted this. PyObjC 11.1 aligned reference counting for 'init' methods with `clang`'s ARC documentation. Direct calls to methods on partially initialized objects (`SomeClass.alloc()`) may lead to unexpected behavior or crashes in recent versions, as such patterns used to 'accidentally work' but hid reference counting bugs.
fix
Review custom Python subclasses of Objective-C classes, especially `__init__` and `__new__` implementations. Prefer the Pythonic `SomeClass(...)` instantiation or explicitly use `SomeClass.alloc().init...()` for clarity.
affects: >=10.3
gotchaPyObjC does not support the experimental free-threading feature (PEP 703) introduced in Python 3.13. Using PyObjC in a free-threaded Python environment may lead to undefined behavior or crashes.
fix
Avoid using PyObjC in Python environments configured for experimental free-threading. Use a standard CPython build.
affects: >=10.3 (with Python 3.13+)
gotchaKey-Value Observing (KVO) usage for subclasses of `NSProxy` defined in Python was automatically disabled in PyObjC 12.1 due to prior issues.
fix
If you relied on KVO for Python-defined `NSProxy` subclasses, be aware that this behavior has changed. Consider upgrading to v12.1 or re-evaluate your KVO approach for such classes.
affects: <12.1
breakingThe `IMServicePlugIn` framework bindings were removed in PyObjC 10.0 because the entire framework was deprecated in macOS 10.13 and removed in macOS 14.
fix
If your application relied on `IMServicePlugIn`, it will no longer function on macOS 14+ or with PyObjC 10.0+. You must migrate to alternative macOS APIs.
affects: >=10.0
Upgrade
Version history
12.2latest on PyPI · released May 30, 2026
Audit
Dependencies
pyobjc-corerequiredAll pyobjc-framework-* packages depend on pyobjc-core for the Python-Objective-C bridge functionality.
Agent activity
12 hits · last 30 days
node
8
OpenAI (training)
4
Resources
pyobjc-framework-metalperformanceshadersgraph — pip install pyobjc-framework-metalperformanceshadersgraph · libregistry