Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake : support build for iOS/tvOS #3116

Merged
merged 3 commits into from
Sep 11, 2023
Merged

Conversation

jhen0409
Copy link
Sponsor Collaborator

@jhen0409 jhen0409 commented Sep 11, 2023

Fix #3106.

Update the CMakeLists.txt and add CI steps to ensure to continue to work.

@alonfaraj
Copy link
Contributor

alonfaraj commented Sep 11, 2023

Great!
Maybe it worth to have a separate job for each build (iOS, tvOS) and not putting all together inside macOS-latest-cmake?
It would be easier to monitor if one of them fails and keep them independent.

@jhen0409
Copy link
Sponsor Collaborator Author

Great! Maybe it worth to have a separate job for each build (iOS, tvOS) and not putting all together inside macOS-latest-cmake? It would be easier to monitor if one of them fails and keep them independent.

Yeah it might be better and same as other builds, will change it before merge.

@jhen0409 jhen0409 merged commit 1b0d092 into ggerganov:master Sep 11, 2023
28 checks passed
@jhen0409 jhen0409 deleted the cmake-ios-build branch September 11, 2023 11:49
@cyrilzakka
Copy link

Would it be possible to add VisionOS support as well?

@jhen0409
Copy link
Sponsor Collaborator Author

Would it be possible to add VisionOS support as well?

I've tried an iOS build on visionOS simulator before and it works well. Not yet to try with a visionOS project, but I think it should be easy by add the OS target.

@cyrilzakka
Copy link

Thanks! In case you also have a sample Swift/VisionOS project to look at, I'd love to take a look at it too! I tried using llm_farm which is based off of this project but it crashes on model load.

@jhen0409
Copy link
Sponsor Collaborator Author

Thanks! In case you also have a sample Swift/VisionOS project to look at, I'd love to take a look at it too! I tried using llm_farm which is based off of this project but it crashes on model load.

It was an internal iOS project with target visionOS + Designed for iPad. I can switch back to Xcode beta to give it try again in the next few days.

Also, if it's a Simulator, during to Metal limitations we can't use constant buffers more than 14, so remember to use ngl = 0.

@cyrilzakka
Copy link

cyrilzakka commented Oct 2, 2023

@jhen0409 Sorry to have to ask, but where do I set the ngl 0 flag in Swift? I see it as an option in the CI but not anywhere else (e.g. ggml-metal). Thanks for your patience!

@jhen0409
Copy link
Sponsor Collaborator Author

jhen0409 commented Oct 2, 2023

@jhen0409 Sorry to have to ask, but where do I set the ngl 0 flag in Swift? I see it as an option in the CI but not anywhere else (e.g. ggml-metal). Thanks for your patience!

To be clear, it's called n_gpu_layers in the parameters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants