cmake: add explicit metal version options#6370
cmake: add explicit metal version options#6370ggerganov merged 2 commits intoggml-org:masterfrom mattjcly:mattjcly/explicit-metal-version-options
Conversation
|
@ggerganov Hi Georgi, I dont understand why the Benchmark job is failing since yesterday. It looks it cannot access PR comments. Any idea ? |
|
Hm, not sure. I haven't made any changes to the runner. Does it matter if the branch is in this repo or in an external repo? I guess it shouldn't, but could be related? |
|
It might be because I closed the terminal session to the node and some of the processes died? I just tried to start the script with nohup ./start-github-runner-manager.sh ggerganov/llama.cpp ... &But this does not seem to work. The error in the logs is: Any suggestions? I've restarted it now, but I can't keep the session open all the time |
No I dont think it comes from the VM but github actions. I will investigate tom |
* cmake: add explicit metal version options * Update CMakeLists.txt --------- Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
* cmake: add explicit metal version options * Update CMakeLists.txt --------- Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
* cmake: add explicit metal version options * Update CMakeLists.txt --------- Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
Currently, if you want to build
llama.cppbinaries with metal enabled, you can only compile the metal libraries to be compatible with the minimum mac os version and metal shading language standard associated with your current machines SDK. This is the default behavior of of thexcrun metalcommand.This presents a problem if you ever want to build llama.cpp from a newer machine (say a Mac running macOS 14.x with default metal shading language 3.1), and have it be able to run on an older machine (say a Mac running macOS 13.x with default metal shading language 3.0).
With the current state of
llama.cpp, trying to perform the exact build above from macOS 14.x and running on macOS 13.x results in the following error during model load:By providing the new CMake options
LLAMA_METAL_MACOSX_VERSION_MINandLLAMA_METAL_STD, you can now explicitly set the macOS min version and metal shading library standard that your build will support:and you will be notified in the output of that cmake command:
Doing this allows for both macOS 13.x and macOS 14.x to run llama.cpp binaries built from macOS 14.x without metal incompatibility errors.
The default behavior of builds without those options set will remain the same (since default value of these variables is
"", and therefore will be ignored in the logic to add the flags toXC_FLAGS).