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

metal : Extend how Llama.cpp locates metal resources (#10675) #10676

Merged

Conversation

ormandi
Copy link
Contributor

@ormandi ormandi commented Dec 5, 2024

  • It searches the resource file in the directory where the current binary is located as well.
  • Resolves symbolic links.

Rationale:

When we plug this dependency into a Bazel build and run it in the context of Bazel (e.g. testing):

  • the execution directory is often very different from where the files are located and no direct control over this (Bazel sandboxing),
  • the Bazel sandbox often use symbolic links to make files available.

With this patch, we can have the resource file added to the target, can build and run tests in the context of Bazel.

Make sure to read the contributing guidelines before submitting a PR

  * It searches the resource file in the directory where the current
    binary is located as well.
  * Resolves symbolic links.

Rationale:

When we plug this dependency into a Bazel build and run it in the
context of Bazel (e.g. testing):

  * the execution directory is often very different from where the files
    are located and no direct control over this (Bazel sandboxing),
  * the Bazel sandbox often use symbolic links to make files available.

With this patch, we can have the resource file added to the target,
can build and run tests in the context of Bazel.
@github-actions github-actions bot added ggml changes relating to the ggml tensor library for machine learning Apple Metal https://en.wikipedia.org/wiki/Metal_(API) labels Dec 5, 2024
ggml/src/ggml-metal/ggml-metal.m Outdated Show resolved Hide resolved
ggml/src/ggml-metal/ggml-metal.m Outdated Show resolved Hide resolved
ormandi and others added 2 commits December 6, 2024 11:10
Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
@ormandi
Copy link
Contributor Author

ormandi commented Dec 6, 2024

Thank you for the suggestions, and sorry for the formatting errors.

@ggerganov ggerganov merged commit 86a1934 into ggerganov:master Dec 7, 2024
1 check passed
arthw pushed a commit to arthw/llama.cpp that referenced this pull request Dec 20, 2024
* metal : Extend how Llama.cpp locates metal resources (ggerganov#10675)

  * It searches the resource file in the directory where the current
    binary is located as well.
  * Resolves symbolic links.

Rationale:

When we plug this dependency into a Bazel build and run it in the
context of Bazel (e.g. testing):

  * the execution directory is often very different from where the files
    are located and no direct control over this (Bazel sandboxing),
  * the Bazel sandbox often use symbolic links to make files available.

With this patch, we can have the resource file added to the target,
can build and run tests in the context of Bazel.

* Update ggml/src/ggml-metal/ggml-metal.m

Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>

* Update ggml/src/ggml-metal/ggml-metal.m

Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>

---------

Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Apple Metal https://en.wikipedia.org/wiki/Metal_(API) ggml changes relating to the ggml tensor library for machine learning
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants