diff --git a/CMakeLists.txt b/CMakeLists.txt index 3d0ede099..f41459ef8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -169,11 +169,18 @@ if (MPI_FOUND) execute_process( COMMAND zsh "-c" "mpirun --version" OUTPUT_VARIABLE MPI_VERSION - COMMAND_ERROR_IS_FATAL ANY + ERROR_QUIET ) if (${MPI_VERSION} MATCHES ".*Open MPI.*") target_include_directories(mlx PRIVATE ${MPI_INCLUDE_PATH}) + elseif (MPI_VERSION STREQUAL "") + set(MPI_FOUND FALSE) + message( + WARNING + "MPI found but mpirun is not available. Building without MPI." + ) else() + set(MPI_FOUND FALSE) message( WARNING "MPI which is not OpenMPI found. Building without MPI." diff --git a/mlx/backend/metal/kernels/CMakeLists.txt b/mlx/backend/metal/kernels/CMakeLists.txt index bb9f771b9..4834c1f78 100644 --- a/mlx/backend/metal/kernels/CMakeLists.txt +++ b/mlx/backend/metal/kernels/CMakeLists.txt @@ -4,6 +4,7 @@ set( bf16_math.h complex.h defines.h + expm1f.h utils.h ) diff --git a/python/src/ops.cpp b/python/src/ops.cpp index ee0941aca..e59e56ebc 100644 --- a/python/src/ops.cpp +++ b/python/src/ops.cpp @@ -2833,7 +2833,7 @@ void init_ops(nb::module_& m) { nb::kw_only(), "stream"_a = nb::none(), nb::sig( - "def pad(a: array, pad_with: Union[int, Tuple[int], Tuple[int, int], List[Tuple[int, int]]], constant_values: Union[scalar, array] = 0, *, stream: Union[None, Stream, Device] = None) -> array"), + "def pad(a: array, pad_width: Union[int, Tuple[int], Tuple[int, int], List[Tuple[int, int]]], constant_values: Union[scalar, array] = 0, *, stream: Union[None, Stream, Device] = None) -> array"), R"pbdoc( Pad an array with a constant value diff --git a/python/tests/test_ops.py b/python/tests/test_ops.py index e8b1cfc38..60a0118c0 100644 --- a/python/tests/test_ops.py +++ b/python/tests/test_ops.py @@ -847,9 +847,10 @@ class TestOps(mlx_tests.MLXTestCase): def test_expm1(self): a = mx.array([-88, -87, 0, 0.5, -0.5, 5, 87, 88, 89, 90]) result = mx.expm1(a) - expected = np.expm1(a, dtype=np.float32) - - self.assertTrue(np.allclose(result, expected, rtol=1e-5, atol=1e-5)) + errs = np.seterr(over="ignore") + expected = np.expm1(a) + np.seterr(over=errs["over"]) + self.assertTrue(np.allclose(result, expected, rtol=1e-3, atol=1e-4)) def test_erf(self): inputs = [-5, 0.0, 0.5, 1.0, 2.0, 10.0]