From 28301807c2c5d7c42c25c139d6dfa26a8910438e Mon Sep 17 00:00:00 2001 From: Awni Hannun Date: Thu, 7 Mar 2024 13:57:58 -0800 Subject: [PATCH] Version bump and os error (#807) --- CMakeLists.txt | 2 +- python/mlx/_os_warning.py | 9 +++++++++ python/src/mlx.cpp | 1 + setup.py | 2 +- 4 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 python/mlx/_os_warning.py diff --git a/CMakeLists.txt b/CMakeLists.txt index ce416401b..4e6baeb26 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ option(MLX_BUILD_METAL "Build metal backend" ON) option(BUILD_SHARED_LIBS "Build mlx as a shared library" OFF) if(NOT MLX_VERSION) - set(MLX_VERSION 0.5.1) + set(MLX_VERSION 0.6.0) endif() # --------------------- Processor tests ------------------------- diff --git a/python/mlx/_os_warning.py b/python/mlx/_os_warning.py new file mode 100644 index 000000000..7d40b9f4e --- /dev/null +++ b/python/mlx/_os_warning.py @@ -0,0 +1,9 @@ +import platform + +if platform.system() == "Darwin": + version = tuple(map(int, platform.mac_ver()[0].split("."))) + major, minor = version[0], version[1] + if (major, minor) < (13, 5): + raise ImportError( + f"Only macOS 13.5 and newer are supported, not {major}.{minor}" + ) diff --git a/python/src/mlx.cpp b/python/src/mlx.cpp index 5fb9e74e2..c0f6e7dd4 100644 --- a/python/src/mlx.cpp +++ b/python/src/mlx.cpp @@ -24,6 +24,7 @@ PYBIND11_MODULE(core, m) { m.doc() = "mlx: A framework for machine learning on Apple silicon."; auto reprlib_fix = py::module_::import("mlx._reprlib_fix"); + py::module_::import("mlx._os_warning"); init_device(m); init_stream(m); diff --git a/setup.py b/setup.py index 9b7816bce..fc574037c 100644 --- a/setup.py +++ b/setup.py @@ -152,7 +152,7 @@ if __name__ == "__main__": setup( name="mlx", - version=get_version("0.5.1"), + version=get_version("0.6.0"), author="MLX Contributors", author_email="mlx@group.apple.com", description="A framework for machine learning on Apple silicon.",