Repository navigation
fix(inference): pass managed Ollama's per-GPU reserve to llama.cpp - #14400
Merged
Merged
Conversation
…at Ollama enforces Ollama v0.40.14 doesn't use OLLAMA_GPU_OVERHEAD to fit GGUF layers, so the runtime also passes the reserve as LLAMA_ARG_FIT_TARGET, never below llama.cpp's 1024 MiB default. Removes the per-GPU free-memory rule, which duplicated check_memory, and corrects the stale Ollama weight-check sentence. Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Collaborator
Author
Authoring session — opening
|
cv
enabled auto-merge (squash)
November 11, 2026 08:46
Contributor
|
v1 documentation preview: https://nvidia-preview-nemoclaw-v1-pr-14400.docs.buildwithfern.com/nemoclaw |
cv
added a commit
that referenced
this pull request
Nov 11, 2026
…ms (#14413) The release notes now list every user-visible change on `v1` since the `v0.1.0-rc9` tag, including the breaking ones, and four example pages drop claims that later changes made false. ## Problem `docs/about/release-notes.md` listed three breaking changes and none of the features, fixes, and onboarding changes that reached `v1` after `v0.1.0-rc9`; it didn't name the configuration shapes the parser now rejects or the intent record version `v0.1.0-rc9` writes. Some example claims went stale: - `examples/spark/README.md` said the pinned OpenShell has the Podman TLS initialization blocker, ai-openshell/openshell#3427; its fix merged before OpenShell 0.1.0, and `v1` pins 0.1.7. - `examples/station/README.md` and `examples/gtc-dc/README.md` required exactly one visible GPU on the host; since #13929, `container.gpuDevices` lets a service on a host with more GPUs request one. - `examples/hcl/travel-team` said Fabric's Deep Agents adapter can't turn reasoning off, NVIDIA/NeMo-Fabric#433; NVIDIA/NeMo-Fabric#439 fixed that, and the pinned catalog's Deep Agents `reasoning_effort` accepts `none`. - The travel team cited #13313 for the booking key its service doesn't receive, but #13313 closed when `openshell_api` landed. ## Change - `docs/about/release-notes.md` gains "Changes Since v0.1.0-rc9", grouped by area, from the commits in `v0.1.0-rc9..origin/v1`; where a later commit changed an earlier one, the entry describes the current code, and changes added and removed after the tag aren't listed: - Agents and interfaces: #14037, #14038, #14269, #13981, #14024, #14186, #14052, #14385, #13971, #13858, #13947, #14039, #14042, #14044, #14343. - Inference: #13929, #14391, #14396, #14398, #14400, #13963, #13912, #13964, #14388, #14390, #14397. - Gateways and Kubernetes: #13909, #13970, #13922 (an existing namespace, refused at plan by #13756, is now bound; cluster-wide reads dropped), #14014, #14169, #13921. - Plan, apply, and diagnostics: #14224, #13756, #14141, #14133, #14135, #13775, #13744, #13701. - Onboarding: #13693, #13695, #13741, #13757, #13851, #13978, #14228, #14233, #14334, #14336. - Examples and builds: #14166, #14184, #14188, #14191, #14192, #14200, #13889, #14267, #14312, #14315, #14355, b30e9b4, #13781, #13813, #14246, and the pins in `versions.json` and `image/fabric/Dockerfile`. - Its breaking changes since the tag: - the intent record moving from 15, which `v0.1.0-rc9` writes, through 16 (#14266), 17 (#14343), 18 (#13929), 19 (#14391) and 20 (#14394); - name-keyed `sandboxes` and `inferenceProviders` (#13703, #13705); - a recipe `compatibility.gpu` outside every hardware profile (#13912); - model tuning the adapter doesn't accept (#14111), and Hermes's `max_tokens` losing its default (#14296); - `skills.paths` resolution (#14296); - endpoint and `networkCIDR` validation (#13847, #14081); - the HCL `gateway_values` attribute (#14014), and Kubernetes ownership receipts from before #13922 and #14014. The two earlier items stay, under their own heading. - `examples/spark/README.md` replaces the closed OpenShell#3427 blocker with the Podman and remote-model limits in `docs/resources/limits.md`. - `examples/station/README.md` and `examples/gtc-dc/README.md` require one GPU visible in the model container, and point to `container.gpuDevices` for a host with more. - `examples/hcl/travel-team/README.md` and `WALKTHROUGH.md` drop the NeMo-Fabric#433 limitation, and the travel team's booking-key statements link #14417 instead of #13313. Not listed, because both changes landed after the tag: Deep Agents Code (#14043, #14250), `compatibility.gpuCount` (#14391, #14394), and the "Creating infrastructure state" progress step (#14169, #14248). Checked and left unchanged: the root `README.md`, `crates/nemoclaw-onboarding/README.md`, `crates/nemoclaw-cli/assets/README.md`, `internal-docs/README.md`, the other example READMEs, and every example YAML header comment. The GPU autoscaling README and `load.sh` read the JSON fields `OperationResult` serializes, and ai-openshell/openshell#4287 is fixed only after the pinned 0.1.7. The two pre-tag release-note items still match the schema and SDK. `docs/README.md` is left to #14412, which retires the stale field reference snapshot it describes. Not verified: whether Hermes sends the booking key's placeholder to MCP servers; #14417 tracks the live check. ## Beyond CI Each relative link and anchor in the changed files resolves to an existing file and heading.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Managed Ollama services now pass their per-GPU reserve to llama.cpp as
LLAMA_ARG_FIT_TARGETas well as to Ollama asOLLAMA_GPU_OVERHEAD, and the docs say what each setting does and what NemoClaw enforces. This follows up #14396 with its review fixes and the amendment to decision 4.Problem
#14396, as merged, overstates what
OLLAMA_GPU_OVERHEADdoes on Ollama v0.40.14, the version the runtime image pins. Its docs and comments say the reserve leaves no GPU more than the budget, but Ollama reads it only for a log line (server/sched.go:661-669), the default context size (server/routes.go:2573), and the MLX runner (mlxrunner/client.go:401). GGUF layer fitting uses llama.cpp's--fitwith its own per-device margin, 1024 MiB by default, so the budget wasn't applied while a model loaded, even on one GPU.#14396 also added a per-GPU free-memory rule in
launchthat duplicateshardware_capacity::check_memoryand can't run with several GPUs yet. Andinference.mddescribes an Ollama weight-size check that no code path has run since #13457.Part of #14384, step 7. What's left:
hardware_capacity::budget,serving_memory, andcheck_memorystill read the single-GPUCapacity::gpu_memory, which is unset with two or more GPUs, so a multi-GPU capacity stops there before this code runs. The per-GPU fit check (every selected GPU has the budget free) belongs there.populatestill requires exactly one visible GPU, andcontainer.gpuDevicestakes one entry. Its live run covers two GPUs with a model between the per-GPU budget and 80% of one GPU's free memory, reading per-GPU usage fromnvidia-smi.Change
crates/nemoclaw-runtime/src/ollama/runtime/process.rs:gpu_limitsand its per-GPU free-memory rule are gone.launchcomputes the reserve, the largest free memory among the GPUs inCapacity::gpusminus the per-GPU budget, with the existing error when it would be negative, and the readiness bound, the budget times the number of GPUs. With one GPU, both equal the values before feat(inference): keep managed Ollama within its budget on each GPU #14396.LLAMA_ARG_FIT_TARGETis the same reserve rounded up to whole MiB.ollama serve --helpdocuments it as the "Target free VRAM margin per device for llama.cpp fit (MiB)", Ollama'sllama-serverinherits it (llm/llama_server.go:761-765), and llama.cpp applies one value to every device. When the reserve is below llama.cpp's 1024 MiB default (fit_params_targetincommon/common.hat llama.cpp b11963, which Ollama v0.40.14 pins), the runtime leaves the variable unset, so NemoClaw never lowers llama.cpp's margin. Unified-memory GPUs report no counters, get a reserve of 0, and keep llama.cpp's default.OLLAMA_GPU_OVERHEADstays, as decision 4 chose, andOLLAMA_SCHED_SPREADstays unset; tests pin both.docs/agents-inference/inference.md: corrects what feat(inference): keep managed Ollama within its budget on each GPU #14396 claimed. It describes both settings, and says what NemoClaw does and doesn't enforce. Ollama chooses its GPUs from raw free memory, so a model can land on one GPU with part of it offloaded to the CPU instead of spreading, and readiness then fails. NemoClaw enforces only the total, after the load, through/api/ps, which reports one total and not each GPU's share. The per-GPU budget is a margin llama.cpp keeps, not a guarantee NemoClaw checks. The stale weight-size sentence is replaced by what plan and readiness actually compare.For review: one-GPU behavior changes
size_vram == sizecheck, rather than loading fully on the GPU and failing its budget bound. Either way, startup fails.LLAMA_ARG_FIT_TARGETinherited, Ollama doesn't add its own margin for a vision projector (llm/llama_server.go:742-769), so a multimodal model gets NemoClaw's reserve without Ollama's projector padding.Beyond CI
Unverified: Ollama on two or more GPUs, and the effect of
LLAMA_ARG_FIT_TARGETon a live load. The multi-GPU cases are tested with fake GPU inventories only, because neither this host (one GB10, unified memory, where the variable stays unset) nor CI has several GPUs, and the runtime still requires one visible GPU. The Ollama and llama.cpp behavior above comes from reading their sources at the pinned revisions, not from a run.