-
Notifications
You must be signed in to change notification settings - Fork 44
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 compilation w/ metal feature enabled #39
base: master
Are you sure you want to change the base?
Conversation
When creating object file with `compile_metal`, the object file is `<some_hash_value>-ggml-metal.o`, not `ggml-metal.o` - looks like cc-rs does this in `objects_from_files` to avoid overwriting (in general) if files in subdirectories would produce objects with the same hash name. Since we explicitly link against the ggml-{metal,cuda} etc. object files, have to be more general to find the object files.
(Should be dir, not individual header file)
I just tried this from your branch and received the following error:
the actual files written in the target look as follows.
|
Hmm that looks like need to change compile_llama as well (to look for
and
This feels like an antipattern though, there should be a better way of getting cc-rs to link in the needed object files (is there some linker path we can specify?) without explicitly naming them each individual file. |
I don't disagree, but I've yet to fully unroll how this all works well enough to suggest a better way. I've forked the mainline, and reproduced your changes in my own. I'm rather invested in getting this working and I am on vacation this coming week. I'm going to try to see what I can figure out. 🤞🏻 Wish me luck. (btw, I also have a linux workstation with a gtx1070ti I can test against. No windows.) My laptop setup is pretty much stock. Using stable toolchain, rust and cargo are up to date. I'll pass on going through the trouble of redacting and sharing my environment, suffice to say I don't have any compiler or linker/library env vars set messing things up.
|
A potentially iImportant detail I had overlooked, I can build just fine in the top directory of the repository. I can pass in metal as a feature, and it works well too. If I change directory to |
That is a good detail to note, I can reproduce that error (running example from I'm using |
any updates? I still seem to get this error llama.cpp/ggml.o: No such file or directory |
I don't believe this problem is MacOS specific, or even specific to this PR/branch. I've cloned the main branch of the upstream repository on Debian 12 and encounter the same issue when building the example or trying to use the package as a cargo dependency.
|
<hash>-ggml-metal.o
fileWhen creating object file with
compile_metal
, the object file is<some_hash_value>-ggml-metal.o
, notggml-metal.o
- looks like cc-rs does this inobjects_from_files
to avoid overwriting (in general) if files in subdirectories would produce objects with the same hash name.Since we explicitly link against the ggml-{metal,cuda} etc. object files, have to be more general to find the object files.
compile_metal
such that specifies directory (not the ggml-metal.h header specifically)