diff --git a/Formula/m/mlx-c.rb b/Formula/m/mlx-c.rb index a04e550872ab..eff45eecfd5e 100644 --- a/Formula/m/mlx-c.rb +++ b/Formula/m/mlx-c.rb @@ -4,13 +4,13 @@ class MlxC < Formula url "https://github.com/ml-explore/mlx-c/archive/refs/tags/v0.6.0.tar.gz" sha256 "6ec2eab86ed3ce661c0d9b834027870651546138b7b4470fa8ef5533498c79aa" license "MIT" - revision 3 + revision 4 compatibility_version 1 bottle do - sha256 cellar: :any, arm64_tahoe: "52a8f1aca73d431b5186e37a8b27ee72ef12f59955034fbaf77a4b7b1df85455" - sha256 cellar: :any, arm64_sequoia: "0c6d3cb05b3aec5e137193d3cba56aff68e42f9f522c89ee984c4e8061a367db" - sha256 cellar: :any, arm64_sonoma: "c59d08f72fbf8a926ff3b4adcbad7098efbbdebfb0297db7682d3af2230a4c41" + sha256 cellar: :any, arm64_tahoe: "856317588f1e0866678da73ee50ac191bc6aba472096b4bb021bafc582d1ee58" + sha256 cellar: :any, arm64_sequoia: "604afaea83fb354c7b487f975275c0fa30760da9a4e3f27cbeba93e70331ffc5" + sha256 cellar: :any, arm64_sonoma: "cb36d918641b9fb2e8e26e70eb2676ffc35b3f46801b0639409d1212a90eecdd" end depends_on "cmake" => :build @@ -59,6 +59,10 @@ class MlxC < Formula resolves "https://github.com/ml-explore/mlx-c/pull/114" end + # Fix compile cache API changes in MLX 0.32.1. Only uses a subset of the PR commit, so inlining. + # PR ref: https://github.com/ml-explore/mlx-c/pull/127 + patch :DATA + def install args = %w[ -DCMAKE_CXX_STANDARD=20 @@ -78,3 +82,28 @@ def install assert_match "array([0, 0.5, 1, 1.5, 2, 2.5], dtype=float32)", shell_output("./test") end end + +__END__ +diff --git a/mlx/c/compile.cpp b/mlx/c/compile.cpp +index bc7b864..c52b2d2 100644 +--- a/mlx/c/compile.cpp ++++ b/mlx/c/compile.cpp +@@ -42,7 +42,7 @@ extern "C" int mlx_detail_compile( + } + extern "C" int mlx_detail_compile_clear_cache(void) { + try { +- mlx::core::detail::compile_clear_cache(); ++ mlx::core::detail::compile_clear_cache(mlx::core::detail::compile_cache()); + } catch (std::exception& e) { + mlx_error(e.what()); + return 1; +@@ -51,7 +51,8 @@ extern "C" int mlx_detail_compile_clear_cache(void) { + } + extern "C" int mlx_detail_compile_erase(uintptr_t fun_id) { + try { +- mlx::core::detail::compile_erase(fun_id); ++ mlx::core::detail::compile_erase( ++ mlx::core::detail::compile_cache(), fun_id); + } catch (std::exception& e) { + mlx_error(e.what()); + return 1; diff --git a/Formula/m/mlx.rb b/Formula/m/mlx.rb index 90412c497a52..aae4928a224a 100644 --- a/Formula/m/mlx.rb +++ b/Formula/m/mlx.rb @@ -3,13 +3,13 @@ class Mlx < Formula desc "Array framework for Apple silicon" homepage "https://ml-explore.github.io/mlx/build/html/index.html" - url "https://github.com/ml-explore/mlx/archive/refs/tags/v0.32.0.tar.gz" - sha256 "8e74a0eb613861ce50c09402dd99dbc42b65a762e7fdd291caa39f611db978ec" + url "https://github.com/ml-explore/mlx/archive/refs/tags/v0.32.1.tar.gz" + sha256 "34fe1ec0e6baf886eee16c9a1d4c7bd26bbe74fe051225f0eb88a982fc9d2494" license all_of: [ "MIT", # main license "Apache-2.0", # metal-cpp resource ] - compatibility_version 4 + compatibility_version 5 head "https://github.com/ml-explore/mlx.git", branch: "main" livecheck do @@ -18,9 +18,9 @@ class Mlx < Formula end bottle do - sha256 cellar: :any, arm64_tahoe: "9a2d67e6de12deab51d676a827aa2c81e399e9e246395b8c826429cfb2392786" - sha256 cellar: :any, arm64_sequoia: "3a5895a698a5739f601f3cce2c6395603a242f378efe720728ba261e032619d4" - sha256 cellar: :any, arm64_sonoma: "91006da2921496b692df9d671d4c8f820ba3432bb636ac70d0d39fabc8e78f9d" + sha256 cellar: :any, arm64_tahoe: "5077bbcacc880777a11e7c1288e8ba4f1a392b559b57ed4effb5add2b67877f1" + sha256 cellar: :any, arm64_sequoia: "5eb3cc2571ebca454931f6048202a8cda40eec62f2a89e69b1c6cdb6956c9af8" + sha256 cellar: :any, arm64_sonoma: "1de4af659278713837dea58652d15845b7da04750e54c73c70500ac6ad2ed592" end depends_on "cmake" => :build