Skip to content

Commit 6b0ce2a

Browse files
committed
[MLX] Updated to v0.25.2, and added MLX_CUDA
1 parent 15a66cf commit 6b0ce2a

File tree

3 files changed

+53
-13
lines changed

3 files changed

+53
-13
lines changed

M/MLX/MLX/build_tarballs.jl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Note that this script can accept some limited command-line arguments, run
2+
# `julia build_tarballs.jl --help` to see a usage message.
3+
using BinaryBuilder, Pkg
4+
5+
name = "MLX"
6+
version = v"0.25.2"
7+
8+
include(joinpath(@__DIR__, "..", "common.jl"))
9+
10+
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies;
11+
julia_compat,
12+
preferred_gcc_version,
13+
)

M/MLX/MLX_CUDA/build_tarballs.jl

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Note that this script can accept some limited command-line arguments, run
2+
# `julia build_tarballs.jl --help` to see a usage message.
3+
using BinaryBuilder, Pkg
4+
5+
const YGGDRASIL_DIR = "../../.."
6+
include(joinpath(YGGDRASIL_DIR, "fancy_toys.jl"))
7+
include(joinpath(YGGDRASIL_DIR, "platforms", "cuda.jl"))
8+
9+
name = "MLX_CUDA"
10+
version = v"0.25.2"
11+
12+
include(joinpath(@__DIR__, "..", "common.jl"))
13+
14+
platforms = CUDA.supported_platforms()
15+
16+
# Build for all supported CUDA toolkits
17+
for platform in platforms
18+
should_build_platform(triplet(platform)) || continue
19+
20+
cuda_deps = CUDA.required_dependencies(platform; static_sdk=true)
21+
22+
build_tarballs(ARGS, name, version, sources, script, [platform], products, [dependencies; cuda_deps];
23+
lazy_artifacts=true,
24+
julia_compat,
25+
preferred_gcc_version,
26+
augment_platform_block=CUDA.augment,
27+
skip_audit=true,
28+
dont_dlopen=true)
29+
end

M/MLX/build_tarballs.jl renamed to M/MLX/common.jl

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
1-
# Note that this script can accept some limited command-line arguments, run
2-
# `julia build_tarballs.jl --help` to see a usage message.
3-
using BinaryBuilder, Pkg
4-
5-
name = "MLX"
6-
version = v"0.25.1"
7-
81
sources = [
9-
GitSource("https://github.com/ml-explore/mlx.git", "eaf709b83e559079e212699bfc9dd2f939d25c9a"),
2+
GitSource("https://github.com/ml-explore/mlx.git", "659a51919fd3d70798e91e9e112075680b95556e"),
103
ArchiveSource("https://github.com/roblabla/MacOSX-SDKs/releases/download/macosx14.0/MacOSX14.0.sdk.tar.xz",
114
"4a31565fd2644d1aec23da3829977f83632a20985561a2038e198681e7e7bf49"),
125
# Using the PyPI wheel for aarch64-apple-darwin to get the metal backend, which would otherwise require the `metal` compiler to build (which is practically impossible to use from the BinaryBuilder build env.)
13-
FileSource("https://files.pythonhosted.org/packages/02/1b/7da8f1d224a4287cdd5eda77d878a73ff13c22e2c89097bc6effcc5c318a/mlx-$(version)-cp313-cp313-macosx_13_0_arm64.whl", "f2ca5c2f60804bbb3968ee3e087ce4cf5789065f4c927f76b025b3f5f122a63a"; filename = "mlx-aarch64-apple-darwin20.whl"),
6+
FileSource("https://files.pythonhosted.org/packages/d5/3f/5a3d036be09c32e76178eef7e51f4a9d1aef212f967927b62a9e49e2e4b0/mlx-$(version)-cp313-cp313-macosx_13_0_arm64.whl", "836e224efabbcdd55340c59148a6f36c69bd80e08b2e73fe6f6a6b02a00888b1"; filename = "mlx-aarch64-apple-darwin20.whl"),
147
]
158

169
script = raw"""
@@ -51,6 +44,12 @@ if [[ "$target" != *-apple-darwin* &&
5144
)
5245
fi
5346
47+
if [[ $bb_full_target == *cuda* ]]; then
48+
CMAKE_EXTRA_OPTIONS+=(
49+
-DMLX_BUILD_CUDA=ON
50+
)
51+
fi
52+
5453
install_license LICENSE
5554
5655
if [[ "$target" != aarch64-apple-darwin* ]]; then
@@ -104,7 +103,6 @@ dependencies = [
104103
HostBuildDependency(PackageSpec(name="CMake_jll")), # Need CMake >= 3.30 for BLA_VENDOR=libblastrampoline
105104
]
106105

107-
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies;
108-
julia_compat="1.9",
109-
preferred_gcc_version = v"10", # v10: C++-17, with std::reduce, required
110-
)
106+
julia_compat="1.9"
107+
108+
preferred_gcc_version = v"10" # v10: C++-17, with std::reduce, required

0 commit comments

Comments
 (0)