[PR #12540] [MERGED] DRY out the runner lifecycle code #19136

Closed
opened 2026-04-16 06:58:09 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/12540
Author: @dhiltgen
Created: 10/8/2025
Status: Merged
Merged: 10/23/2025
Merged by: @dhiltgen

Base: mainHead: runner_lifecycle


📝 Commits (5)

  • f696709 DRY out the runner lifecycle code
  • 180b729 win: make incremental builds better
  • edda9df Adjust sort order to consider iGPUs
  • 1cc96b0 handle cpu inference oom scenarios
  • 28195a5 review comments

📊 Changes

16 files changed (+705 additions, -909 deletions)

View changed files

📝 discover/cpu_linux_test.go (+0 -10)
📝 discover/gpu.go (+15 -149)
📝 discover/runner.go (+22 -140)
📝 discover/types.go (+0 -143)
📝 llm/memory.go (+40 -31)
📝 llm/memory_test.go (+6 -14)
📝 llm/server.go (+225 -258)
📝 llm/server_test.go (+20 -19)
📝 ml/device.go (+215 -0)
📝 scripts/build_windows.ps1 (+15 -15)
📝 server/routes_debug_test.go (+5 -5)
📝 server/routes_generate_renderer_test.go (+5 -5)
📝 server/routes_generate_test.go (+9 -9)
📝 server/routes_harmony_streaming_test.go (+7 -7)
📝 server/sched.go (+69 -54)
📝 server/sched_test.go (+52 -50)

📄 Description

Now that discovery uses the runners as well, this unifies the runner spawning code into a single place. This also unifies GPU discovery types with the newer ml.DeviceInfo, and eliminates the pattern of passing a CPU as a mock GPU in the list. For CPU inference, the GPU list is now empty.


🔄 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/12540 **Author:** [@dhiltgen](https://github.com/dhiltgen) **Created:** 10/8/2025 **Status:** ✅ Merged **Merged:** 10/23/2025 **Merged by:** [@dhiltgen](https://github.com/dhiltgen) **Base:** `main` ← **Head:** `runner_lifecycle` --- ### 📝 Commits (5) - [`f696709`](https://github.com/ollama/ollama/commit/f696709e3b5556c6a3e1763f175d91bedf1b9895) DRY out the runner lifecycle code - [`180b729`](https://github.com/ollama/ollama/commit/180b729c51022616ea15bd2a50d6b0fa18c8d4d8) win: make incremental builds better - [`edda9df`](https://github.com/ollama/ollama/commit/edda9df131de10d4de7b5e95df1a1033b700e600) Adjust sort order to consider iGPUs - [`1cc96b0`](https://github.com/ollama/ollama/commit/1cc96b0b37d87ef4be24347eda626e7c29977029) handle cpu inference oom scenarios - [`28195a5`](https://github.com/ollama/ollama/commit/28195a596a650cf660353d6c78c0c249a737d21c) review comments ### 📊 Changes **16 files changed** (+705 additions, -909 deletions) <details> <summary>View changed files</summary> 📝 `discover/cpu_linux_test.go` (+0 -10) 📝 `discover/gpu.go` (+15 -149) 📝 `discover/runner.go` (+22 -140) 📝 `discover/types.go` (+0 -143) 📝 `llm/memory.go` (+40 -31) 📝 `llm/memory_test.go` (+6 -14) 📝 `llm/server.go` (+225 -258) 📝 `llm/server_test.go` (+20 -19) 📝 `ml/device.go` (+215 -0) 📝 `scripts/build_windows.ps1` (+15 -15) 📝 `server/routes_debug_test.go` (+5 -5) 📝 `server/routes_generate_renderer_test.go` (+5 -5) 📝 `server/routes_generate_test.go` (+9 -9) 📝 `server/routes_harmony_streaming_test.go` (+7 -7) 📝 `server/sched.go` (+69 -54) 📝 `server/sched_test.go` (+52 -50) </details> ### 📄 Description Now that discovery uses the runners as well, this unifies the runner spawning code into a single place. This also unifies GPU discovery types with the newer ml.DeviceInfo, and eliminates the pattern of passing a CPU as a mock GPU in the list. For CPU inference, the GPU list is now empty. --- <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-16 06:58:09 -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#19136