[PR #6402] [MERGED] Override numParallel in pickBestPartialFitByLibrary() only if unset. #12103

Closed
opened 2026-04-12 23:49:38 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/6402
Author: @rick-github
Created: 8/18/2024
Status: Merged
Merged: 8/19/2024
Merged by: @dhiltgen

Base: mainHead: numParallel


📝 Commits (3)

📊 Changes

1 file changed (+4 additions, -1 deletions)

View changed files

📝 server/sched.go (+4 -1)

📄 Description

pickBestPartialFitByLibrary() sets numParallel = 1, but doesn't adjust req.opts.NumCtx. If OLLAMA_NUM_PARALLEL has been set, NumCtx = OLLAMA_NUM_PARALLEL * defaultParallel. Unconditionally setting numParallel to 1 causes problems in needsReload() - because NumCtx hasn't been reset, !reflect.DeepEqual(optsExisting, optsNew) always fails, causing the model to be reloaded for every request.

It's not clear why numParallel is forced to 1, testing indicates that models operate normally with a partial load and parallelism, so this PR changes the code to set numParallel and req.opts.NumCtx only if unset.

Fixes https://github.com/ollama/ollama/issues/6148
Fixes https://github.com/ollama/ollama/issues/6271


🔄 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/6402 **Author:** [@rick-github](https://github.com/rick-github) **Created:** 8/18/2024 **Status:** ✅ Merged **Merged:** 8/19/2024 **Merged by:** [@dhiltgen](https://github.com/dhiltgen) **Base:** `main` ← **Head:** `numParallel` --- ### 📝 Commits (3) - [`0ad0e73`](https://github.com/ollama/ollama/commit/0ad0e738cd7ed1266b3c210ad54dcd2b70142563) Override numParallel only if unset. - [`9352eeb`](https://github.com/ollama/ollama/commit/9352eeb752531decccc7c6b91a07bc3dd5efa67e) Reset NumCtx. - [`885cf45`](https://github.com/ollama/ollama/commit/885cf45087863aa2e064a05da99e8bd07d69970a) Fix white space. ### 📊 Changes **1 file changed** (+4 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `server/sched.go` (+4 -1) </details> ### 📄 Description pickBestPartialFitByLibrary() sets numParallel = 1, but doesn't adjust req.opts.NumCtx. If OLLAMA_NUM_PARALLEL has been set, NumCtx = OLLAMA_NUM_PARALLEL * defaultParallel. Unconditionally setting numParallel to 1 causes problems in needsReload() - because NumCtx hasn't been reset, ` !reflect.DeepEqual(optsExisting, optsNew)` always fails, causing the model to be reloaded for every request. It's not clear why numParallel is forced to 1, testing indicates that models operate normally with a partial load and parallelism, so this PR changes the code to set numParallel and req.opts.NumCtx only if unset. Fixes https://github.com/ollama/ollama/issues/6148 Fixes https://github.com/ollama/ollama/issues/6271 --- <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-12 23:49:38 -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#12103