Skip to content

feat(inference): observe each GPU on a host - #14388

Merged
cv merged 2 commits into
v1from
cv/per-gpu-observation
Nov 11, 2026
Merged

cv merged 2 commits into
v1from
cv/per-gpu-observation

Conversation

@cv

@cv cv commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

The runtime and the local and SSH host collectors read every GPU in one nvidia-smi query and keep a per-GPU inventory, and explicit host observation reports each GPU with its UUID. Managed services still run on exactly one GPU: callers that need one refuse any other count with the same error as before.

Problem

Each collector ran four nvidia-smi queries whose parsers accepted one GPU, so a host with two or more failed observation with managed inference requires exactly one observable GPU. observe_host_hardware then reported the host's hardware as unknown, and the inventory had no index or UUID to tell GPUs apart. Per-GPU capacity accounting and the vLLM and Ollama layouts in later steps of #14384 need that inventory.

Part of #14384: this is step 3. Steps 4 to 9 (memory contract and per-GPU accounting, requirements.gpu_count, vLLM parallel sizes, Ollama, Docker device requests, and lifting the one-entry limit) remain.

Change

  • nemoclaw-runtime hardware: a Gpu (index, UUID, name, driver major, compute capability, framebuffer memory) and Capacity::gpus, read with one --query-gpu=index,uuid,name,compute_cap,memory.total,memory.free,driver_version call plus the existing process query. [N/A] memory still means unsupported counters. The single-GPU fields are filled only when exactly one GPU is observed, so every decision that reads them is unchanged.
  • Capacity::require_one_gpu holds the exactly-one rule. The runtime's populate (vLLM and Ollama before start) and vllm_capacity/ollama_capacity call it, so both still refuse two or more GPUs with the same error.
  • The local and SSH collectors return every GPU, or only the GPU named by --id as before. The SSH script's three GPU sections become one.
  • observe_host_hardware reports one GpuObservation per GPU, with the UUID as id, the field the passive read already fills with advertised GPU UUIDs. The GpuObservation and HardwareObservation shapes don't change; the index isn't exposed.
  • Test fakes: a fake nvidia-smi generator with --id filtering, and the SSH simulator's output in the new format.

Capacity accounting, the memory contract, vLLM and Ollama arguments, Docker placement, and the one-entry gpuDevices limit are unchanged.

Beyond CI

  • On a DGX Spark (NVIDIA GB10, driver 580.178.04), nvidia-smi accepted the new query with and without --id=0 and printed 0, GPU-…, NVIDIA GB10, 12.1, [N/A], [N/A], 580.178.04, the format the parser reads.
  • Unverified: output from a host with two or more GPUs. The multi-GPU cases are tested only with fake nvidia-smi output, because neither this host nor CI has one.

The runtime and the local and SSH host collectors read every GPU in one
`nvidia-smi --query-gpu=index,uuid,name,compute_cap,memory.total,memory.free,driver_version`
call and keep a per-GPU inventory. Callers that need one GPU still refuse
any other count with the same error, and single-GPU results are unchanged.
Explicit host observation reports each GPU with its UUID as `id`.

Part of #14384.

Signed-off-by: Carlos Villela <[email protected]>
@cv

cv commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator Author
Authoring session — opening
Field Status Value Evidence or limit
Harness recorded Pi 1.5.0 Release path in the session's system prompt; session record format 3
Skills recorded test-driven-development (complete read); nemoclaw-contributor-create-pr (complete read) Tool reads in the session record to cutoff
Instruction files recorded AGENTS.md (injected); WRITING.md (complete read); .github/PULL_REQUEST_TEMPLATE.md (complete read); .github/SESSION_REPORT_TEMPLATE.md (complete read) Startup injection and tool reads to cutoff; internal-docs/contributing/testing.md was read truncated, so it isn't counted
Tool calls partial typescript: 76 Wrapper calls in the session record to cutoff, including failed calls; nested workspace, shell, git, and gh calls inside each wrapper aren't recorded separately
Session window recorded 2026-11-11T03:43Z to 2026-11-11T04:13Z; 30 min First event to cutoff (before the PR was created), including idle time
Compactions recorded 0 Complete record to cutoff; earlier tool results were elided from context, which isn't a compaction
Models recorded azure/anthropic/claude-opus-5-5 Model change event and assistant messages; no changes
Reasoning levels recorded high Thinking-level event; no changes

