MLX compatibility: Statistical functions
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
Research direction
Start by running the named tests: test_cumulative_sum, test_cumulative_prod, test_prod, test_std, test_sum, and test_var. Trace their failures through the Python compatibility layer and compare each wrapper with the Array API signatures and dtype rules shown here. Done means the keyword mismatches and small-integer promotion cases pass for all six statistical functions.
Written by the indexing model from the issue text.
Description
| Array API | MLX Analog | Status | Notes | Test Node | Result |
|---|---|---|---|---|---|
| cumulative_sum(x, /, *, axis=None, dtype=None, include_initial=False) | cumsum(a, /, axis: int | None = None, *, reverse: bool = False, inclusive: bool = True, dtype: Dtype | None = None, stream=None) | incompatible | MLX lacks the include_initial keyword (raises TypeError) and skips the standard default-integer dtype promotion — a uint8 input stays uint8 instead of promoting to uint32. |
test_cumulative_sum | Failed |
| cumulative_prod(x, /, *, axis=None, dtype=None, include_initial=False) | cumprod(a, /, axis: int | None = None, *, reverse: bool = False, inclusive: bool = True, dtype: Dtype | None = None, stream=None) | incompatible | Same two issues as cumulative_sum: missing include_initial keyword and no default-integer dtype promotion (uint8 stays uint8 instead of uint32). |
test_cumulative_prod | Failed |
| prod(x, /, *, axis=None, dtype=None, keepdims=False) | prod(a, /, axis: None | int | Sequence[int] = None, keepdims: bool = False, *, stream=None) | incompatible | MLX has no dtype keyword (raises TypeError) and does not promote small integer inputs to the standard default integer dtype (uint8 stays uint8 instead of uint32). |
test_prod | Failed |
| std(x, /, *, axis=None, correction=0.0, keepdims=False) | std(a, /, axis: None | int | Sequence[int] = None, keepdims: bool = False, ddof: int = 0, *, stream=None) | incompatible | MLX exposes ddof instead of the Array API's correction keyword, so passing correction raises a TypeError. |
test_std | Failed |
| sum(x, /, *, axis=None, dtype=None, keepdims=False) | sum(a, /, axis: None | int | Sequence[int] = None, keepdims: bool = False, *, stream=None) | incompatible | MLX has no dtype keyword (raises TypeError) and does not promote small integer inputs to the standard default integer dtype (uint8 stays uint8 instead of uint32). |
test_sum | Failed |
| var(x, /, *, axis=None, correction=0.0, keepdims=False) | var(a, /, axis: None | int | Sequence[int] = None, keepdims: bool = False, ddof: int = 0, *, stream=None) | incompatible | MLX exposes ddof instead of the Array API's correction keyword, so passing correction raises a TypeError. |
test_var | Failed |
- Dominant language
- Python
- Stars
- 131
- Forks
- 49
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 6
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from data-apis/array-api-compat
-
blocked by upstream
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
data-apis/array-api-compat#439 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
data-apis/array-api-compat#395 · 2 comments ·
-
Release 1.16 Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
data-apis/array-api-compat#476 ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
data-apis/array-api-compat#473 · 4 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
data-apis/array-api-compat#465 · 3 comments ·
All issues in data-apis/array-api-compat
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100