[PR #7139] [MERGED] llama: Decouple patching script from submodule #43572

Closed
opened 2026-04-24 23:10:52 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/7139
Author: @dhiltgen
Created: 10/8/2024
Status: Merged
Merged: 10/17/2024
Merged by: @dhiltgen

Base: mainHead: go_server_patching


📝 Commits (2)

  • 86b43f6 Refine llama.cpp vendoring workflow tools
  • 6b74155 Run new make sync and patch flow

📊 Changes

16 files changed (+374 additions, -181 deletions)

View changed files

📝 .github/workflows/test.yaml (+1 -1)
📝 .gitignore (+2 -1)
📝 llama/Makefile (+3 -0)
📝 llama/README.md (+77 -3)
📝 llama/build-info.cpp (+1 -27)
llama/make/Makefile.sync (+190 -0)
📝 llama/patches/0001-cuda.patch (+11 -0)
📝 llama/patches/0002-pretokenizer.patch (+9 -0)
📝 llama/patches/0003-metal.patch (+9 -0)
📝 llama/patches/0004-ggml-metal.patch (+9 -0)
📝 llama/patches/0005-embeddings.patch (+16 -8)
📝 llama/patches/0006-clip-unicode.patch (+9 -0)
📝 llama/patches/0007-solar-pro.patch (+17 -1)
📝 llama/patches/0008-conditional-fattn.patch (+11 -2)
📝 llama/patches/0009-blas.patch (+9 -0)
llama/sync.sh (+0 -138)

📄 Description

The current patching script relies on the existing llama.cpp submodule, which we plan to remove in favor of the vendored code soon, so this updates the patching flow to no longer rely on that. It still uses the git commit from the submodule to ensure we don't drift while the submodule is still present. In the commit that removes the submodule in the future, this would be switched to a manifest file recording the git hash we're sync'd to.

This adjusts our patches to be mailbox format patches which can be round-tripped through the system deterministically. In doing so, this should improve developer experience when updating the llama.cpp commit, or working on fixes/features that impact the native code.

Fixes #2534


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/7139 **Author:** [@dhiltgen](https://github.com/dhiltgen) **Created:** 10/8/2024 **Status:** ✅ Merged **Merged:** 10/17/2024 **Merged by:** [@dhiltgen](https://github.com/dhiltgen) **Base:** `main` ← **Head:** `go_server_patching` --- ### 📝 Commits (2) - [`86b43f6`](https://github.com/ollama/ollama/commit/86b43f6f95c326f56359578aecce00ff81cb898a) Refine llama.cpp vendoring workflow tools - [`6b74155`](https://github.com/ollama/ollama/commit/6b74155896a25b734a34bd9b2035a154eeef1f7b) Run new make sync and patch flow ### 📊 Changes **16 files changed** (+374 additions, -181 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/test.yaml` (+1 -1) 📝 `.gitignore` (+2 -1) 📝 `llama/Makefile` (+3 -0) 📝 `llama/README.md` (+77 -3) 📝 `llama/build-info.cpp` (+1 -27) ➕ `llama/make/Makefile.sync` (+190 -0) 📝 `llama/patches/0001-cuda.patch` (+11 -0) 📝 `llama/patches/0002-pretokenizer.patch` (+9 -0) 📝 `llama/patches/0003-metal.patch` (+9 -0) 📝 `llama/patches/0004-ggml-metal.patch` (+9 -0) 📝 `llama/patches/0005-embeddings.patch` (+16 -8) 📝 `llama/patches/0006-clip-unicode.patch` (+9 -0) 📝 `llama/patches/0007-solar-pro.patch` (+17 -1) 📝 `llama/patches/0008-conditional-fattn.patch` (+11 -2) 📝 `llama/patches/0009-blas.patch` (+9 -0) ➖ `llama/sync.sh` (+0 -138) </details> ### 📄 Description The current patching script relies on the existing llama.cpp submodule, which we plan to remove in favor of the vendored code soon, so this updates the patching flow to no longer rely on that. It still uses the git commit from the submodule to ensure we don't drift while the submodule is still present. In the commit that removes the submodule in the future, this would be switched to a manifest file recording the git hash we're sync'd to. This adjusts our patches to be mailbox format patches which can be round-tripped through the system deterministically. In doing so, this should improve developer experience when updating the llama.cpp commit, or working on fixes/features that impact the native code. Fixes #2534 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-24 23:10:52 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#43572