@github-actions

Copy link
Copy Markdown
Contributor

@cv
cv merged commit 73a7fd5 into v1 Nov 11, 2026
64 checks passed
@cv
cv deleted the cv/per-gpu-observation branch November 11, 2026 04:46
@gaveezy

gaveezy commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

This ran on a host with eight GPUs (8× H200 NVL, driver 615.71.10) at 73a7fd54a, as part of the run record on #13743:

  • The explicit host observation reported all eight GPUs, each with its UUID, name, memory, driver major and compute capability, from one --query-gpu=index,uuid,… call, and marked the inventory complete.
  • Without a GPU selection, the runtime in the vLLM and Ollama images, given every GPU, refused to start with the unchanged "managed inference requires exactly one observable GPU". Both capacity data sources read all eight GPUs in one query and refused the same way.
  • With gpuDevices and gpu_devices, each container and each capacity read saw only its GPU, and the reads passed --id.

The SSH collector wasn't run on a multi-GPU host.

cv added a commit that referenced this pull request Nov 11, 2026
…14396)

Managed Ollama services keep their per-GPU budget on every GPU the
container sees: the runtime sets `OLLAMA_GPU_OVERHEAD` from the largest
free memory among those GPUs, refuses to start when any of them has less
than the budget free, and accepts a loaded model of up to the budget
times the number of GPUs. NemoClaw still doesn't set
`OLLAMA_SCHED_SPREAD`, so Ollama keeps its own placement. With one GPU,
both values equal today's.

## Problem

The Ollama runtime computed `OLLAMA_GPU_OVERHEAD` and the readiness
bound from one GPU's counters (`Capacity::gpu_memory`). Ollama applies
the overhead on every GPU it sees and reports one `size_vram` total in
`/api/ps`, so on several GPUs those values would either leave a GPU more
than the budget or reject a model split across GPUs.

Part of #14384: this is step 7, following decision 4 of the maintainer's
decisions comment. What's left:

- Step 4: `hardware_capacity::budget`, `serving_memory`, and
`check_memory` still read the single-GPU `Capacity::gpu_memory`, which
is unset with two or more GPUs, so a multi-GPU capacity stops there
before this step's code runs.
- Step 9: the runtime's `populate` still requires exactly one visible
GPU, and `container.gpuDevices` takes one entry.

## Change

- `crates/nemoclaw-runtime/src/ollama/runtime/process.rs`: `gpu_limits`
reads the per-GPU inventory from #14388 (`Capacity::gpus`).
- `OLLAMA_GPU_OVERHEAD` is the largest free memory among the GPUs minus
the per-GPU budget, so no GPU offers Ollama more than the budget.
  - Every GPU must have the budget free, with the existing error.
- Unified-memory GPUs, which report no framebuffer counters, keep an
overhead of 0. A mix of GPUs with and without counters is refused,
because their free memory can't be checked.
  - The readiness bound is the budget times the number of GPUs.
- `crates/nemoclaw-runtime/src/ollama/runtime/observation.rs`: the
readiness check still requires `size_vram == size` and bounds
`size_vram` by that total.
- `OLLAMA_SCHED_SPREAD` stays unset, as decision 4 chose; a test pins
that.
- `docs/agents-inference/inference.md`: Ollama's placement, the
overhead, the free-memory check, and that `/api/ps` reports one total
rather than each GPU's share, so the readiness check can't show which
GPU exceeded its budget.

The memory fields' meaning, the provider's capacity accounting, and
process supervision and error reporting don't change. `limits.md` gets
no row: the missing per-GPU share is a property of Ollama's API that no
NemoClaw issue would fix, so `inference.md` states it where it affects
the reader.

## Beyond CI

Unverified: Ollama on two or more GPUs. The multi-GPU cases are tested
with fake GPU inventories only, because neither this host (one GB10) nor
CI has several GPUs, and the runtime still requires one visible GPU.

Signed-off-by: Carlos Villela <[email protected]>
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.
@wscurran wscurran added area: local-models Local model providers, downloads, launch, or connectivity feature PR adds or expands user-visible functionality v1 NemoClaw v1 branch labels Nov 12, 2026
@cv cv added this to the Roadmap: GTC DC 2026 milestone Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: local-models Local model providers, downloads, launch, or connectivity feature PR adds or expands user-visible functionality v1 NemoClaw v1 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants