Closed makslevental closed 8 months ago
@awni can you comment here?
On the swift side I am not aware of any macOS / iOS requirements, but it does build the Metal backend:
If you were to use the CPU (no metal) backend maybe it would work:
On the swift side I am not aware of any macOS / iOS requirements, but it does build the Metal backend:
I guess you mean this line in particular? https://github.com/ml-explore/mlx-swift/blob/main/Package.swift#L82? I haven't stared at a Package.swift in a bit so not sure (just looks like the exact line you pointed to actually builds the no_metal
and accelerate
backends which maybe is the same thing as metal?). Anyway thanks for the code pointers - that's enough for me to start poking around.
FWIW you should definitely be able to coerce it to build on linux. We build MLX core on linux every time we run the tests (in cmake using MLX_BUILD_METAL=OFF
which pulls in the no_metal
directory.
All of the tests should clear but you wont get any GPU support. We will gladly fix bugs if you find them but we don't plan to do much in the way of perf optimization for that back-end (we would certainly accept reasonable PRs for it though).
just looks like the exact line you pointed to actually builds the no_metal and accelerate backends which maybe is the same thing as metal?
The opposite -- those are exclude lines so it removes them from the build.
The opposite -- those are exclude lines so it removes them from the build.
exclude: [
...
code-comprehension++ (thanks).
FWIW you should definitely be able to coerce it to build on linux. We build MLX core on linux every time we run the tests (in cmake using MLX_BUILD_METAL=OFF which pulls in the no_metal directory.
Excellent
All of the tests should clear but you wont get any GPU support.
That's fine - I'm mostly just curious to play around with a NumPy-like interface in Swift rather than interested in perf (at the moment).
We will gladly fix bugs if you find them but we don't plan to do much in the way of perf optimization for that back-end (we would certainly accept reasonable PRs for it though).
Sure - if I manage to implement something nice I'll PR it (and I have a MBP so I'll be able to test locally to check compat).
This is possibly a dumb question (since I believe the explicit/expressed goal here is to target various Apple/ARM hardware) but would
mlx-swift
work for Linux Swift users? And if not are the blockers "hard", i.e., could one hack around them?I haven't dived into the codebase but I'm wondering if you guys have CPU implementations of the various operations and not just SVE/SME/etc kernels, in which case one could compile
mlx-swift
on an x86 CPU and at least get a nice NumPy like library for Swift.