ml-explore / mlx-swift

Swift API for MLX
https://ml-explore.github.io/mlx-swift/
MIT License
683 stars 54 forks source link

Package installation via Xcode missing MLX's GPU.swift file #74

Closed tctrautman closed 7 months ago

tctrautman commented 7 months ago

First off, thanks for building and maintaining this repo -- it's super exciting.

Second, I'm new to Swift, so this might just be a dumb mistake on my part. But upon installing 0.10.0 via Xcode, it seems as though I'm missing the GPU.swift file in /Source/MLX, as seen below:

Screenshot 2024-04-26 at 1 37 50 PM

Any idea why this might have happened and how I might fix it?

Thank you!

davidkoski commented 7 months ago

0.10.0 is pretty old and doesn't include GPU (added since then). You can use main or wait a bit and I will have 0.12.0 tagged (I will try and keep the tags synced with the mlx versions they match and I have been a bit lax on tagging).

I would recommend using main for now

tctrautman commented 7 months ago

Ah, I didn't realize that, thanks. Do you know if there's a way to specify just using the latest version of the main branch while installing via Xcode (not initially seeing a way to do this)?

Or would it be best to remove the package in Xcode and install with CMake?

davidkoski commented 7 months ago

You have a couple of ways to do it:

That will get you the bare mlx-swift library, but it may be more interesting to check out the examples that make use of it:

If you open the .xcodeproj file in there it will check out the dependencies, including mlx-swift. It has a number of example applications and tools that you can try. This is probably the more useful path if you want to use mlx-swift rather than work on mlx-swift.

tctrautman commented 7 months ago

Thanks so much for your help, David! I'm good to go now.