Metal installation documentation

Open Beginner friendly
#1,968 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
80/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Stale
Tech stack
python
Domain
documentation

Research direction

Check the current installation documentation for llama-cpp-python, likely in README.md or docs/install.md. Verify if Metal backend is indeed enabled by default on macOS in the latest release. Compare with the upstream llama.cpp documentation linked in the issue. Update the documentation to clarify that CMAKE_ARGS environment variable may no longer be required for Metal support.

Written by the indexing model from the issue text.

Description

I tried setting up llama-cpp-python in the current version 0.3.7 on my MacBook M4 Pro.
In the first step I only installed via pip install llama-cpp-python --no-cache-dir without specifiying the environment variable for Metal backend support.
I set the n_gpu_layers to -1 to fully use the GPU.

The interesting thing is the GPU was used even without having to install the Metal backend support as stated in the current documentation. I double checked this with a fresh start and explicitely setting the CMAKE_ARGS env variable and did not see and difference in terms of performance or GPU usage.

This is pretty handy, because when not using pip for dependency management (e.g. poetry) passing the environment variable did not work on my side.

Maybe the documentation should be updated to state that the env arguments are no longer required? This would also reflect the documentation in https://github.com/ggml-org/llama.cpp/blob/master/docs/build.md#metal-build where it states that: "On MacOS, Metal is enabled by default"

This would also mean, that custom pre-built wheels are no longer required as well.

Dominant language
Python
Stars
10.6k
Forks
1.5k
Avg merge
23m
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from abetlen/llama-cpp-python

All issues in abetlen/llama-cpp-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.