From 142884f634b76e651651184e0bbd32f2b671d8d1 Mon Sep 17 00:00:00 2001 From: Jesper Stemann Andersen Date: Thu, 30 Jan 2025 10:57:00 +0100 Subject: [PATCH] [MLX] Updated to "master" Updated - removes need for patches Disabled MLX_BUILD_GGUF for Windows Re-enabled MLX_BUILD_GGUF and MLX_BUILD_SAFETENSORS for Windows and FreeBSD Added patch for distributed/ring on Windows --- M/MLX/build_tarballs.jl | 9 +++------ M/MLX/bundled/patches/nbits32-ops.patch | 13 ------------- .../patches/win32_freebsd-jit_compiler.patch | 13 ------------- 3 files changed, 3 insertions(+), 32 deletions(-) delete mode 100644 M/MLX/bundled/patches/nbits32-ops.patch delete mode 100644 M/MLX/bundled/patches/win32_freebsd-jit_compiler.patch diff --git a/M/MLX/build_tarballs.jl b/M/MLX/build_tarballs.jl index 88ba3bc6f88..c07eb25adcf 100644 --- a/M/MLX/build_tarballs.jl +++ b/M/MLX/build_tarballs.jl @@ -3,14 +3,14 @@ using BinaryBuilder, Pkg name = "MLX" -version = v"0.22.0" +version = v"0.22.1" # unofficial sources = [ - GitSource("https://github.com/ml-explore/mlx.git", "1ce0c0fcb0f58cb9322981a65d267abc41cc2785"), + GitSource("https://github.com/ml-explore/mlx.git", "2d8e6674009f124747c2047d27aed71cc3c8ee47"), # master ArchiveSource("https://github.com/roblabla/MacOSX-SDKs/releases/download/macosx14.0/MacOSX14.0.sdk.tar.xz", "4a31565fd2644d1aec23da3829977f83632a20985561a2038e198681e7e7bf49"), # Using the PyPI wheel for aarch64-apple-darwin to get the metal backend, which requires the `metal` compiler to build (which is practically impossible to use from the BinaryBuilder build env.) - FileSource("https://files.pythonhosted.org/packages/62/2b/427896261bc8d940eff561e6199d1aee9dbdc7caa117486654a44d7d793c/mlx-$(version)-cp313-cp313-macosx_13_0_arm64.whl", "50d0d76826cfe939025791ce2c014e743ec7aff7aa67194ffaef40c40e574ef4"; filename = "mlx-aarch64-apple-darwin20.whl"), + FileSource("https://files.pythonhosted.org/packages/62/2b/427896261bc8d940eff561e6199d1aee9dbdc7caa117486654a44d7d793c/mlx-0.22.0-cp313-cp313-macosx_13_0_arm64.whl", "50d0d76826cfe939025791ce2c014e743ec7aff7aa67194ffaef40c40e574ef4"; filename = "mlx-aarch64-apple-darwin20.whl"), DirectorySource("./bundled"), ] @@ -25,9 +25,6 @@ fi cd $WORKSPACE/srcdir/mlx -atomic_patch -p1 ../patches/nbits32-ops.patch -atomic_patch -p1 ../patches/win32_freebsd-jit_compiler.patch - CMAKE_EXTRA_OPTIONS=() if [[ "$target" == x86_64-apple-darwin* ]]; then CMAKE_EXTRA_OPTIONS+=("-DMLX_ENABLE_X64_MAC=ON") diff --git a/M/MLX/bundled/patches/nbits32-ops.patch b/M/MLX/bundled/patches/nbits32-ops.patch deleted file mode 100644 index 37fa9ab7565..00000000000 --- a/M/MLX/bundled/patches/nbits32-ops.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/mlx/ops.cpp b/mlx/ops.cpp -index f1ca2e94..067f4ff2 100644 ---- a/mlx/ops.cpp -+++ b/mlx/ops.cpp -@@ -824,7 +824,7 @@ array slice_update( - - // Broadcast update with unspecified axes - auto up_shape = update.shape(); -- auto dim_diff = std::max(src.ndim() - update.ndim(), 0ul); -+ auto dim_diff = std::max(src.ndim() - update.ndim(), (size_t)0); - up_shape.insert( - up_shape.begin(), src.shape().begin(), src.shape().begin() + dim_diff); - for (int d = dim_diff; d < src.ndim(); ++d) { diff --git a/M/MLX/bundled/patches/win32_freebsd-jit_compiler.patch b/M/MLX/bundled/patches/win32_freebsd-jit_compiler.patch deleted file mode 100644 index 5ffbedb7283..00000000000 --- a/M/MLX/bundled/patches/win32_freebsd-jit_compiler.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/mlx/backend/common/jit_compiler.cpp b/mlx/backend/common/jit_compiler.cpp -index 34d57138..e017f604 100644 ---- a/mlx/backend/common/jit_compiler.cpp -+++ b/mlx/backend/common/jit_compiler.cpp -@@ -133,7 +133,7 @@ std::string JitCompiler::exec(const std::string& cmd) { - if (status == -1) { - throw std::runtime_error("pclose() failed."); - } --#ifdef _MSC_VER -+#if defined(_WIN32) || defined(__FreeBSD__) - int code = status; - #else - int code = WEXITSTATUS(status);