Add initial MLX support with the creation wrappers#453
Conversation
|
After adding temporary compatibility wrappers and rerunning
With: ARRAY_API_TESTS_SKIP_DTYPES=float64,complex64,int64,uint64the suite reports 14 passed, 2 failed:
NOTE: MLX does not implement eq for comparing None with datatype, also we skipped complex completely due to problem with |
|
Thanks! Going forward, it would be helpful to list reproducible examples from the test suite failures, which the test suite prints on a failure.
Please open an issue in the test suite, with an MRE. If it's a test suite problem, it should be reproducible with numpy or array-api-strict, I suppose.
This is one of things to propose adding to MLX; even if they decline, we'll have an answer. |
This pull request introduces initial support for the MLX backend in the
array_api_compatpackage. The main changes add MLX-specific modules, implement compatibility wrappers for core array functions, and update the build and development configuration to include MLX. Below are the most important changes:For #452
MLX Backend Implementation:
array_api_compat/mlxbackend with__init__.py,_aliases.py, and_typing.pyto support MLX arrays and provide compatibility wrappers for common array operations.arange,asarray,empty_like,eye,meshgrid,ones_like, andzeros_likein_aliases.py, handling MLX-specific quirks and edge cases.Array,DType,Device) in_typing.pyfor consistent type handling.__init__.pyto expose all relevant symbols and ensure proper module structure for the MLX backend.Build and Development Environment:
meson.buildandpyproject.tomlto include MLX sources and conditionally require themlxpackage on macOS (sys_platform == 'darwin'). [1] [2]