Files
OBLITERATUS/tests/conditional/test_mlx_runtime.py
T

21 lines
600 B
Python

"""Real Apple MLX selection and minimal operation probe."""
from __future__ import annotations
import pytest
pytestmark = pytest.mark.mlx
def test_mlx_import_array_placement_and_operation():
mx = pytest.importorskip("mlx.core", reason="requires Apple Silicon with mlx installed")
pytest.importorskip("mlx_lm", reason="requires mlx-lm installed")
from obliteratus import mlx_backend
assert mlx_backend.MLX_AVAILABLE
left = mx.arange(16, dtype=mx.float32).reshape((4, 4))
result = mx.matmul(left, mx.transpose(left))
mx.eval(result)
assert result.shape == (4, 4)