MLX compatibility: operators and elementwise functions
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 45/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- Active
- Stack technique
- python
- Domaine
- data, testing-qa
Piste de recherche
Exécutez la commande ARRAY_API_TESTS_MODULE=mlx.core pytest signalée sur array_api_tests/test_operators_and_elementwise_functions.py. Regroupez les échecs par fonctions manquantes, kernels complexes, gestion des scalaires et arithmétique entière, puis déterminez lesquels nécessitent un travail de compatibilité et lesquels doivent faire l’objet de rapports upstream. Le travail est terminé lorsque les tests concernés passent ou que les limitations restantes de MLX ont été clairement signalées upstream.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Towards https://github.com/data-apis/array-api-compat/issues/450.
Running
$ ARRAY_API_TESTS_SKIP_DTYPES=float64,complex128 ARRAY_API_TESTS_MODULE=mlx.core pytest array_api_tests/test_operators_and_elementwise_functions.py -v
...
==================================================== short test summary info =====================================================
FAILED array_api_tests/test_operators_and_elementwise_functions.py::test_acos - ValueError: a=(nan+nanj) and b=(1.570796326562066-22.873856958478193j), but input must be non-NaN
FAILED array_api_tests/test_operators_and_elementwise_functions.py::test_acosh - RuntimeError: [metal::Device] Unable to load kernel v_ArcCoshcomplex64complex64
FAILED array_api_tests/test_operators_and_elementwise_functions.py::test_asin - AssertionError: out=infj, but should be roughly asin(x)=(0.7856422146397344+8.664583897600078j) [asin()]
FAILED array_api_tests/test_operators_and_elementwise_functions.py::test_asinh - RuntimeError: [metal::Device] Unable to load kernel v_ArcSinhcomplex64complex64
FAILED array_api_tests/test_operators_and_elementwise_functions.py::test_atan - ExceptionGroup: Hypothesis found 2 distinct failures. (2 sub-exceptions)
FAILED array_api_tests/test_operators_and_elementwise_functions.py::test_atanh - RuntimeError: [metal::Device] Unable to load kernel v_ArcTanhcomplex64complex64
FAILED array_api_tests/test_operators_and_elementwise_functions.py::test_bitwise_left_shift[bitwise_left_shift(x1, x2)] - AssertionError: out=1, but should be (x1 << x2)=0 [bitwise_left_shift()]
FAILED array_api_tests/test_operators_and_elementwise_functions.py::test_bitwise_left_shift[__lshift__(x1, x2)] - AssertionError: out=1, but should be (x1 << x2)=0 [__lshift__()]
FAILED array_api_tests/test_operators_and_elementwise_functions.py::test_bitwise_left_shift[__ilshift__(x1, x2)] - AssertionError: x1=1, but should be (x1 << x2)=0 [__ilshift__()]
FAILED array_api_tests/test_operators_and_elementwise_functions.py::test_bitwise_right_shift[bitwise_right_shift(x1, x2)] - AssertionError: out=1, but should be (x1 >> x2)=0 [bitwise_right_shift()]
FAILED array_api_tests/test_operators_and_elementwise_functions.py::test_bitwise_right_shift[__rshift__(x1, x2)] - AssertionError: out=1, but should be (x1 >> x2)=0 [__rshift__()]
FAILED array_api_tests/test_operators_and_elementwise_functions.py::test_bitwise_right_shift[__irshift__(x1, x2)] - AssertionError: x1=1, but should be (x1 >> x2)=0 [__irshift__()]
FAILED array_api_tests/test_operators_and_elementwise_functions.py::test_clip - TypeError: clip(): incompatible function arguments. The following argument types are supported:
FAILED array_api_tests/test_operators_and_elementwise_functions.py::test_copysign - AssertionError: copysign is not defined in mlx.core
FAILED array_api_tests/test_operators_and_elementwise_functions.py::test_divide[divide(x1, x2)] - ExceptionGroup: Hypothesis found 2 distinct failures. (2 sub-exceptions)
FAILED array_api_tests/test_operators_and_elementwise_functions.py::test_expm1 - ValueError: [expm1] Not supported for complex64.
FAILED array_api_tests/test_operators_and_elementwise_functions.py::test_floor_divide[floor_divide(x1, x2)] - AssertionError: out=0, but should be (x1 // x2)=-1 [floor_divide()]
FAILED array_api_tests/test_operators_and_elementwise_functions.py::test_floor_divide[__floordiv__(x1, x2)] - AssertionError: out=0, but should be (x1 // x2)=-1 [__floordiv__()]
FAILED array_api_tests/test_operators_and_elementwise_functions.py::test_floor_divide[__ifloordiv__(x1, x2)] - AssertionError: x1=0, but should be (x1 // x2)=-1 [__ifloordiv__()]
FAILED array_api_tests/test_operators_and_elementwise_functions.py::test_hypot - AssertionError: hypot is not defined in mlx.core
FAILED array_api_tests/test_operators_and_elementwise_functions.py::test_log - AssertionError: out=(inf+0.8922129273414612j), but should be roughly log(x)=(44.361419543366964+0.892212881624599j) [log()]
FAILED array_api_tests/test_operators_and_elementwise_functions.py::test_log1p - AssertionError: out=(inf+0.7905846238136292j), but should be roughly log1p(x)=(44.361419543239215+0.7905845671575851j) [log1p()]
FAILED array_api_tests/test_operators_and_elementwise_functions.py::test_log2 - AssertionError: out=(inf+1.2417556047439575j), but should be roughly log2(x)=(63.99999997183151+1.241755551201958j) [log2()]
FAILED array_api_tests/test_operators_and_elementwise_functions.py::test_log10 - AssertionError: out=(inf+0.47804269194602966j), but should be roughly log10(x)=(19.265919715434027+0.47804270750558625j) [log...
FAILED array_api_tests/test_operators_and_elementwise_functions.py::test_nextafter - AssertionError: nextafter is not defined in mlx.core
FAILED array_api_tests/test_operators_and_elementwise_functions.py::test_positive[__pos__] - AttributeError: 'mlx.core.array' object has no attribute '__pos__'. Did you mean: '__pow__'?
FAILED array_api_tests/test_operators_and_elementwise_functions.py::test_signbit - AssertionError: signbit is not defined in mlx.core
FAILED array_api_tests/test_operators_and_elementwise_functions.py::test_sqrt - AssertionError: out=(inf+infj), but should be roughly sqrt(x)=(3956798150.479092+1670476642.4809253j) [sqrt()]
FAILED array_api_tests/test_operators_and_elementwise_functions.py::test_binary_with_scalars_real[atan2] - TypeError: arctan2(): incompatible function arguments. The following argument types are supported:
FAILED array_api_tests/test_operators_and_elementwise_functions.py::test_binary_with_scalars_real[copysign] - AssertionError: copysign is not defined in mlx.core
FAILED array_api_tests/test_operators_and_elementwise_functions.py::test_binary_with_scalars_real[hypot] - AssertionError: hypot is not defined in mlx.core
FAILED array_api_tests/test_operators_and_elementwise_functions.py::test_binary_with_scalars_real[nextafter] - AssertionError: nextafter is not defined in mlx.core
===================================== 32 failed, 123 passed, 5 skipped in 126.21s (0:02:06) ======================================
Failures sort into several categories:
- Functions missing in MLX:
nextafter,hypot,copysign,signbit,__pos__:
--Could be submitted to MLX as pure enhancements. - Functions exist in MLX but miss complex kernels:
acosh,asinh,atanh,exmp1:
--We could report them upstream. - Early overflow in the complex plane (likely, internal computations done in float32):
acos,asin,log,log2,log10,log1p,sqrt:
--Cross-ref https://github.com/numpy/numpy/issues/32234#issuecomment-5244752601, hopefully will get fixed at the source. - Functions only arrays and reject python scalars:
mx.atan2( mx.asarray(1.0), 2.0):
--Looks to be a small omission (other binary functions accept scalars?), can submit a PR upstream. - Modular arithmetics / rounding modes for integers:
__floordiv__(array(-1, dtype=int8), array(2, dtype=int8)), also shifts,bitwise_right_shift(array(1, dtype=int32), array(32, dtype=int16)):
--These need investigation. cliprequiresmin, maxarguments, while in the spec they are optional:
--Also a simple omission, can submit a PR upstream.
- Langage dominant
- Python
- Étoiles
- 131
- Forks
- 49
- Merge moyen
- 2 j 8 h
- PR mergées (30 j)
- 6
Préparer son environnement
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de data-apis/array-api-compat
-
blocked by upstream
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
data-apis/array-api-compat#439 · 1 commentaire ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
data-apis/array-api-compat#395 · 2 commentaires ·
-
Release 1.16Ouverte
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
data-apis/array-api-compat#476 ·
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 30/100
data-apis/array-api-compat#473 · 4 commentaires ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 68/100
data-apis/array-api-compat#463 · 5 commentaires ·
Toutes les issues de data-apis/array-api-compat
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
-
bug
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
qgis/QGIS-Plugins-Website#459 ·
-
bug severity:medium
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 2 jours
-
bot-found bug priority: P3
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
madenvel/KalinkaPlayer#179 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
ls1intum/edutelligence#1098 ·
Les mainteneurs répondent en général sous 1 jour