Repository navigation
fix(vllm): check a dedicated-memory recipe's GPU budget against GPU memory - #13912
Merged
Merged
Conversation
…emory A recipe service was budgeted as unified memory whatever GPU it named, so a recipe for a dedicated-memory GPU was checked against host RAM and its --gpu-memory-utilization was divided by host memory. A recipe now takes its memory architecture from the hardware profile whose GPU family includes compatibility.gpu, and a name outside every profile is rejected. A dedicated-memory recipe gets the GPU total and free memory checks and the GPU total as the divisor; its startup check uses startupHeadroomGiB in place of the fixed 20 GiB.
The dedicated-memory recipe test kept host total memory above the 60 GiB budget, so it would not catch a check of that budget against host RAM. It now uses a 48 GiB host. The reference's list of parser checks beyond the schema names the recipe GPU's hardware-profile check.
Contributor
|
v1 documentation preview: https://nvidia-preview-nemoclaw-v1-pr-13912.docs.buildwithfern.com/nemoclaw |
Contributor
Author
Authoring session — opening
|
rsliter
approved these changes
Oct 28, 2026
cv
pushed a commit
that referenced
this pull request
Oct 29, 2026
…mory GPUs (#13963) ## Failure A managed vLLM or Ollama service on a dedicated-memory GPU needed `memory.hostReserveGiB` of at least 28 (#13833). That floor came from MiaAI Lab's recipe for a single DGX Spark, a unified-memory host (credited in `crates/nemoclaw-runtime/NOTICE.md`). On dedicated memory, a service without a recipe needs the reserve plus a fixed 20 GiB of available host memory to start; a vLLM recipe uses its own `startupHeadroomGiB` (#13912). So no service without a recipe could start on a host with less than 48 GiB available, such as AWS's 16 and 32 GiB g4dn, g5 and g6 instances, whose T4, A10G and L4 GPUs have hardware profiles. ## Decision ```mermaid flowchart LR Service["vLLM or Ollama service"] --> Dedicated["dedicated-memory profile<br/>or dedicated hardware"] Service --> Unified["unified-memory profile<br/>(dgx-spark, rtx-spark)"] Service --> Recipe["vLLM recipe"] Dedicated --> Six["hostReserveGiB 6 to 64"] Unified --> TwentyEight["hostReserveGiB 28 to 64"] Recipe --> TwentyEight ``` - **Floor:** on dedicated-memory hardware, the floor is 6 GiB, from the measured model loads below. It is the largest host-memory use I recorded during either load, rounded up. - **What startup needs at the floor:** 26 GiB available, the reserve plus the unchanged 20 GiB headroom. So a 32 GiB host with 26 GiB available passes the startup check, and a 16 GiB host still can't. - **What a load leaves:** after a load like the measured one, at least 20 GiB stays available. That is 8 GiB above the watchdog's default 12 GiB free-memory gate. - **Unified-memory profiles and recipes:** they keep 28, through an `if/then` rule on the service, beside the existing unified-memory rules. - Recipes keep 28 because the issue asks for it and no recipe was measured. - It isn't because they count as unified memory: #13912 made a recipe for a dedicated-memory GPU use dedicated-memory checks. - **Unchanged:** the default stays 32, and the 20 GiB headroom stays fixed. No field is added. - **Docs:** the field descriptions, `docs/models.md` and the runtime `NOTICE.md` give the floor for each memory architecture. ## Measurement | | | |---|---| | **Host** | Dell Pro Max with Station GB300, aarch64. One NVIDIA GB300: 256,703 MiB dedicated GPU memory, driver 615.71.09. MemTotal 486.4 GiB. Docker 29.9.2, cgroup v2. | | **Source** | `v1` `15df7d09b` plus #13912 (`a14871e87`). Bundle `0.1.0-dev.ece989e3c5b795d0`. | | **vLLM runtime image** | `nc-13833-vllm@sha256:d47bd0f1b20a03a4f04781ed010255bff2029b749e57eb7e4306149158549045` | | **Ollama runtime image** | `nc-13833-ollama@sha256:7185a30298fe74a746f5d8189bef3144e790e6f230213cf3dd84d19f8f3a1cd5` | | **Agent image** | Dummy agent, `nc-13833@sha256:7b65a6f0ba6bdf28bb268512f1781ce648aecf6d355e275a806e04f61b709319` | | **OpenShell pins** | Gateway `sha256:ca0bc15a…`, supervisor `sha256:fabcd01f…`, sandbox `sha256:e9adf9ec…` | **Method.** - Each service had its own `nemoclaw apply`. The deployment had a managed Docker gateway, one service with profile `gb300` and the default reserve, and a dummy-agent sandbox. - After apply, I sent one chat request. Then I destroyed the deployment and removed its retained objects. - A sampler read host `/proc/meminfo` once per second, as the runtime's startup check and watchdog do. It also read the service container's cgroup memory. - The window runs from the sample before each runtime's startup check to the end of the request: - vLLM checks after its download, so the window starts before `loading:`. - Ollama checks before its pull, so the window starts at container start. | Service | Model | Lowest `MemAvailable`: drop in window | Watchdog view (lowest 5-sample rolling maximum): drop | Container anon + shmem peak | Drop from before apply | |---|---|---|---|---|---| | vLLM, `gpuMemoryGiB` 20, `kvCacheGiB` 6, eager | `Qwen/Qwen3-4B` `1cfa9a72…`, 7.49 GiB | 459.45 GiB: 5.39 GiB | 459.79 GiB: 5.05 GiB | 5.71 GiB | 5.86 GiB | | Ollama, `gpuMemoryGiB` 14, `contextTokens` 16384 | `qwen3:8b` `500a1f06…`, Q4_K_M 4.87 GiB | 464.31 GiB: 0.44 GiB | 464.37 GiB: 0.38 GiB | 0.80 GiB | 1.16 GiB | What each run showed: - **vLLM:** loaded in 3 min 30 s, with weights taking 143 s. It answered the request. - **Ollama:** loaded fully on the GPU (`size_vram` equal to `size`) and returned 64 completion tokens. Limits of the measurement: - These are one model per backend on a Grace host. They stand in for PCIe AMD64 hosts with T4, A10G or L4 GPUs, which I didn't run. - Larger vLLM shards or compiled mode (`enforceEager: false`) may use more host memory during load. - The loads ran at the source above, before this change, with OpenShell 0.1.5. They weren't rerun after merging `v1` `d21a1d89b`, which moves OpenShell to 0.1.6 and leaves the vLLM and Ollama images and `crates/nemoclaw-runtime` as they were. ## Validation Each new behavioral test failed before the change, for the reason stated, and now passes: - `config_schema::the_host_reserve_floor_is_6_gib_on_dedicated_memory_and_28_on_unified_memory_or_a_recipe`: - **Dedicated hardware:** the parser and the schema rejected 6 on `h100`, on dedicated hardware (`nemotron-amd64.yaml`), and on Ollama `l4`. Now they accept 6 and reject 5. - **Unified profiles and recipes:** they still reject 6 and 27 and accept 28. This covers `dgx-spark`, `rtx-spark`, Ollama `dgx-spark`, the GB10 recipe and an H100 recipe. The error names `memory.hostReserveGiB` and "between 28 and 64". - `hardware_profiles::a_dedicated_memory_service_at_the_reserve_floor_starts_when_26_gib_are_available`: - Before the change, validation refused a reserve of 6. - Now the runtime's memory check before launch (`check_memory`), given a synthetic 31 GiB host with 26 GiB available, passes a vLLM `h100` service and an Ollama `l4` service. It refuses each 1 byte below that, with `host available memory (bytes)`. - `contract::the_runtime_accepts_a_6_gib_host_reserve_only_on_dedicated_memory`: `RuntimeSpec::decode`, which the runtime runs on its spec when its container starts, refused 6 on `a100`. It now accepts 6 there and still refuses 6 on `rtx-spark`. Checks: - The existing reserve tests pass unchanged: `config_schema` rejects 27 and accepts 28 on `dgx-spark`, and the `rtx-spark` runtime tests still decode a 28 GiB reserve. - The schema, the configuration reference and the vLLM and Ollama provider schema snapshots are regenerated. At `227fc54cf`, `schema --check` and `docs --check` pass. - `cargo ci` passed locally at `227fc54cf`, which merges `v1` `d21a1d89b`: fmt, clippy, build, 1,749 unit tests, schema, bundle, and 157 lifecycle tests. Deferred to CI: - Live / Docker and Live / Kind. I didn't run them locally: neither suite starts a managed vLLM or Ollama service, so neither loads a model at the 6 GiB floor. The only model loads are the measured ones above, at the default reserve. - `fern check` in CD / Documentation, for the two changed docs pages; this host has no Node.js. - The linux_amd64, darwin_arm64 and windows_amd64 jobs; local `cargo ci` ran on linux_arm64. Replaces #13914, which was stacked on #13912 (#13832) and closed to free a PR slot while it waited. #13912 has merged and its branch was deleted, so #13914 can't be reopened; this branch has the same diff, now against `v1`. For #13833; PRs into `v1` don't close issues, so it needs closing by hand after merge. Part of #13837.
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.
Failure
A vLLM recipe service was budgeted as unified memory, whatever GPU it named (#13832).
Service::memory_architecture()returnedUnifiedfor every recipe. So for a dedicated-memory GPU,resources.gpuMemoryByteswas checked against host RAM instead of the GPU, GPU free memory wasn't checked, and--gpu-memory-utilizationwas the budget over hostMemTotal, although vLLM applies it to GPU memory. A recipe for an 80 GiB H100 with a 60 GiB budget, in a host with 48 GiB of RAM, was refused because host total memory didn't cover 92 GiB, the budget plus the reserve. Any GPU name was accepted.Decision
flowchart LR GPU["recipe compatibility.gpu"] --> Profile["hardware profile whose<br/>GPU family includes it"] Profile --> Unified["GB10, RTX Spark N1X:<br/>host-memory checks, as before"] Profile --> Dedicated["other profile GPUs:<br/>GPU-memory checks"] GPU -.-> Rejected["no matching profile:<br/>rejected"]compatibility.gpu. It uses the catalog's existing GPU-family match, and adds no field. Recipe validation rejects a name that no profile matches.hardwareservices already get:gpuMemoryBytesmust fit observed GPU total memory, and GPU free memory at startup.--gpu-memory-utilization.hostReserveGiB.startupHeadroomGiBinstead of the fixed 20 GiB, so the declared field still applies. Unified-memory recipes keep their checks.vllm_capacitydata source reads the same memory architecture. So a dedicated-memory recipe now shares an engine with dedicated-memory services, not with unified ones.HardwareProfile::ALLlists the profiles to match. A test compares it with the schema's profile names.compatibility.gpu,gpuMemoryBytesandstartupHeadroomGiBdescriptions anddocs/recipes.mdsay how each memory architecture checks the budget. The reference's list of parser checks beyond the schema names the GPU check.compatibility.gpumatches no profile no longer parses. Recipes are qualified only on DGX Spark (docs/recipes.md).Validation
Each new behavioral test failed before the change, for the reason stated, and now passes:
runtime_boundaries::a_recipe_for_a_dedicated_memory_gpu_is_budgeted_against_gpu_memory:host total memory (bytes): 92 GiB required, 48 GiB observed.--gpu-memory-utilizationis0.750.runtime_boundaries::a_recipe_gpu_outside_the_hardware_profiles_is_rejected:NVIDIA fixture GPUwas accepted. Validation now fails, namingcompatibility.gpu.Unchanged and updated tests:
runtime_boundaries::recipe_selection_preserves_artifacts_and_rejects_unqualified_combinationschecks the GB10 fixture. It passes unchanged, with the same checks and--gpu-memory-utilization 0.706.runtime_boundaries::declared_compatibility_does_not_bypass_capacity_or_memory_policyusedfixture GPU, which is now rejected. It now namesNVIDIA H200with GPU counters and checks the same refusals.contract::recipe_gpu_matching_covers_every_hardware_profile.Checks:
schema --checkanddocs --checkpass.cargo cipassed locally onv115df7d09b: fmt, clippy, build, 1,734 unit tests, schema, bundle, and 156 lifecycle tests.For #13832; PRs into
v1don't close issues, so it needs closing by hand after merge. Part of #13837.