MLX Array API compatibility: upstream status, compatibility

Open
#450 27 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
28/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Active
Tech stack
python
Domain
api, testing

Research direction

Start with the listed array-api-tests command and its array_api_tests/test_searching_functions.py entry point, then review sub-issues #451, #452 and #462 plus the linked upstream issues. Done means the compatibility scope, known failures, and general blockers are tracked across the relevant upstream projects; this umbrella issue does not define one standalone change.

Written by the indexing model from the issue text.

Description

MLX Array API compatibility overview

This issue tracks the compatibility of MLX with the Python Array API
standard and coordinates potential changes across:

  • MLX
  • array-api-compat
  • array-api-tests
  • the Array API specification

Scope

  • Array API version:
  • MLX version/commit:
  • array-api-tests commit:
  • array-api-compat branch/commit:
  • Platform: macos

Compatibility tracking:

  1. Constants, Datatypes and Array Attributes #451
  2. Creation Methods #452
  3. Manipulation Methods #462
  4. Statistical functions https://github.com/data-apis/array-api-compat/issues/463
  5. Operators and elementwise functions: https://github.com/data-apis/array-api-compat/issues/465
  6. Indexing functions: https://github.com/data-apis/array-api-compat/issues/466

The desired endgame

Upstream has a CI job which runs array-api-tests with a list of known failures.

The test suite needs to run with ARRAY_API_TESTS_SKIP_DTYPES=float64 environment variable, and --disable-data-dependent-shapes. For example,

ARRAY_API_TESTS_SKIP_DTYPES=float64 ARRAY_API_TESTS_MODULE=mlx.core pytest array_api_tests/test_searching_functions.py -v --disable-data-dependent-shapes --max-examples=1000

Process

Use this issue an umrella issue, open individual issues for groups of tests from the test suite, edit the links into this top post into the list above. (If you cannot edit it, ping @ev-br)

Problems/failures with individual functions, as uncovered by the test suite: discuss in the sub-issues. Keep this one for general blockers.


Known blockers
  • missing __array_namespace_info__ : would be best to submit a PR upstream
  • missing .device attribute of the array object : nothing to do about it
Dominant language
Python
Stars
131
Forks
49
Avg merge
2d 8h
Merged PRs (30d)
6

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from data-apis/array-api-compat

All issues in data-apis/array-api-compat

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.