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

fix: OSX Build Fix Part 1: Metal #1365

Merged
merged 2 commits into from Nov 30, 2023
Merged

Conversation

dave-gray101
Copy link
Collaborator

It turns out I had not in fact, made Metal the default on OSX for LocalAI to match llama.cpp (where it matters most) - and because of that, I have not been testing with BUILD_TYPE=metal for a while... and metal builds were broken due to the backend refactoring.

This PR addresses this issue by:

  • Fixing the ggml-metal.metal path
  • Centralizing osx-specific logic
  • Just making BUILD_TYPE=metal the default if BUILD_TYPE isn't specified at all and we're on mac so this doesn't happen again

As a sidenote, GO_TAGS=stablediffusion on osx is also not currently using brew opencv - that will be corrected in a followup PR as I want to get this one merged first.

Copy link

netlify bot commented Nov 30, 2023

Deploy Preview for localai ready!

Name Link
🔨 Latest commit 1ac3800
🔍 Latest deploy log https://app.netlify.com/sites/localai/deploys/6568bcf4da8cb70007ccb69f
😎 Deploy Preview https://deploy-preview-1365--localai.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Owner

@mudler mudler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fantastic, thanks @dave-gray101 - it looks good here but I cannot test on Mac (yet?) so gonna have to trust you here :)

@mudler mudler changed the title OSX Build Fix Part 1: Metal fix: OSX Build Fix Part 1: Metal Nov 30, 2023
@mudler mudler linked an issue Nov 30, 2023 that may be closed by this pull request
@mudler mudler enabled auto-merge (squash) November 30, 2023 16:53
@mudler mudler disabled auto-merge November 30, 2023 18:50
@mudler mudler merged commit e94a34b into mudler:master Nov 30, 2023
18 checks passed
@mudler mudler added the bug Something isn't working label Dec 7, 2023
@dave-gray101 dave-gray101 deleted the osx-metal-fix branch February 21, 2024 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mac Metal : doc example still run in CPU
2 participants