Skip to content
Merged

mlx 0.32.1 #299369

Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion Formula/m/mlx-c.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ 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
Expand Down Expand Up @@ -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
Expand All @@ -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;
6 changes: 3 additions & 3 deletions Formula/m/mlx.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
class Mlx < Formula
include Language::Python::Virtualenv

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
Expand Down
Loading