diff --git a/.github/workflows/helios-lifecycle.yml b/.github/workflows/helios-lifecycle.yml
index 8e965febf..2b97e47e6 100644
--- a/.github/workflows/helios-lifecycle.yml
+++ b/.github/workflows/helios-lifecycle.yml
@@ -44,4 +44,4 @@ jobs:
- name: Set up Kani compiler
run: cargo kani setup
- name: Prove sequential validator properties
- run: cargo kani --manifest-path helios/Cargo.toml --lib
+ run: cargo kani --manifest-path helios/Cargo.toml --features runtime-core --lib
diff --git a/.github/workflows/native-serving.yml b/.github/workflows/native-serving.yml
index 9cb3e8b55..68b94b47b 100644
--- a/.github/workflows/native-serving.yml
+++ b/.github/workflows/native-serving.yml
@@ -28,7 +28,7 @@ jobs:
- name: Prepare external frontend test fixtures
run: |
python -m pip install huggingface-hub==1.33.0
- python tests/frontend/prepare_templates.py --output "${{ runner.temp }}/flare-test-templates" --recipe gemma4 --recipe glm53 --recipe mimo_v2 --recipe nemotron_h --recipe qwen38 --recipe step5
+ python tests/frontend/prepare_templates.py --output "${{ runner.temp }}/flare-test-templates" --recipe gemma4 --recipe glm53 --recipe mimo_v2 --recipe minimax_m3 --recipe nemotron_h --recipe qwen38 --recipe step5
- name: Install Linux build dependencies
if: runner.os == 'Linux'
run: |
diff --git a/.github/workflows/python-cpu.yml b/.github/workflows/python-cpu.yml
new file mode 100644
index 000000000..62f10c988
--- /dev/null
+++ b/.github/workflows/python-cpu.yml
@@ -0,0 +1,33 @@
+name: Python CPU tests
+
+on:
+ push:
+ branches: [main]
+ pull_request:
+ workflow_dispatch:
+
+permissions:
+ contents: read
+
+jobs:
+ pytest:
+ runs-on: ubuntu-24.04
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-python@v5
+ with:
+ python-version: '3.12'
+ - uses: astral-sh/setup-uv@v6
+ - name: Install Linux build dependencies
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y build-essential cmake ninja-build nasm protobuf-compiler libssl-dev liburing-dev
+ - name: Sync preparation and test environment
+ env:
+ BUILD_NVEP: "0"
+ FLASHINFER_BUILD_NO_PIP: "1"
+ run: uv sync --extra prepare --extra test
+ - name: Run CPU pytest suite
+ env:
+ CUDA_VISIBLE_DEVICES: ""
+ run: .venv/bin/python -m pytest tests/ -q
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 15a94e6bf..3f8499e12 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -47,26 +47,38 @@ jobs:
arch: arm64
target: aarch64-unknown-linux-gnu
build-packages: libibverbs-dev
- runtime-packages: libibverbs1 ibverbs-providers
runs-on: ${{ matrix.os }}
env:
VERSION: ${{ needs.version.outputs.version }}
ARCHIVE: flare-linux-${{ matrix.arch }}.tgz
steps:
- uses: actions/checkout@v4
- - name: Install build dependencies
- run: |
- sudo apt-get update
- sudo apt-get install -y --no-install-recommends build-essential cmake nasm pkg-config protobuf-compiler ${{ matrix.build-packages }}
- rustup toolchain install "$RUST_TOOLCHAIN" --profile minimal --component rust-docs
- rustup default "$RUST_TOOLCHAIN"
- name: Set the release version
run: python3 scripts/set_release_version.py "$VERSION"
- - name: Build the CLI
- run: cargo build --locked --release --manifest-path flare-cli/Cargo.toml --bin flare
- - name: Package the CLI and license notices
- run: python3 packaging/archive.py --binary flare-cli/target/release/flare --target ${{ matrix.target }} --output "$ARCHIVE"
- - name: Check the archive in a clean Ubuntu 24.04 container
+ - name: Build and package the CLI in Ubuntu 22.04 (glibc 2.35)
+ run: |
+ docker run --rm --volume "$PWD:/src" --workdir /src \
+ --env RUST_TOOLCHAIN \
+ --env TARGET="${{ matrix.target }}" \
+ --env ARCHIVE \
+ --env BUILD_PACKAGES="${{ matrix.build-packages }}" \
+ --env HOST_UID="$(id -u)" \
+ --env HOST_GID="$(id -g)" \
+ ubuntu:22.04 bash -euc '
+ export DEBIAN_FRONTEND=noninteractive
+ apt-get update
+ apt-get install -y --no-install-recommends \
+ build-essential ca-certificates cmake curl git nasm pkg-config \
+ protobuf-compiler python3 $BUILD_PACKAGES
+ curl --proto "=https" --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
+ --profile minimal --default-toolchain "$RUST_TOOLCHAIN" --component rust-docs
+ export PATH="$HOME/.cargo/bin:$PATH"
+ export CARGO_TARGET_DIR=/tmp/target
+ cargo build --locked --release --manifest-path flare-cli/Cargo.toml --bin flare
+ python3 packaging/archive.py --binary /tmp/target/release/flare \
+ --target "$TARGET" --output "$ARCHIVE"
+ chown "$HOST_UID:$HOST_GID" "$ARCHIVE"'
+ - name: Verify ELF dependencies and check the archive in clean Ubuntu 22.04 and 24.04 containers
run: |
mkdir check
tar -xzf "$ARCHIVE" -C check
@@ -77,22 +89,36 @@ jobs:
exit 1
fi
done
- # The container has only Ubuntu 24.04's libraries, so libraries
- # installed on the runner cannot satisfy the executable.
- docker run --rm --volume "$PWD/check/flare:/opt/flare:ro" \
- --env VERSION --env RUNTIME_PACKAGES="${{ matrix.runtime-packages }}" ubuntu:24.04 bash -euc '
- if [[ -n "$RUNTIME_PACKAGES" ]]; then
- apt-get update
- apt-get install -y --no-install-recommends $RUNTIME_PACKAGES
- fi
- reported=$(/opt/flare/flare --version)
- if [[ "$reported" != "flare $VERSION" ]]; then
- echo "::error::flare --version printed \"$reported\"; expected \"flare $VERSION\"."
- exit 1
- fi
- for command in run agent orbit; do
- /opt/flare/flare "$command" --help > /dev/null
- done'
+ if readelf -d check/flare/flare | grep -F "libibverbs.so"; then
+ echo "::error::flare must not hard-link libibverbs.so in DT_NEEDED."
+ exit 1
+ fi
+ python3 - <<'PY'
+ import re, subprocess, sys
+ out = subprocess.check_output(["readelf", "--version-info", "check/flare/flare"], text=True)
+ too_new = sorted({
+ m.group(0)
+ for m in re.finditer(r"GLIBC_(\d+)\.(\d+)", out)
+ if (int(m.group(1)), int(m.group(2))) > (2, 35)
+ })
+ if too_new:
+ print(f"::error::flare requires glibc newer than 2.35: {', '.join(too_new)}", file=sys.stderr)
+ sys.exit(1)
+ PY
+ # Both containers hold only base image libraries (no libibverbs1), proving
+ # glibc <= 2.35 compatibility (including JetPack 6) and lazy libibverbs loading.
+ for image in ubuntu:22.04 ubuntu:24.04; do
+ docker run --rm --volume "$PWD/check/flare:/opt/flare:ro" \
+ --env VERSION "$image" bash -euc '
+ reported=$(/opt/flare/flare --version)
+ if [[ "$reported" != "flare $VERSION" ]]; then
+ echo "::error::flare --version printed \"$reported\"; expected \"flare $VERSION\"."
+ exit 1
+ fi
+ for command in run agent orbit; do
+ /opt/flare/flare "$command" --help > /dev/null
+ done'
+ done
- uses: actions/upload-artifact@v4
with:
name: flare-linux-${{ matrix.arch }}
diff --git a/AGENTS.md b/AGENTS.md
index bde06b448..8fb30b389 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -362,6 +362,9 @@ architectural boundary before committing the change.
consumers. Tool/reasoning parsers and image preparation/layout implementations
use independent typed enum identifiers; those identifiers cannot select
scheduling, cache policy, text-graph input packing, or completion behavior.
+ DeepSeek DSML markup recognition and recovery belong to the pinned
+ `deepseek-recipe` parser. Helios adapts its actions; do not add a second DSML
+ parser or reparse raw tags in Helios. Fix the dependency and bump its pin.
- A runtime defect reproduced on one model must be traced through every
supported cache scheme before choosing the implementation boundary. Apply
the fix to every compatible contract. Any restriction must follow from a
@@ -470,13 +473,13 @@ architectural boundary before committing the change.
## CUDA kernel and model optimization authorship
-Claude Opus 5.5 is not reliable for low-level kernel changes in this project.
-Do not use it to design or implement low-level CUDA kernels or
-changes to existing model fusion and GPU execution optimizations. This includes
-CUDA C++, PTX, CuTe DSL, and Triton kernels, and changes to projection packing,
-fused arithmetic, stream overlap, or scratch aliasing in optimized model paths.
-Do not incorporate its generated changes to these mechanisms through another
-contributor or agent.
+Claude Opus, Fable, Sonnet, and Haiku models are not reliable for low-level
+kernel changes in this project. Do not use them to design or implement low-level
+CUDA kernels or changes to existing model fusion and GPU execution
+optimizations. This includes CUDA C++, PTX, CuTe DSL, and Triton kernels, and
+changes to projection packing, fused arithmetic, stream overlap, or scratch
+aliasing in optimized model paths. Do not incorporate their generated changes to
+these mechanisms through another contributor or agent.
General PyTorch modeling, recipe integration, checkpoint loading, frontend
processing, preparation orchestration, CLI/runtime work, tests, and documentation
diff --git a/docs/TODO.txt b/docs/TODO.txt
index 6e9adcab4..e975fce8c 100644
--- a/docs/TODO.txt
+++ b/docs/TODO.txt
@@ -258,9 +258,7 @@
selene/src/shared/identity.rs), "replaced atomically" for superseded
sessions, the size check ordering relative to pinning, GENERATION_CHANGED
as a claim reason, and the BUDGET refusal advancing a record to the next
- tier. Publish the metrics port in
- selene-manager/deploy/compose-network.yaml, which binds --metrics to the
- container's loopback.
+ tier.
[ ] Qualify RoCE ring transport beyond GLM-5.3 Flash TP4 on four DGX Sparks:
other recipes, TP2 and TP3, and --roce-chain on hosts cabled as a chain.
@@ -268,6 +266,12 @@
verification, and coordinated shutdown complete on that configuration.
See roce-ring.md.
+[ ] Verify ConnectX-7 peer reachability and measure throughput with MTU 1500
+ and MTU 9000 on direct and switched DGX Spark fabrics before preferring
+ an MTU in flare doctor. Run the local preflight on Linux RTX Spark N1X
+ hardware and verify that hosts without a ConnectX-7 adapter skip it.
+ See cli-design.md#54-flare-doctor.
+
[ ] Qualify x86_64 RoCE serving on RDMA hardware; its coverage is functional,
over Soft-RoCE. See multi-host.md.
@@ -346,3 +350,6 @@
on SM103 GPUs alongside --row-shard-prefill. Close each target when
tensor-parallel export with replicated attention weights and native flare
run serving pass on that hardware and transport.
+
+[ ] Guard or stride the 65,535 * 1024 (~64 MiB/uint8 row) gridDim.y ceiling
+ in ignition/components/state.py row kernels.
diff --git a/docs/api.md b/docs/api.md
index 1f953b407..c46892046 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -42,6 +42,7 @@ The additional `flare` object reports prepared and selected serving metadata:
| `sampling_defaults` | Prepared seed, temperature, filters, and penalties used for omitted request fields |
| `thinking_token_budget` | Operator default reasoning-token cap for conversational requests; null when unset |
| `sampling_ranges` | Inclusive `{min, max}` bounds for distribution parameters; null fixes a parameter at its prepared default; seed is request-controlled |
+| `core_parameters` | Ordered per-request FP32 parameters declared by the model core; each entry contains `name`, `default`, and an optional inclusive `range` with `min` and `max` |
| `max_images_per_prompt` | Context-derived upper bound on image count; image sizes, framing, text, output, and HTTP body size further constrain admission; zero for text-only cores |
| `max_image_tokens_per_prompt` | Context-derived upper bound on image tokens across the entire conversation; text, framing, and output also occupy context; zero for text-only cores |
| `image_feature_window_tokens` | Prepared feature storage per active image request; chunked prefill reuses this storage across windows, so it does not limit total conversation image tokens |
@@ -444,13 +445,19 @@ the same accumulated output for buffered responses and SSE. Tool arguments are
JSON objects, bounded to 8 MiB. The model parsers buffer tool envelopes until
they are complete, so argument events do not imply incremental generation of an
unfinished call. Truncated tool envelopes are omitted and the response reports
-its output limit; recognized but incomplete calls at natural completion are errors.
+its output limit. At natural completion, tagged tool parsers accept a non-strict
+call whose inner arguments are structurally complete and self-delimited when
+only its closing wrapper tag is omitted; undecided openers, bare headers
+without a closing argument delimiter, unclosed arguments, trailing text, and
+unclosed strict calls remain errors.
DeepSeek reasoning and both DSML tool syntaxes use the pinned official
`deepseek-recipe` state machine. Helios adapts its actions into the same neutral
events, validates nonempty tool names and JSON objects with nonempty, unique
argument names, and publishes each call when its arguments complete. A parameter
-marked `string="false"` keeps its JSON type if its text decodes as one value
+tag that closes before its string attribute is discarded, so the following
+well-formed parameter is parsed normally. A parameter marked `string="false"`
+keeps its JSON type if its text decodes as one value
inside the argument object. If decoding fails, Helios retains the original
text as a JSON string. This includes valid JSON exceeding 126 levels of array
or object nesting within the parameter. The combined size of the UTF-8 tool
@@ -507,6 +514,18 @@ Gemma 4's `<|tool_call>` opener and MiniMax's namespace-prefixed opener always
start a call; they do not take part in this check. DeepSeek
DSML and XTML are parsed by their own parsers rather than this path.
A missing `` is closed by the next parameter or function boundary.
+When a non-strict tagged call omits its closing wrapper tag at natural
+completion, each dialect accepts it only when its argument body is
+self-delimited with no trailing non-whitespace: GLM requires at least one closed
+`......` pair without ``,
+function-tag parsers require at least one closed `...`
+without `` (also accepted when closed by ``), Gemma 4
+requires a balanced `{...}` argument object without ``, and MiniMax
+XML requires at least one closed parameter element without `` (also
+accepted when closed by ``). Bare headers without a closing argument
+delimiter, undecided openers, unclosed arguments, strict calls missing their
+wire closer, and calls cut off by output limits or stop sequences are never
+recovered.
Parameter schemas guide
best-effort type conversion; non-strict schemas do not reject invalid values.
Qwen removes one leading and one trailing wrapping newline from parameter values;
@@ -729,6 +748,24 @@ request-controlled and uses its prepared default when omitted. Sampling defaults
and ranges come from the model author's recommendations declared in the recipe,
except for DeepSeek V4.1's repetition-penalty range based on measured use.
+Every generation protocol accepts an optional top-level `core_parameters` JSON
+object whose keys name FP32 parameters declared by the loaded model core
+(and advertised under `flare.core_parameters` in `/v1/models`). Omitting
+`core_parameters` or setting it to `null` uses prepared defaults for all
+declared parameters. Non-object values, empty or undeclared names, booleans,
+non-numeric values, non-finite numbers, values whose magnitude exceeds
+`f32::MAX`, and nonzero values that underflow to FP32 zero return HTTP 400.
+
+An omitted declared parameter uses its prepared default. A declaration with an
+inclusive `range` clamps finite FP32 request values to `[min, max]`; a
+declaration without a range accepts any finite FP32 value. Resolution
+canonicalizes `-0.0` to `+0.0`. Declared core parameters are bound
+independently of the six-column sampling layout. Prefix-cache identity hashes
+every declared effective parameter in declaration order (length-prefixed name
+and canonical FP32 bits) into the prefix root, so requests with different
+resolved values cannot share checkpoints. For cores without declared core
+parameters, the prefix root hashes only the domain tag and core identity.
+
The recipes use these default-mode settings. Parameters without an interval in
the table are fixed at their defaults. Bounds span the minimum and maximum values
across each card's task or mode presets, including intermediate values and
diff --git a/docs/cli-design.md b/docs/cli-design.md
index 96d9e4f9e..3fc182813 100644
--- a/docs/cli-design.md
+++ b/docs/cli-design.md
@@ -122,7 +122,7 @@ flare-cli/target/release/flare run CORE --gpus 0
flare run [CORE] [flags] serve locally, join a rank, or launch peer agents
flare download REPOSITORY [flags] download a prepared core
flare inspect CORE|MODEL[@VERSION] [--tensor-parallel N] [--rank N] [--unverified] [--memory-map] [--graphs] [--frontend] [--all] [--json | --plain]
-flare doctor [--gpus N[,N...]] [--json | --plain] check Linux PCIe TP>1 driver, IOMMU, and ACS settings
+flare doctor [--gpus N[,N...]] [--json | --plain] check Linux PCIe TP>1 settings and DGX Spark CX7 readiness
flare agent [--listen IP:PORT] run this host's rank agent
flare agent install [--join-code CODE | --accept-first] [--listen IP:PORT]
flare agent pair HOST... [--code CODE] pair for --hosts or Orbit launches
@@ -901,10 +901,14 @@ flare run ORG/MODEL@gb202 --filename model.safetensors --gpus 0,1,2,3
These examples use `ORG/MODEL` as a repository placeholder. Repositories contain
prepared Flare cores, not source Transformers checkpoints. Hardware variants
-are separate Hugging Face revisions named `ga102`, `gb10`, `gb202`, and `gb300`. Automatic selection
-queries the selected GPUs' PCI device identifiers through NVML without initializing
-CUDA. GB10 selects `gb10`; known GB202 devices, including RTX PRO
-6000 Blackwell, select `gb202`; GB300 selects `gb300`; known GA102 devices select `ga102`. All selected GPUs must belong to the same family.
+are separate Hugging Face revisions named by NVIDIA GPU platform identifier
+(Ampere `ga100`, `ga102`, `ga103`, `ga104`, `ga106`, `ga107`, `ga10b`;
+Blackwell `gb10`, `gb100`, `gb102`, `gb10b`, `gb112`, `gb120`, `gb202`,
+`gb203`, `gb205`, `gb206`, `gb207`, `gb300`). Automatic selection queries the
+selected GPUs' PCI device identifiers through NVML without initializing CUDA,
+falling back to CUDA compute capability for integrated Tegra GPUs (`ga10b`,
+`gb10b`) that report no PCI ID. All selected GPUs must belong to the same
+platform.
An unknown identifier or a driver unable to report it requires an explicit
revision. GPU selection follows `CUDA_VISIBLE_DEVICES` for both commands.
Revision detection runs in a short-lived process so NVML's worker threads cannot
@@ -915,9 +919,10 @@ An explicit GPU list must match the core's local rank count.
An explicit `--revision` overrides `@revision` and hardware detection. It accepts
a branch, tag, or commit, and permits downloading on a machine without NVIDIA
-hardware. For `gb10`, `gb202`, and `gb300`, the shared CLI and desktop downloader
-tries the corresponding `-tp1` revision if the initial revision lookup returns
-HTTP 404. Flare downloads from the resolved commit and records it under the
+hardware. For any platform revision beginning with `gb`, the shared CLI and
+desktop downloader tries the corresponding `-tp1` revision if the initial revision
+lookup returns HTTP 404; Ampere (`ga*`) revisions are not retried. Flare
+downloads from the resolved commit and records it under the
requested revision for offline use. Flare excludes SHA-256 blob filenames and
`*-data-NN-of-NN.safetensors` companions when selecting the primary; multiple
primaries require `--filename`. Referenced companions resolve from the primary's
@@ -937,7 +942,7 @@ Both commands accept these download options:
| Flag | Meaning | Default |
|---|---|---|
-| `--revision REVISION` | Explicit Hub branch, tag, or commit | Recorded model origin, otherwise detected `ga102`, `gb10`, `gb202`, or `gb300` |
+| `--revision REVISION` | Explicit Hub branch, tag, or commit | Recorded model origin, otherwise detected GPU platform revision |
| `--filename FILE` | Repository-relative prepared core filename | Sole primary `.safetensors` file |
| `--cache-dir PATH` | Parent for the shared Hugging Face download transport cache | Flare model cache |
| `--token-file PATH` | File containing a Hub access token (must exist and be non-empty when passed) | `HF_TOKEN`, then `$HF_TOKEN_PATH` / `$HF_HOME/token` / `~/.cache/huggingface/token` when present, otherwise unauthenticated |
@@ -1635,8 +1640,7 @@ envelope has format 4 or 6.
### 5.4 `flare doctor`
-Inspect Linux host configuration for multi-GPU tensor-parallel serving over
-PCIe:
+Inspect Linux host readiness for tensor-parallel serving:
```sh
flare doctor [--gpus N[,N...]] [--json | --plain]
@@ -1662,12 +1666,42 @@ On Linux PCIe hosts, `flare doctor` verifies:
connecting the selected GPUs (from their lowest common ancestor downward).
Reading PCIe extended configuration space from
`/sys/bus/pci/devices//config` requires root (`CAP_SYS_ADMIN`); without
- it, ACS is reported as `unverified` with a hint to run `sudo flare doctor`.
-
-`--json` prints the structured report; `--plain` disables terminal styling and
-conflicts with `--json`. The command exits zero when no check fails and
-non-zero when one or more checks fail. On non-Linux hosts, the command reports
-the checks as not applicable and exits zero.
+ it, ACS is reported as `unverified` and its remediation suggests running
+ `sudo flare doctor`.
+
+On Linux GB10 and RTX Spark N1X hosts, `flare doctor` checks the local
+ConnectX-7 fabric for multi-host serving. `--gpus` does not affect this host
+check. PCIe tuning checks are not applicable when exactly one GPU is selected
+on these hosts and are unverified when no GPU is selected or detected.
+
+- PCI identifies the ConnectX-7 physical function (`15b3:1021`) even if its
+ RDMA driver has not bound. The fabric check is not applicable when the
+ adapter is absent.
+- The report uses serving's RoCEv2 GID index and lists the selected
+ ConnectX-7 devices, interface names, IPv4 prefixes, and observed MTUs.
+ One active device with an assigned IPv4 address and RoCEv2 GID is
+ sufficient. The report identifies active devices skipped by discovery.
+- The check warns if there is no driver, active link, or usable IPv4 RoCEv2
+ endpoint. It warns if the address and prefix for a selected device or its
+ MTU cannot be read. It also flags /0 and /32 prefixes, network and broadcast
+ addresses, and overlapping subnets on different interfaces. Two link-local
+ interfaces may share a subnet. Link-local IPv4 requires an LLDP-confirmed
+ direct peer.
+
+Compare the reported Ethernet MTUs with the settings on the intended peers
+and switch.
+NVIDIA's [Spark setup guide](https://build.nvidia.com/spark/connect-multiple-sparks/advance)
+uses MTU 9000 for a direct two-node link and MTU 1500 for ring and switched
+connections. Peer reachability requires a separate check.
+
+The local check passed on four Linux DGX Sparks configured as a switched
+cluster. Each host had two active interfaces on separate IPv4 /24 subnets,
+RoCEv2 GID index 3, and Ethernet MTU 9000.
+
+`--json` prints the structured report. `--plain` disables terminal styling and
+conflicts with `--json`. Check statuses are `pass`, `fail`, `warn`, `unverified`,
+and `not_applicable` in JSON. Only `fail` produces a nonzero exit status. On
+non-Linux hosts, the command reports the checks as not applicable and exits zero.
## 6. Capacity errors
@@ -1855,7 +1889,7 @@ is an error. If the default `cores` directory does not exist and
moving files. The CLI and desktop use the same resolution.
```sh
-flare models list [MODEL] [--json]
+flare models list [MODEL] [--json] [--offline]
flare models inspect CORE|MODEL[@VERSION] [inspection flags]
flare models download REPOSITORY [download flags]
flare models select MODEL@VERSION
@@ -2042,6 +2076,12 @@ tensor-parallel size and serving capacities, and distinct storage figures:
`list` metadata is explicitly unverified: it decodes the manifest to report
identity, deployments, and capacities without claiming authentication.
+For downloaded versions with acquisition records, `list` checks Hugging Face
+revision metadata. It reports `installed_updated_at` for the installed commit
+and `update_available` for the tracked revision. An available update also has
+`update_commit` and `update_updated_at` when the Hub reports a date. A matching
+deployment already in the cache suppresses the offer. `--offline` skips Hub
+lookups. Dates and uncompleted update checks are reported as unavailable.
`inspect` resolves `MODEL[@VERSION]` to the selected version while holding its
lease and then runs the normal core inspection path, so
`--json`, `--unverified`, `--publisher-keys`, `--trust-store`, `--rank`,
diff --git a/docs/core-format-design.md b/docs/core-format-design.md
index 8582e4a11..529c89d27 100644
--- a/docs/core-format-design.md
+++ b/docs/core-format-design.md
@@ -750,8 +750,9 @@ A published cache entry is named for its selected deployments:
`-tp-`, for example `gb202-tp1-202610170923`.
An entry containing several TP sizes joins their labels in ascending order,
without duplicates: `gb202-tp1+tp2-202610170923`.
-The platform is the device identifier recorded by preparation (`ga102`, `gb10`,
-`gb202`, or `gb300`), never an SM architecture name. Downloads use the authenticated device
+The platform is the NVIDIA GPU platform identifier recorded by preparation (for
+example `gb202`, `gb203`, `gb10`, `gb300`, or `ga102`, as listed in
+`PLATFORMS`), never an SM architecture name. Downloads use the authenticated device
identity; cores without one use `unknown-device`, including union names such
as `unknown-device-tp1+tp2-202610170923`. The timestamp records entry creation in
UTC with minute resolution.
diff --git a/docs/design-review.md b/docs/design-review.md
index e88586d98..178c47403 100644
--- a/docs/design-review.md
+++ b/docs/design-review.md
@@ -121,17 +121,17 @@ before committing; a design acknowledgment cannot authorize them.
compatible defaults; an absent or zero completion token capacity means eight.
Reserve removed wire identifiers and retain readers and tests needed by
existing cores. Validate previous cores through loading and serving.
-14. **Restrict Claude Opus 5.5 authorship of CUDA kernels and model optimizations.**
- Claude Opus 5.5 is not reliable for low-level kernel changes in this
- project. It must not design or implement low-level CUDA kernels
- (CUDA C++, PTX, CuTe DSL, or Triton) or changes to existing model fusion and
- GPU execution optimizations, including projection packing, fused arithmetic,
- stream overlap, and scratch aliasing in optimized model paths. Do not
- incorporate its generated changes to these mechanisms through another
- contributor or agent. General PyTorch modeling, recipe integration,
- checkpoint loading, frontend processing, preparation orchestration,
- CLI/runtime work, tests, and documentation are permitted when they do not
- design or change those restricted mechanisms.
+14. **Restrict Claude Opus, Fable, Sonnet, and Haiku authorship of CUDA kernels and model optimizations.**
+ Claude Opus, Fable, Sonnet, and Haiku models are not reliable for low-level
+ kernel changes in this project. They must not design or implement low-level
+ CUDA kernels (CUDA C++, PTX, CuTe DSL, or Triton) or changes to existing
+ model fusion and GPU execution optimizations, including projection packing,
+ fused arithmetic, stream overlap, and scratch aliasing in optimized model
+ paths. Do not incorporate their generated changes to these mechanisms
+ through another contributor or agent. General PyTorch modeling, recipe
+ integration, checkpoint loading, frontend processing, preparation
+ orchestration, CLI/runtime work, tests, and documentation are permitted when
+ they do not design or change those restricted mechanisms.
15. **Reject scope expansion and weakened constraints.** Apply the
[contribution rejection criteria](../AGENTS.md#contribution-scope-and-rejection-criteria)
to code, tests, and documentation. Single-host and cross-node preparation
diff --git a/docs/direct-execution.md b/docs/direct-execution.md
index 74469fcbc..c45aff7b0 100644
--- a/docs/direct-execution.md
+++ b/docs/direct-execution.md
@@ -81,6 +81,11 @@ kind, device errors by code, request outcomes and prefix-cache counters. Each
retired request prints one line on stderr: prompt and reused tokens, generated
tokens, speculative rounds and outcome.
+`/v1/models` reports the core's declared `core_parameters` under `flare`. Chat
+requests accept the same top-level `core_parameters` object as native serving;
+omitting it or passing `null` uses declared defaults, and the direct scheduler
+resolves defaults and ranges before prefix lookup.
+
## Design
**Scheduler** (`ignition/direct/scheduler.py`, CPU only). FIFO admission
@@ -146,10 +151,12 @@ would otherwise age every request and expire estimates sooner than under Helios.
**Packing.** Each step's uploads follow the prepared graph's typed value bindings,
as in Helios's shared packer: state-row indices, row slots and
generations, page and draft page tables, token IDs, query lengths, sampling
-flags, state-transfer commands and admission rows. Bytes it does not write
-keep their resident values, as with native partial uploads. Combined packed
-rounds bind `SPECULATIVE_PREFIX_LIMIT` and leave query lengths to the captured
-GPU allocator.
+flags, state-transfer commands, admission rows, and declared FP32 core
+parameters on text forward graphs. Bytes it does not write keep their resident
+values, as with native partial uploads. Combined packed rounds bind
+`SPECULATIVE_PREFIX_LIMIT` and leave query lengths to the captured GPU
+allocator. Direct prefix keys include the same canonical core-parameter
+identity as native serving when a core declares core parameters.
Completion records are validated against the step before any state changes;
a record that contradicts it stops execution.
diff --git a/docs/multi-host.md b/docs/multi-host.md
index 3cc2b6cb4..a3f9c505e 100644
--- a/docs/multi-host.md
+++ b/docs/multi-host.md
@@ -47,12 +47,17 @@ needs only Flare, the driver, and the core.
Linux aarch64 builds include RoCE transport by default. To enable it on Linux
x86_64, install the libibverbs development package and build with
`cargo build --release --locked --manifest-path flare-cli/Cargo.toml --features roce`.
-The resulting executable requires libibverbs at runtime. Default x86_64 builds
-do not link it and reject multi-host serving before loading GPU resources.
+Both builds load `libibverbs.so.1` lazily at run time only when opening a
+multi-host RoCE transport, so single-host serving runs without RDMA packages.
+Default x86_64 builds omit RoCE transport and reject multi-host serving before
+loading GPU resources.
Staging (`--stage-only`) does not need RoCE. Not qualified: x86_64 RoCE serving
on RDMA hardware; its coverage is functional, over Soft-RoCE.
The separate `rdma` feature enables the prefix pool's data channel.
+Run [`flare doctor`](cli-design.md#54-flare-doctor) on each DGX Spark to
+verify its local ConnectX-7 link and IPv4 RoCEv2 configuration before launch.
+
### Prefix cache pool
A multi-host instance can use a Selene prefix cache pool (see
diff --git a/docs/orbit.md b/docs/orbit.md
index 9c331b063..2e34f630f 100644
--- a/docs/orbit.md
+++ b/docs/orbit.md
@@ -215,6 +215,10 @@ sequenceDiagram
repository. An explicit `--revision` overrides the suffix; otherwise the
controller infers the revision from available candidate GPUs, refusing mixed
hardware unless the operator supplies a revision or narrower node/GPU constraints.
+ Placement matches each candidate GPU's reported revision against the resolved
+ core's signed platform identity (falling back to compute capability only for
+ legacy cores without a device identity), so `--revision` selects the Hub branch
+ without overriding Orbit's platform match.
The first candidate node with an available selected GPU acquires the pinned
core into its own Flare model cache. `--filename`, `--offline`, and
`--tensor-parallel` travel to that node; `--offline` resolves only that
@@ -318,8 +322,9 @@ Orbit allocates GPUs within hosts. A DGX Spark is a node with one
GPU; a workstation with sixteen RTX PRO 6000 GPUs is a node with sixteen,
running one agent. The agent reads its GPUs through NVML, loaded dynamically
like the CUDA driver, without creating a context: index, UUID, name, hardware
-revision (`gb10`, `gb202`, `gb300` from the PCI device id or compute
-capability), memory total and free, and utilization, memory-controller
+revision (a `PLATFORMS` identifier from the PCI device id or compute capability,
+or `sm{major}{minor}` for an unlisted compute capability), memory total and free,
+and utilization, memory-controller
utilization (the share of the sample period with memory reads or writes),
temperature, and SM clock where NVML reports them. These utilization values are
not measurements of bytes per second. Integrated GPUs whose NVML memory query
diff --git a/docs/prefix-cache-offload.md b/docs/prefix-cache-offload.md
index 4386c9e28..f4294f83a 100644
--- a/docs/prefix-cache-offload.md
+++ b/docs/prefix-cache-offload.md
@@ -163,17 +163,29 @@ holds every rank's bytes in one process. Each disk peer uses its host's intake.
Automatic registered intake is additional to the warm budget whenever warm
memory or local disk is enabled. It needs no setting: its slot count is
-`2 × max_active × row_slots + 2 × WINDOW_PAGES`, where `WINDOW_PAGES = 64`.
+`2 × max_active × row_slots + 2 × WINDOW_PAGES`, where `WINDOW_PAGES = 64`,
+except for disk-only offload (`memory = 0` with local disk enabled) on an
+integrated-memory device (`CU_DEVICE_ATTRIBUTE_INTEGRATED`), where intake
+targets two streaming windows and two continuation rows,
+`2 × (WINDOW_PAGES + row_slots)` (`intake_slots(layout, 1)`).
The warm checkpoint budget rounds down to whole slots. If host headroom cannot
hold the full intake, it shrinks toward two complete windows,
-`2 × (64 + row_slots)`, and one warning reports the memory needed for full intake.
+`2 × (WINDOW_PAGES + row_slots)`, and one warning reports the memory needed for
+full intake; on an integrated-memory disk-only host, the target already equals
+that two-window floor, so host headroom neither shrinks it nor emits a warning.
+Concurrent unique-prefix disk restores and concurrent outbound disk stores on an
+integrated-memory disk-only host share and serialize window allocations through
+those two streaming windows (returning `StoreOutcome::Retry(StoreReason::Queue)`
+only if `RECORDS_IN_FLIGHT` fills, rather than budget retries).
Prepared image inputs use one eighth of the warm budget, rounded down to 4 KiB,
in ordinary CPU memory; the rest holds checkpoint slots. Text-only cores use
all warm bytes for checkpoints. CPU input serialization also has a separate
bounded window derived from prepared image buffers, including with warm zero.
-With zero warm memory and disk enabled, intake uses about 0.5–8 GB of host
-memory; the amount depends on checkpoint geometry and selected concurrency.
+With zero warm memory and disk enabled, intake on discrete GPUs uses about
+0.5–8 GB of host memory depending on checkpoint geometry and selected
+concurrency; on integrated-memory devices it depends only on checkpoint geometry
+(`2 × (WINDOW_PAGES + row_slots)` slots).
On an integrated-memory device, such as a DGX Spark, GPU memory and host
memory are one physical pool, and the GPU prefix cache takes the
@@ -415,8 +427,38 @@ hosts, by `shard::Sharded` (section 2.14):
independent transfer handle and the disk thread. `store` streams checkpoints
through intake windows into record files; `fetch` streams them back to the GPU.
With warm zero and disk enabled, the pool contains only intake slots.
- `write_from(key, metadata, buffers)` and `read_into(key, buffers)` move records
- between files and caller-owned registered slots for the composite.
+ `write_from(id, header, temporary, path, pages, row, sums)` and
+ `read_into(id, path, expected, first_page, pages, row)` move raw records
+ between files and caller-owned registered slot addresses for the composite
+ store, and `write_packed(id, header, temporary, path, units, spans, row)` and
+ `read_into_packed(id, path, expected, row)` move v4 packed payloads between
+ files and composite host storage.
+ - Concurrent device `fetch` jobs whose segment path and expected header match
+ share one open file handle and coalesce windows aligned to `WINDOW_PAGES`
+ (64-page) file boundaries across both raw v1–v3 staging slots and v4 packed
+ `ReadPacked` buffers. Each attached restore submits its own GPU upload (or
+ codec decode and upload) from the shared window, and staging slots or packed
+ buffers release only after the disk read and every attached upload finish.
+ Caller-owned `read_into` and `read_into_packed` reads run on a separate
+ private path.
+ - Sharing relies on committed record files being immutable and pinned in
+ `DiskStore`'s index while any attached restore runs; the last user of a
+ shared segment waits for the disk-thread close to settle before reporting
+ `Fetched`, so no disk read outlives the caller's pin. When multiple device
+ restores run concurrently, window selection prefers windows demanded by
+ sibling restores before reading private tails, holding back lower-demand
+ windows while in-flight staged slots can free room for a higher-demand
+ shared window, and relaxing strict arrival-order scheduling.
+ - Limits and failure scope: sharing covers only windows still live in staging
+ (`Reading` or `Read`), so a window released before a later restore attaches
+ is read from disk again; aligning segments to `WINDOW_PAGES` file boundaries
+ adds at most one extra partial window per segment when
+ `skip_pages % WINDOW_PAGES != 0`. An open, read, or packed-payload content
+ error (`record_read`) on a shared segment or window fails every restore
+ attached to it after in-flight disk and transfer jobs drain, whereas an
+ error on a private child segment or a follower's transient GPU upload fails
+ only that restore. See section 4 for `StoreStats.bytes_in` and
+ `StoreStats.inbound_rate` accounting under coalesced restores.
Section 2.6 specifies a second transport, `Direct`, which is not implemented.
`CompositeStore` owns a `MemoryStore` and a `DiskStore` and implements the
@@ -474,8 +516,9 @@ offload event.
Transfers move records in windows of at most 64 pages plus the multi-slot row.
The pool contains warm checkpoint slots plus automatic intake slots. It is one
-4 KiB aligned anonymous mapping (`MAP_PRIVATE`, `MAP_ANONYMOUS`, `MAP_POPULATE`,
-advised for transparent huge pages), registered once at startup. Rows use each
+4 KiB aligned anonymous mapping (`MAP_PRIVATE`, `MAP_ANONYMOUS`, advised for
+transparent huge pages with `MADV_HUGEPAGE` before prefaulting via
+`MADV_POPULATE_WRITE`), registered once at startup. Rows use each
rank's page share across as many slots as needed; their pieces need not be
contiguous. CPU readers traverse pieces in rank order, preserving disk bytes
and streaming xxh3 checksum values. After copy-out, Selene compares local ranks'
@@ -524,7 +567,10 @@ slabs the same way in a split pool and a registered pool; each transfer
thread holds its rank's `RankPart` and places a
split slab's planes at their offsets relative to the rank's first plane.
Composite and disk stores, whose disk threads read and write whole records,
-keep the registered mapping. Cache sizing leaves each device 1/512 of the
+keep the registered mapping. On hosts where `HOST_NUMA` virtual memory
+allocation is unsupported (such as Windows WDDM and integrated Tegra/GA10B
+GPUs), a memory-only store also falls back to a registered anonymous mapping.
+Cache sizing leaves each device 1/512 of the
host memory it maps, its share of a split pool or the whole registered pool
including intake, plus 16 MiB for transfer streams.
@@ -619,19 +665,28 @@ from their last put or restore; this is acceptable for a cold-tier copy because
an instance that keeps the prefix hot re-cascades it on eviction.
At most once a minute, the model-thread poll walks from the oldest entry,
-skipping interior nodes and records that cannot be dropped, and stopping at
-the first fresh leaf or 64 expired leaves. Expired leaves are dropped outright;
+skipping interior nodes, fresh leaves, and records that cannot be dropped, and
+stopping after 64 expired leaves. Expired leaves are dropped outright;
they are never sent down the cascade. Page-only ancestors are removed with their
last child; in-flight copies and exports retain their storage. LRU positions change only for the accessed key.
-A fresh former interior node left as a leaf by pressure eviction can delay a
-sweep by up to one max age. The manager sweeps every namespace on its store
+The manager sweeps every namespace on its store
tick, using each index's own once-a-minute limit. Expiry does not apply to the
GPU tier.
-The disk thread in `selene/src/disk.rs` owns an `io_uring` ring over files
-opened with `O_DIRECT`,
-chunks transfers at 8 MiB, and computes and verifies checksums. Before accepting
-payload reads,
+The disk thread in `selene/src/disk.rs` owns an `io_uring` ring on Linux or an
+I/O completion port on Windows over raw v1–v3 record files opened for direct I/O,
+and chunks direct transfers at 8 MiB. On raw v1–v3 opens it reads the 4 KiB
+header and expected page-checksum segment in one direct transfer when the
+expected tail fits in its 1 MiB scratch buffer (`MAX_TAIL_PAGES`), retrying the
+4 KiB header block alone on failure so truncated-file and invalid-header
+diagnostics stay unchanged; v4 packed records read their variable-length
+directory metadata via `Header::read_metadata`. Raw page reads and writes hash
+64-bit `xxh3` checksums across `parallel_cpus.min(MAX_HASH_THREADS).min(buffers.len())`
+scoped `std::thread::scope` threads (`MAX_HASH_THREADS = 4`) when a batch holds
+at least `HASH_PARALLEL_MIN_PAGES` (`4`) pages and the host reports at least
+`HASH_PARALLEL_MIN_CPUS` (`4`) logical CPUs, keeping zero idle helper threads
+between batches and recomputing inline on the disk thread for any partition
+whose helper could not be created or unwound. Before accepting payload reads,
it checks the opened file's header against the indexed record, including all
layout and size fields. Changed headers cannot enlarge reads into registered
slabs. A failed ring submission drains every kernel-owned buffer reference
@@ -642,7 +697,8 @@ that drain cannot finish before the deadline.
driver symbol `cuMemcpyBatchAsync_v2`, with the CUDA 13
signature (destinations, sources, sizes, count, attributes, attribute indices,
attribute count, stream) and one attribute whose source access order is
-stream-ordered; `cuMemHostRegister_v2` with the portable flag;
+stream-ordered, falling back to per-entry `cuMemcpyAsync` on CUDA < 13.0 drivers
+where `cuMemcpyBatchAsync_v2` is absent; `cuMemHostRegister_v2` with the portable flag;
`cuMemHostUnregister`; `cuEventSynchronize`; `cuStreamCreateWithPriority`;
`cuDeviceGetAttribute` for the integrated-memory check and the host NUMA node,
which the loader's driver binding also provides; and `cuMemAddressReserve`,
@@ -861,10 +917,15 @@ Offload limits interference through bounded work and explicit ownership:
engines through per-token latency. Batch size and stream priority alone do
not bound those delays.
- CPU: transfer threads sleep on event waits and channel receives; the disk
- thread computes checksums and submits I/O. Both use `SCHED_BATCH` with a
- positive nice value to reduce contention with the model worker, HTTP runtime,
- and frontend workers. Adding CPU affinity requires a serving-latency
- measurement that shows a benefit.
+ thread submits I/O and hashes multi-page raw batches across the scoped
+ helpers of section 2.5. On Linux, offload threads use `SCHED_BATCH` with a
+ positive nice value, inherited by scoped hashing helpers through `clone`; on
+ Windows, offload threads lower priority to `THREAD_PRIORITY_BELOW_NORMAL`.
+ While an inbound restore is active or waiting and no GPU step is running,
+ `Worker::idle_wait` polls at `50 µs` instead of `2 ms`; idle multi-host disk
+ peers (`selene/src/shard.rs`) wait on `poll(POLLIN)` on their rank TCP socket
+ on Unix (`1 ms` sleep on non-Unix). Adding CPU affinity requires a
+ serving-latency measurement that shows a benefit.
- Page cache: all record I/O is direct, so disk writes neither grow the page
cache nor evict the core file's mappings.
- Memory: every slab pool is fixed at startup and sized by the defaults in
@@ -958,9 +1019,11 @@ Offload limits interference through bounded work and explicit ownership:
worker, so its ids and pins are neither reused nor released.
- Offload copies are bounded per issue, and offload threads run below the
serving threads' priority.
-- Steady-state serving allocates no device memory, no pinned memory, and no
- threads for offload; slabs, descriptor arrays, rings, and events are created
- at startup, as are the cuFile registrations of the `Direct` transport design.
+- Steady-state serving allocates no device memory or pinned memory, and keeps
+ persistent transfer and disk threads fixed from startup (apart from the
+ short-lived scoped page-hashing helpers of section 2.5); slabs, descriptor
+ arrays, rings, and events are created at startup, as are the cuFile
+ registrations of the `Direct` transport design.
### 2.13 Reusable CPU inputs
@@ -1133,8 +1196,10 @@ startup retries its existing attachment after a lost connection.
Before any CUDA registration, the complete Hello plan must fit both budgets:
the manager's arena plus staging on this host, or the client's data staging for
a remote manager. Host supply is available physical memory less future local
-host allocations, a 2 GiB server allowance and five percent of total RAM for the
-system. Every GPU is charged one device byte per 512 registered host bytes,
+host allocations and, unless an explicit `--memory-limit` overrides implicit
+reserves on an integrated GPU, a scaled service allowance (`64 MiB` at or below
+`16 GiB` total RAM, `min(2 GiB, total / 32)` above `16 GiB`) plus five percent
+of total RAM for the system. Every GPU is charged one device byte per 512 registered host bytes,
rounded up separately for each region, as for local registered tiers. Integrated
GPUs also share the host-byte charge once per host. The check preserves runtime
headroom, explicit memory limits and minimum execution/KV capacity; accepted
@@ -1231,6 +1296,13 @@ same completion events the store produces.
before they fill. DRAM follows the free and clean floors described above;
disk uses byte-based headroom. Disk headroom includes
pending unlink and truncate bytes, which stay charged until completion.
+ Within each staged-transport submission pass, `Staged::pump_all` submits
+ interactive inbound restores ahead of outbound writes, then drains queued
+ unlinks and truncates while disk-queue space remains; after
+ `MAINTENANCE_DEFER_LIMIT` (`8`) consecutive passes where queued maintenance
+ lost free disk-queue space to inbound or outbound work, the next pass with
+ space submits one reserved maintenance job ahead of inbound and outbound so
+ reclamation remains bounded under sustained restore bursts.
Store, eviction, spill completion, handover completion, reconnect and hashing
progress trigger one coalesced maintenance pass per model-thread poll.
Selection is bounded by the spill and move caps, without sorting all
@@ -1580,6 +1652,22 @@ python3 -m qualify.host_cache_isolation --core /path/to/core.safetensors \
| Inbound latency | 8K, 32K, and 100K token prefixes, through each store and transport | admission to `Restore` submission | reported beside the prefill time of the same prefix |
| Copy-out bandwidth | per rank, each transport | bytes per second from store counters | reported |
+On `DiskStore`, `StoreStats.bytes_in` counts per-fetch payload bytes restored
+across completed fetches (raw bytes for v1–v3 records and compressed payload
+bytes for v4 packed records, credited once per completed fetch including
+coalesced followers), while `StoreStats.inbound_rate` observes end-to-end
+uncompressed checkpoint bytes (`layout.record_bytes(chain.pages)`) over fetch
+wall time (covering file opens, slot queueing, disk reads, codec decode, GPU
+upload, and all `Sharded` ranks). Restores submitted while an in-flight restore
+already reads a shared segment skip `inbound_rate.started()` and observe
+`inbound_rate` only downward (when their end-to-end throughput is slower than
+the current estimate), so fast coalesced followers riding pre-existing staged
+windows never inflate bandwidth while continuous overlapping streams,
+mid-stream slowdowns, and bursts whose leader fails still push `inbound_rate`
+down and allow upward recovery when throughput improves. `CompositeStore`
+maintains an end-to-end `disk_inbound_rate` over `read_into` and
+`read_into_packed` completions.
+
The `Direct` transport design adds two measurements when it is implemented:
inbound latency against the staged transport on the same prefixes, and fabric
bandwidth from each NVMe root complex to each GPU root complex.
diff --git a/docs/release.md b/docs/release.md
index 62e7cf708..0c1d095ab 100644
--- a/docs/release.md
+++ b/docs/release.md
@@ -27,10 +27,12 @@ preparation inputs and are never part of a release.
Every executable loads the NVIDIA driver at run time; no archive contains CUDA
libraries, and no build links the CUDA toolkit.
-- The Linux executables are built on Ubuntu 24.04 and require glibc 2.39 or
- later.
-- The arm64 Linux executable links `libibverbs` for multi-host RoCE serving.
- Install `libibverbs1` and `ibverbs-providers`.
+- The Linux executables are built in Ubuntu 22.04 and require glibc 2.35 or
+ later (covering Ubuntu 22.04+, JetPack 6, and Ubuntu 24.04+).
+- The arm64 Linux executable loads `libibverbs.so.1` lazily at run time only
+ when serving multi-host RoCE cores. Single-host serving requires no RDMA
+ packages; multi-host RoCE serving requires `libibverbs1` and
+ `ibverbs-providers`.
- The Windows desktop requires Windows 11. It bundles its Windows App SDK and
Visual C++ runtime files. `Flare.exe` is unsigned.
@@ -65,13 +67,16 @@ before anything is published; no target can be skipped.
default branch and all three release manifests and lockfiles to contain
`0.0.0`. Each build job applies the tag's version before compiling. A
dispatched run builds `0.0.0` without publishing a release.
-- **Linux.** The runner builds `flare` with
+- **Linux.** Each runner builds `flare` with
`cargo build --locked --release --manifest-path flare-cli/Cargo.toml` and
- packages it with `packaging/archive.py`. The extracted archive then runs in
- an `ubuntu:24.04` container that holds only that image's libraries, plus the
- two RoCE packages on arm64: `flare --version` must print `flare VERSION`, and
- `flare run --help`, `flare agent --help`, and `flare orbit --help` must
- succeed. The job also requires the license and notice files in the archive.
+ packages it with `packaging/archive.py` inside an `ubuntu:22.04` container so
+ dynamic symbol versions stay at or below `GLIBC_2.35`. The job verifies that
+ `flare` has no `libibverbs.so` `DT_NEEDED` entry and no `GLIBC_` symbol
+ version newer than `2.35`, requires the license and notice files in the
+ archive, and runs the extracted archive in clean `ubuntu:22.04` and
+ `ubuntu:24.04` containers with only base image libraries (no RDMA packages):
+ `flare --version` must print `flare VERSION`, and `flare run --help`,
+ `flare agent --help`, and `flare orbit --help` must succeed.
- **Windows.** The runner installs tools with
`scripts/setup_windows.ps1 -RustToolchain 1.94.1 -BuildToolsOnly`, builds
with `scripts/build_winui.ps1 -Platform PLATFORM -SingleFile`, and packages
diff --git a/docs/runtime-core-design.md b/docs/runtime-core-design.md
index 463437aa6..dbb1b4a3a 100644
--- a/docs/runtime-core-design.md
+++ b/docs/runtime-core-design.md
@@ -7,8 +7,8 @@ interpreter. The [core format](core-format-design.md) defines a packed
payload companions. The Flare model cache stores the directory form. Engine upgrades preserve previously supported models without re-export.
Execution ABI labels do not gate loading; declared operations and layouts are validated. Preparation happens in Python with PyTorch, Transformers, and b12x. Serving requires the NVIDIA driver,
the core, the Rust `flare` executable, and its system library dependencies:
-the C and C++ runtime libraries, plus libibverbs on aarch64 Linux builds, which
-enable RoCE. libjpeg-turbo is compiled from source through the `turbojpeg`
+the C and C++ runtime libraries, plus `libibverbs.so.1` loaded lazily at run
+time on aarch64 Linux builds only when serving multi-host RoCE cores. libjpeg-turbo is compiled from source through the `turbojpeg`
crate's `cmake` feature; the x86-64 Linux executable has no dynamic
libturbojpeg dependency. Python and preparation tools are not required.
The [core design](core-design.md) defines the model contracts, scheduling,
@@ -329,6 +329,9 @@ A cache miss installs an immutable object without replacing existing entries.
`--no-weights` requires exact cached weight payloads, including tuned weights;
missing or corrupt required payloads fail publication. Executable and initial-state
payloads may be installed during this export.
+Temporary uncompressed cubin and graph spans extracted during rank assembly skip
+standalone digests and per-file `fsync` calls because executable sealing
+compresses, hashes, and syncs each rank's archive before publication.
Native stderr rows omit the Flare banner. Rank-zero capture reports storage
clearing, graph inspection and serialization, module/global capture, storage scans,
@@ -395,12 +398,12 @@ rules:
and `expert_scale_compression`) that must agree for both core combination and
cached-weight reuse.
- `PREPARATION_PARAMETER_SCOPE_DRAFT_WEIGHT`: draft-model weight semantics
- (`speculation.has_draft`, resolved `speculation.draft_body_quantization`,
- `speculation.draft_head_quantization`, and
- `speculation.markov_head_quantization`) that must agree for core combination
- and for cached-weight reuse when the export prepares a draft model. With
- `--reuse-weights --no-mtp`, the export omits draft-weight parameters and
- reuses target views independently of cached draft settings.
+ (`speculation.has_draft`, `speculation.method`, resolved
+ `speculation.draft_body_quantization`, `speculation.draft_head_quantization`,
+ and `speculation.markov_head_quantization`) that must agree for core
+ combination and for cached-weight reuse when the export prepares a draft
+ model. With `--reuse-weights --no-mtp`, the export omits draft-weight
+ parameters and reuses target views independently of cached draft settings.
Ignition resolves effective defaults and inheritance before export—including
explicitly recording `online_mxfp8_scope` (`all` when omitted) and DFlash2's
diff --git a/eos/src/unix.rs b/eos/src/unix.rs
index 0a2583ae8..178b0bfc1 100644
--- a/eos/src/unix.rs
+++ b/eos/src/unix.rs
@@ -88,7 +88,7 @@ pub fn map_host(bytes: usize) -> io::Result {
std::ptr::null_mut(),
bytes,
libc::PROT_READ | libc::PROT_WRITE,
- libc::MAP_PRIVATE | libc::MAP_ANONYMOUS | libc::MAP_POPULATE,
+ libc::MAP_PRIVATE | libc::MAP_ANONYMOUS,
-1,
0,
)
@@ -96,9 +96,25 @@ pub fn map_host(bytes: usize) -> io::Result {
if ptr == libc::MAP_FAILED {
return Err(io::Error::last_os_error());
}
+ // Advise transparent huge pages before faulting so Linux backs the mapping
+ // with 2 MiB pages when THP is set to `madvise` rather than faulting 4 KiB
+ // pages first via MAP_POPULATE.
unsafe {
libc::madvise(ptr, bytes, libc::MADV_HUGEPAGE);
}
+ #[cfg(target_os = "linux")]
+ let populated = unsafe { libc::madvise(ptr, bytes, libc::MADV_POPULATE_WRITE) == 0 };
+ #[cfg(not(target_os = "linux"))]
+ let populated = false;
+ if !populated {
+ let step = page_size().max(1);
+ for offset in (0..bytes).step_by(step) {
+ // SAFETY: `offset < bytes` and the mapping is writable.
+ unsafe {
+ ptr.cast::().add(offset).write_volatile(0);
+ }
+ }
+ }
Ok(ptr as usize)
}
@@ -187,4 +203,47 @@ mod tests {
// Restore the prior soft limit so other tests in the process see the original value.
let _ = unsafe { libc::setrlimit(libc::RLIMIT_NOFILE, &before) };
}
+
+ #[test]
+ fn map_host_advises_hugepages_and_prefaults_zeroed_pages() {
+ let bytes = 4 << 20;
+ let address = map_host(bytes).unwrap();
+ let slice = unsafe { std::slice::from_raw_parts(address as *const u8, bytes) };
+ assert!(slice.iter().all(|&b| b == 0));
+ #[cfg(target_os = "linux")]
+ if let Ok(smaps) = std::fs::read_to_string("/proc/self/smaps") {
+ let needle = format!("{address:x}-");
+ if let Some(start) = smaps.find(&needle) {
+ let block = &smaps[start..];
+ let end = block[1..]
+ .find('\n')
+ .and_then(|first_nl| {
+ block[first_nl + 1..]
+ .lines()
+ .position(|line| {
+ line.as_bytes().first().is_some_and(u8::is_ascii_hexdigit)
+ && line.contains('-')
+ })
+ .map(|idx| {
+ block[first_nl + 1..]
+ .lines()
+ .take(idx)
+ .map(|l| l.len() + 1)
+ .sum::()
+ + first_nl
+ + 1
+ })
+ })
+ .unwrap_or(block.len());
+ let vma = &block[..end];
+ if let Some(flags) = vma.lines().find(|l| l.starts_with("VmFlags:")) {
+ assert!(
+ flags.split_whitespace().any(|flag| flag == "hg"),
+ "expected MADV_HUGEPAGE (hg) in VmFlags, got: {flags}"
+ );
+ }
+ }
+ }
+ unsafe { unmap_host(address, bytes) };
+ }
}
diff --git a/flare-cli/Cargo.lock b/flare-cli/Cargo.lock
index 70639074d..1a8decf70 100644
--- a/flare-cli/Cargo.lock
+++ b/flare-cli/Cargo.lock
@@ -88,7 +88,7 @@ version = "1.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc"
dependencies = [
- "windows-sys 0.60.2",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -99,7 +99,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d"
dependencies = [
"anstyle",
"once_cell_polyfill",
- "windows-sys 0.60.2",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -693,7 +693,7 @@ checksum = "be1e0bca6c3637f992fc1cc7cbc52a78c1ef6db076dbf1059c4323d6a2048376"
[[package]]
name = "deepseek-recipe"
version = "0.2.0"
-source = "git+https://github.com/local-inference-lab/deepseek-recipe?rev=6d09e9be68dbf4ae488f6b22ee9114dcf9ea6270#6d09e9be68dbf4ae488f6b22ee9114dcf9ea6270"
+source = "git+https://github.com/local-inference-lab/deepseek-recipe?rev=70be62f30c64400229fcdb233a7f19a03a5e8ed6#70be62f30c64400229fcdb233a7f19a03a5e8ed6"
dependencies = [
"async-stream",
"base64 0.22.1",
@@ -715,7 +715,7 @@ dependencies = [
[[package]]
name = "deepseek-recipe-core"
version = "0.2.0"
-source = "git+https://github.com/local-inference-lab/deepseek-recipe?rev=6d09e9be68dbf4ae488f6b22ee9114dcf9ea6270#6d09e9be68dbf4ae488f6b22ee9114dcf9ea6270"
+source = "git+https://github.com/local-inference-lab/deepseek-recipe?rev=70be62f30c64400229fcdb233a7f19a03a5e8ed6#70be62f30c64400229fcdb233a7f19a03a5e8ed6"
dependencies = [
"deepseek-recipe-macros",
"serde",
@@ -725,7 +725,7 @@ dependencies = [
[[package]]
name = "deepseek-recipe-encoding"
version = "0.2.0"
-source = "git+https://github.com/local-inference-lab/deepseek-recipe?rev=6d09e9be68dbf4ae488f6b22ee9114dcf9ea6270#6d09e9be68dbf4ae488f6b22ee9114dcf9ea6270"
+source = "git+https://github.com/local-inference-lab/deepseek-recipe?rev=70be62f30c64400229fcdb233a7f19a03a5e8ed6#70be62f30c64400229fcdb233a7f19a03a5e8ed6"
dependencies = [
"aho-corasick",
"deepseek-recipe-core",
@@ -739,7 +739,7 @@ dependencies = [
[[package]]
name = "deepseek-recipe-macros"
version = "0.2.0"
-source = "git+https://github.com/local-inference-lab/deepseek-recipe?rev=6d09e9be68dbf4ae488f6b22ee9114dcf9ea6270#6d09e9be68dbf4ae488f6b22ee9114dcf9ea6270"
+source = "git+https://github.com/local-inference-lab/deepseek-recipe?rev=70be62f30c64400229fcdb233a7f19a03a5e8ed6#70be62f30c64400229fcdb233a7f19a03a5e8ed6"
dependencies = [
"proc-macro2",
"quote",
@@ -830,7 +830,7 @@ dependencies = [
"libc",
"option-ext",
"redox_users",
- "windows-sys 0.59.0",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -901,7 +901,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
dependencies = [
"libc",
- "windows-sys 0.59.0",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -2340,7 +2340,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "03da047801ff44bb6a4d407d4860c05fd70bb81714e6b2f3812603d5b145b042"
dependencies = [
"heck",
- "itertools 0.14.0",
+ "itertools 0.13.0",
"log",
"multimap",
"petgraph",
@@ -2361,7 +2361,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b570b25f7617e43d59005d0990ccb79e950a423952cea19671b7a876da390adf"
dependencies = [
"anyhow",
- "itertools 0.14.0",
+ "itertools 0.13.0",
"proc-macro2",
"quote",
"syn 2.0.119",
@@ -2646,7 +2646,7 @@ dependencies = [
"errno",
"libc",
"linux-raw-sys 0.12.1",
- "windows-sys 0.59.0",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -2861,7 +2861,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4"
dependencies = [
"libc",
- "windows-sys 0.60.2",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -3006,10 +3006,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd"
dependencies = [
"fastrand",
- "getrandom 0.3.4",
+ "getrandom 0.4.3",
"once_cell",
"rustix 1.1.5",
- "windows-sys 0.59.0",
+ "windows-sys 0.61.2",
]
[[package]]
diff --git a/flare-cli/Cargo.toml b/flare-cli/Cargo.toml
index ef8c1ba88..4b68a3403 100644
--- a/flare-cli/Cargo.toml
+++ b/flare-cli/Cargo.toml
@@ -7,7 +7,7 @@ rust-version = "1.88"
publish = false
[features]
-# Multi-host collectives on Linux x86_64; links libibverbs.
+# Multi-host collectives on Linux x86_64; loads libibverbs.so.1 at run time.
roce = ["flare-helios/roce", "flare/roce"]
# The prefix cache pool's data channel may use RDMA when its manager offers it (experimental).
rdma = ["flare-helios/rdma", "flare/rdma"]
@@ -39,7 +39,7 @@ tempfile = "3"
[dev-dependencies]
prost = "0.14"
-# DGX Spark and Grace hosts serve multi-host cores over RoCEnante, which links libibverbs.
+# DGX Spark and Grace hosts serve multi-host cores over RoCEnante, which loads libibverbs.so.1 lazily at run time.
[target.'cfg(all(target_os = "linux", target_arch = "aarch64"))'.dependencies]
flare-helios = { path = "../helios", features = ["runtime-core", "server", "roce"] }
# sha2 0.10 gates ARM SHA-256 instructions behind its asm feature.
diff --git a/flare-cli/src/cache_commands.rs b/flare-cli/src/cache_commands.rs
index a95a7897d..f0d965317 100644
--- a/flare-cli/src/cache_commands.rs
+++ b/flare-cli/src/cache_commands.rs
@@ -171,20 +171,25 @@ fn list_entries(
.collect(),
};
let mut documents = Vec::new();
+ let mut hub_cores = Vec::new();
+ let mut hub_rows = Vec::new();
for (model, identity) in models {
let default = root.ref_entry(&model)?;
let versions = root.versions(&model)?;
let mut entries = Vec::new();
for version in versions {
let selected = default.as_deref() == Some(version.as_str());
- let report = (|| -> Result<(bool, flare_helios::core::cache::EntrySummary, Usage), Box> {
+ let report = (|| -> Result<_, Box> {
let leased = root.is_leased(&model, &version)?;
let entry = root.entry(&model, &version)?;
let summary = root.summarize_entry(&entry)?;
let usage = usage(entry.directory())?;
- Ok((leased, summary, usage))
+ let ready_sizes = summary.deployments.iter().filter(|deployment| deployment.ready)
+ .map(|deployment| deployment.tensor_parallel).collect();
+ let hub_core = flare::hub::InstalledHubCore::read(root, &entry, ready_sizes).ok().flatten();
+ Ok((leased, summary, usage, hub_core))
})();
- let (leased, summary, usage) = match report {
+ let (leased, summary, usage, hub_core) = match report {
Ok(values) => values,
Err(error) => {
// One unreadable entry must not hide the rest of the cache.
@@ -220,6 +225,10 @@ fn list_entries(
} else {
(physical, None)
};
+ if let Some(hub_core) = hub_core {
+ hub_rows.push((documents.len(), entries.len()));
+ hub_cores.push(hub_core);
+ }
entries.push(serde_json::json!({
"model": identity,
"model_key": model,
@@ -259,6 +268,15 @@ fn list_entries(
"versions": entries,
}));
}
+ let options = flare::options::HubOptions { offline: list.offline, ..Default::default() };
+ for ((model, version), report) in hub_rows.into_iter().zip(flare::hub::check_core_updates(&options, &hub_cores)) {
+ let row = &mut documents[model]["versions"][version];
+ row["installed_updated_at"] = serde_json::json!(report.installed_updated_at);
+ row["update_available"] = serde_json::json!(report.update_available);
+ row["update_commit"] = serde_json::json!(report.update.as_ref().map(|update| &update.commit));
+ row["update_updated_at"] = serde_json::json!(report.update.as_ref()
+ .map(|update| update.updated_at.as_str()).filter(|date| !date.is_empty()));
+ }
let document = serde_json::json!({
"cache": root.path().display().to_string(),
"models": documents,
@@ -336,6 +354,22 @@ fn render_list(document: &Value, mut output: Canvas) -> String {
output.note("");
continue;
}
+ if let Some(installed) = entry.get("installed_updated_at") {
+ let date = |value: &Value| {
+ if value.is_null() { "unavailable".into() } else { text(value) }
+ };
+ output.row("Last updated", &date(installed));
+ let available = entry["update_available"].as_bool();
+ let availability = match available {
+ Some(true) => "yes",
+ Some(false) => "no",
+ None => "unavailable",
+ };
+ output.row("Update available", availability);
+ if available == Some(true) {
+ output.row("Update date", &date(&entry["update_updated_at"]));
+ }
+ }
output.row(
"Format",
&format!(
diff --git a/flare-cli/src/cli.rs b/flare-cli/src/cli.rs
index 5139b6024..6ae41b15b 100644
--- a/flare-cli/src/cli.rs
+++ b/flare-cli/src/cli.rs
@@ -47,7 +47,7 @@ pub enum Command {
Download(Download),
/// Summarize a core's metadata, with optional memory, graph, and frontend details.
Inspect(Inspect),
- /// Check Linux host PCIe, NVIDIA driver, IOMMU, and ACS settings for TP>1 serving.
+ /// Check Linux host readiness for PCIe and DGX Spark tensor-parallel serving.
Doctor(Doctor),
#[command(hide = true)]
HardwareRevision {
@@ -146,6 +146,10 @@ pub struct CacheList {
/// Print the listing as JSON.
#[arg(long)]
pub json: bool,
+
+ /// List the cache without checking Hugging Face for revision dates or updates.
+ #[arg(long)]
+ pub offline: bool,
}
#[derive(Debug, Args)]
@@ -199,7 +203,7 @@ pub struct CacheGc {
#[derive(Debug, Args, Default, Clone, serde::Serialize, serde::Deserialize)]
pub struct HubOptions {
- /// Hub revision; uses the model origin when cached, otherwise detects ga102, gb10, gb202, or gb300.
+ /// Hub revision; uses the model origin when cached, otherwise detects the GPU's platform.
#[arg(long, value_name = "REVISION", help_heading = "Download options")]
pub revision: Option,
@@ -2429,6 +2433,7 @@ mod cache_cli_tests {
"/cache",
"list",
"--json",
+ "--offline",
]);
assert_eq!(
list.core_cache.as_deref(),
@@ -2438,6 +2443,7 @@ mod cache_cli_tests {
CacheCommand::List(CacheList {
model: None,
json: true,
+ offline: true,
}) => {}
other => panic!("unexpected list command: {other:?}"),
}
diff --git a/flare-cli/src/doctor.rs b/flare-cli/src/doctor.rs
index 100571722..fac6b6563 100644
--- a/flare-cli/src/doctor.rs
+++ b/flare-cli/src/doctor.rs
@@ -4,7 +4,10 @@
* SPDX-License-Identifier: Apache-2.0
*/
-//! Host preflight diagnostics for multi-GPU tensor-parallel serving over PCIe on Linux.
+//! Host preflight diagnostics for tensor-parallel serving on Linux.
+
+#[cfg(any(target_os = "linux", test))]
+mod spark;
use std::{
collections::{BTreeMap, BTreeSet},
@@ -63,6 +66,7 @@ const IOMMU_REMEDIATION: &str =
pub enum CheckStatus {
Pass,
Fail,
+ Warn,
Unverified,
NotApplicable,
}
@@ -72,6 +76,7 @@ impl CheckStatus {
match self {
Self::Pass => "PASS",
Self::Fail => "FAIL",
+ Self::Warn => "WARN",
Self::Unverified => "UNVERIFIED",
Self::NotApplicable => "N/A",
}
@@ -85,7 +90,7 @@ impl CheckStatus {
let code = match self {
Self::Pass => "1;32",
Self::Fail => "1;31",
- Self::Unverified => "1;33",
+ Self::Warn | Self::Unverified => "1;33",
Self::NotApplicable => "2",
};
format!("\x1b[{code}m{label}\x1b[0m")
@@ -217,11 +222,13 @@ fn diagnose(requested_gpus: &[i32]) -> Result {
{
let inherited = std::env::var("CUDA_VISIBLE_DEVICES").ok();
let probe = probe_linux_gpus(requested_gpus, inherited.as_deref())?;
+ let sysfs = Path::new(SYSFS_ROOT);
Ok(evaluate_linux_host(
probe,
- Path::new(SYSFS_ROOT),
+ sysfs,
Path::new(NVIDIA_PARAMS_PATH),
Path::new(CMDLINE_PATH),
+ flare_helios::execution::roce_fabric::discover,
))
}
#[cfg(not(target_os = "linux"))]
@@ -259,11 +266,13 @@ struct GpuProbe {
notes: Vec,
}
+#[cfg(any(target_os = "linux", test))]
fn evaluate_linux_host(
probe: GpuProbe,
sysfs_root: &Path,
nvidia_params_path: &Path,
cmdline_path: &Path,
+ discover: impl FnOnce() -> flare_helios::Result,
) -> Report {
let gpu_bdfs: Vec = probe.gpus.iter().map(|g| g.pci_bus_id.clone()).collect();
let ancestor_chains = collect_ancestor_chains(sysfs_root, &gpu_bdfs);
@@ -274,51 +283,66 @@ fn evaluate_linux_host(
Interconnect::Pcie | Interconnect::Mixed
);
+ let spark_check = spark::check_host(sysfs_root, discover);
let mut notes = probe.notes;
- if probe.interconnect == Interconnect::NvLink {
+ let mut checks = if probe.interconnect == Interconnect::NvLink {
notes.push(
"All selected GPU pairs have NVLink P2P; PCIe TP>1 tuning checks are not required."
.into(),
);
- return Report {
- platform: "linux",
- interconnect: probe.interconnect,
- pcie_tp_checks_required: false,
- gpus: probe.gpus,
- bridges,
- notes,
- checks: vec![Check {
- id: "pcie.interconnect".into(),
- name: "PCIe TP>1 preflight".into(),
- status: CheckStatus::NotApplicable,
- expected: None,
- actual: Some("NVLink".into()),
- detail: "Selected GPUs are connected over NVLink.".into(),
- remediation: None,
- }],
- ok: true,
- all_verified: true,
+ vec![Check {
+ id: "pcie.interconnect".into(),
+ name: "PCIe TP>1 preflight".into(),
+ status: CheckStatus::NotApplicable,
+ expected: None,
+ actual: Some("NVLink".into()),
+ detail: "Selected GPUs are connected over NVLink.".into(),
+ remediation: None,
+ }]
+ } else if spark_check.is_some() && !pcie_tp_checks_required {
+ let (status, detail) = if probe.interconnect == Interconnect::SingleGpu {
+ (
+ CheckStatus::NotApplicable,
+ "PCIe TP>1 checks require at least two selected GPUs.",
+ )
+ } else {
+ (
+ CheckStatus::Unverified,
+ "No GPUs were selected or detected for PCIe topology checks.",
+ )
};
- }
-
- if matches!(
- probe.interconnect,
- Interconnect::SingleGpu | Interconnect::NoGpus
- ) {
- notes.push(
- "Fewer than two GPUs selected; reporting host readiness for PCIe TP>1 serving.".into(),
- );
- }
+ vec![Check {
+ id: "pcie.interconnect".into(),
+ name: "PCIe TP>1 preflight".into(),
+ status,
+ expected: None,
+ actual: Some(probe.interconnect.description().into()),
+ detail: detail.into(),
+ remediation: None,
+ }]
+ } else {
+ if matches!(
+ probe.interconnect,
+ Interconnect::SingleGpu | Interconnect::NoGpus
+ ) {
+ notes.push(
+ "Fewer than two GPUs selected; reporting host readiness for PCIe TP>1 serving."
+ .into(),
+ );
+ }
- let params_text = std::fs::read_to_string(nvidia_params_path);
- let params_result = params_text
- .as_deref()
- .map_err(|error| format!("cannot read {}: {error}", nvidia_params_path.display()));
- let mut checks = check_nvidia_params(params_result);
+ let params_text = std::fs::read_to_string(nvidia_params_path);
+ let params_result = params_text
+ .as_deref()
+ .map_err(|error| format!("cannot read {}: {error}", nvidia_params_path.display()));
+ let mut checks = check_nvidia_params(params_result);
+ let cmdline = std::fs::read_to_string(cmdline_path).ok();
+ checks.push(check_iommu(sysfs_root, &gpu_bdfs, cmdline.as_deref()));
+ checks.push(check_acs(sysfs_root, &bridges));
+ checks
+ };
- let cmdline = std::fs::read_to_string(cmdline_path).ok();
- checks.push(check_iommu(sysfs_root, &gpu_bdfs, cmdline.as_deref()));
- checks.push(check_acs(sysfs_root, &bridges));
+ checks.extend(spark_check);
Report {
platform: "linux",
@@ -445,7 +469,7 @@ fn all_pairs_nvlink_by_pci_bdfs(gpu_bdfs: &[String]) -> Option {
/// Render a human-readable `flare doctor` report into `canvas`.
pub fn render(report: &Report, mut canvas: Canvas) -> String {
let color = canvas.is_color();
- canvas.open("Flare doctor · PCIe TP>1 preflight");
+ canvas.open("Flare doctor · Host preflight");
canvas.row("platform", report.platform);
canvas.row("interconnect", report.interconnect.description());
canvas.row(
@@ -492,7 +516,7 @@ pub fn render(report: &Report, mut canvas: Canvas) -> String {
let mut remediations = Vec::new();
for check in &report.checks {
- if matches!(check.status, CheckStatus::Fail | CheckStatus::Unverified)
+ if matches!(check.status, CheckStatus::Fail | CheckStatus::Warn | CheckStatus::Unverified)
&& let Some(hint) = &check.remediation
&& !remediations.contains(hint)
{
@@ -506,26 +530,12 @@ pub fn render(report: &Report, mut canvas: Canvas) -> String {
}
}
- let passed = report
- .checks
- .iter()
- .filter(|c| c.status == CheckStatus::Pass)
- .count();
- let failed = report
- .checks
- .iter()
- .filter(|c| c.status == CheckStatus::Fail)
- .count();
- let unverified = report
- .checks
- .iter()
- .filter(|c| c.status == CheckStatus::Unverified)
- .count();
- let na = report
- .checks
- .iter()
- .filter(|c| c.status == CheckStatus::NotApplicable)
- .count();
+ let count = |status| report.checks.iter().filter(|c| c.status == status).count();
+ let passed = count(CheckStatus::Pass);
+ let failed = count(CheckStatus::Fail);
+ let warnings = count(CheckStatus::Warn);
+ let unverified = count(CheckStatus::Unverified);
+ let na = count(CheckStatus::NotApplicable);
let mut summary = Vec::new();
if passed > 0 {
@@ -534,6 +544,11 @@ pub fn render(report: &Report, mut canvas: Canvas) -> String {
if failed > 0 {
summary.push(format!("{failed} failed"));
}
+ if warnings == 1 {
+ summary.push("1 warning".into());
+ } else if warnings > 1 {
+ summary.push(format!("{warnings} warnings"));
+ }
if unverified > 0 {
summary.push(format!("{unverified} unverified"));
}
@@ -545,13 +560,11 @@ pub fn render(report: &Report, mut canvas: Canvas) -> String {
if failed > 0 {
canvas.row("status", &CheckStatus::Fail.styled(color));
} else if unverified > 0 {
- canvas.row(
- "status",
- &format!(
- "{} (run with sudo to complete privileged checks)",
- CheckStatus::Unverified.styled(color)
- ),
- );
+ canvas.row("status", &CheckStatus::Unverified.styled(color));
+ } else if warnings > 0 {
+ canvas.row("status", &CheckStatus::Warn.styled(color));
+ } else if passed == 0 && na > 0 {
+ canvas.row("status", &CheckStatus::NotApplicable.styled(color));
} else {
canvas.row("status", &CheckStatus::Pass.styled(color));
}
@@ -1504,6 +1517,72 @@ EnableResizableBar: 1
RegistryDwords: "ForceP2P=0x11;RMForceP2PType=1;RMPcieP2PType=2;GrdmaPciTopoCheckOverride=1"
"#;
+ #[cfg(target_os = "linux")]
+ #[test]
+ fn gb10_and_n1x_without_cx7_skip_fabric_preflight() {
+ use flare_helios::core::naming::GB10_DEVICES;
+
+ let dir = tempfile::tempdir().unwrap();
+ let sysfs = dir.path();
+ let gpu = sysfs.join("bus/pci/devices/000f:01:00.0");
+ fs::create_dir_all(&gpu).unwrap();
+ fs::write(gpu.join("vendor"), "0x10de\n").unwrap();
+ let report = |interconnect| {
+ evaluate_linux_host(
+ GpuProbe {
+ gpus: Vec::new(),
+ interconnect,
+ notes: Vec::new(),
+ },
+ sysfs,
+ &sysfs.join("params"),
+ &sysfs.join("cmdline"),
+ || panic!("RoCE discovery must be skipped when there is no CX7 adapter"),
+ )
+ };
+
+ fs::write(gpu.join("device"), "0x2b85\n").unwrap();
+ assert!(
+ report(Interconnect::SingleGpu)
+ .checks
+ .iter()
+ .all(|check| check.id != "spark.cx7")
+ );
+
+ for device in GB10_DEVICES {
+ fs::write(gpu.join("device"), format!("0x{device:04x}\n")).unwrap();
+ let report = report(Interconnect::SingleGpu);
+ assert!(report.ok);
+ assert_eq!(report.checks.len(), 2);
+ assert!(
+ report.checks.iter().any(|check| check.id == "pcie.interconnect")
+ );
+ let cx7 = report
+ .checks
+ .iter()
+ .find(|check| check.id == "spark.cx7")
+ .unwrap();
+ assert!(
+ report.checks.iter().all(|check| check.status == CheckStatus::NotApplicable)
+ );
+ assert_eq!(
+ serde_json::to_value(cx7).unwrap()["status"],
+ "not_applicable"
+ );
+ assert!(!render(&report, Canvas::sized(100, false)).contains("PASS"));
+ }
+
+ let report = report(Interconnect::NoGpus);
+ assert!(report.ok);
+ assert!(!report.all_verified);
+ let pcie = report
+ .checks
+ .iter()
+ .find(|check| check.id == "pcie.interconnect")
+ .unwrap();
+ assert_eq!(pcie.status, CheckStatus::Unverified);
+ }
+
#[test]
fn nvidia_params_parser_and_checks_validate_all_required_fields() {
let checks = check_nvidia_params(Ok(HEALTHY_NVIDIA_PARAMS));
@@ -1875,6 +1954,7 @@ RegistryDwords: "ForceP2P=0x01;RMForceP2PType=1;RMPcieP2PType=0"
dir.path(),
&dir.path().join("missing-params"),
&dir.path().join("missing-cmdline"),
+ || panic!("RoCE discovery must be skipped on this host"),
);
assert!(report.ok);
assert!(!report.pcie_tp_checks_required);
@@ -1933,7 +2013,9 @@ RegistryDwords: "ForceP2P=0x01;RMForceP2PType=1;RMPcieP2PType=0"
interconnect: Interconnect::Pcie,
notes: Vec::new(),
};
- let report = evaluate_linux_host(pcie_probe, dir.path(), ¶ms, &cmdline);
+ let report = evaluate_linux_host(pcie_probe, dir.path(), ¶ms, &cmdline, || {
+ panic!("RoCE discovery must be skipped on this host")
+ });
assert!(!report.ok);
let plain = render(&report, Canvas::sized(100, false));
assert!(plain.contains("Flare doctor"), "{plain}");
diff --git a/flare-cli/src/doctor/spark.rs b/flare-cli/src/doctor/spark.rs
new file mode 100644
index 000000000..16a9cb2a1
--- /dev/null
+++ b/flare-cli/src/doctor/spark.rs
@@ -0,0 +1,524 @@
+/*
+ * SPDX-FileCopyrightText: Copyright (c) 2026 Flare community contributors
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+use std::{fs, io, net::Ipv4Addr, path::Path};
+
+use flare_helios::{
+ core::naming::platform_from_pci,
+ execution::roce_fabric::{Fabric, ipv4_subnet_mask, link_local, port1_active},
+};
+
+use super::{Check, CheckStatus, parse_u64_param};
+
+const CONNECTX_7: u32 = 0x1021_15b3;
+// NVIDIA's Spark setup guide uses MTU 9000 for a direct pair and 1500 for rings
+// and switches. Set this to Some(9000) only after qualifying the intended fabric.
+const PREFERRED_MTU: Option = None;
+
+fn pci_id(device: &Path) -> Option {
+ let read_id = |name| u16::try_from(parse_u64_param(&read(&device.join(name))?)?).ok();
+ // NVML packs the device ID in the upper half and the vendor ID in the lower half.
+ Some((u32::from(read_id("device")?) << 16) | u32::from(read_id("vendor")?))
+}
+
+fn read(file: &Path) -> Option {
+ fs::read_to_string(file).ok().map(|s| s.trim().to_owned())
+}
+
+pub(super) fn check_host(
+ sysfs: &Path,
+ discover: impl FnOnce() -> flare_helios::Result,
+) -> Option {
+ let mut gb10 = false;
+ let mut cx7 = false;
+ for id in fs::read_dir(sysfs.join("bus/pci/devices"))
+ .ok()?
+ .filter_map(Result::ok)
+ .filter_map(|device| pci_id(&device.path()))
+ {
+ gb10 |= platform_from_pci(id) == Some("gb10");
+ cx7 |= id == CONNECTX_7;
+ }
+ if !gb10 {
+ return None;
+ }
+ if !cx7 {
+ return Some(result(
+ CheckStatus::NotApplicable,
+ Some("No ConnectX-7 PCI device".into()),
+ "This host has no ConnectX-7 adapter.".into(),
+ None,
+ ));
+ }
+ Some(check_fabric(sysfs, discover))
+}
+
+fn check_fabric(sysfs: &Path, discover: impl FnOnce() -> flare_helios::Result) -> Check {
+ match inspect(sysfs, discover) {
+ Ok(outcome) => outcome,
+ Err(error) => result(
+ CheckStatus::Unverified,
+ Some("RDMA device list unreadable".into()),
+ format!("Could not list RDMA devices in /sys/class/infiniband: {error}."),
+ Some("Check access to /sys/class/infiniband on this host."),
+ ),
+ }
+}
+
+fn result(
+ status: CheckStatus,
+ actual: Option,
+ detail: String,
+ remediation: Option<&str>,
+) -> Check {
+ Check {
+ id: "spark.cx7".into(),
+ name: "ConnectX-7 fabric".into(),
+ status,
+ expected: Some(
+ "An active ConnectX-7 link with an assigned IPv4 address and a RoCEv2 GID".into(),
+ ),
+ actual,
+ detail,
+ remediation: remediation.map(str::to_owned),
+ }
+}
+
+fn inspect(
+ sysfs: &Path,
+ discover: impl FnOnce() -> flare_helios::Result,
+) -> io::Result {
+ let root = sysfs.join("class/infiniband");
+ let mut devices = match fs::read_dir(&root) {
+ Ok(entries) => entries.collect::>>()?,
+ Err(error) if error.kind() == io::ErrorKind::NotFound => Vec::new(),
+ Err(error) => return Err(error),
+ };
+ devices.retain(|device| pci_id(&device.path().join("device")) == Some(CONNECTX_7));
+ devices.sort_by_key(|device| device.file_name());
+ if devices.is_empty() {
+ return Ok(result(
+ CheckStatus::Warn,
+ Some("No ConnectX-7 RDMA devices".into()),
+ "ConnectX-7 is present on PCI, but the kernel exposes no CX7 RDMA devices.".into(),
+ Some(
+ "Check that the ConnectX-7 adapter is visible and the mlx5 RDMA driver is loaded.",
+ ),
+ ));
+ }
+
+ let mut active = Vec::new();
+ let mut unreadable = Vec::new();
+ for device in &devices {
+ let name = device.file_name().to_string_lossy().into_owned();
+ match port1_active(&device.path()) {
+ Ok(true) => active.push(name),
+ Ok(false) => {}
+ Err(_) => unreadable.push(name),
+ }
+ }
+ if active.is_empty() {
+ if !unreadable.is_empty() {
+ let names = unreadable.join(", ");
+ return Ok(result(
+ CheckStatus::Unverified,
+ Some(format!("Unreadable link state: {names}")),
+ format!("Could not read the link state for {names}."),
+ Some("Check the host's RDMA port state in /sys/class/infiniband."),
+ ));
+ }
+ let names: Vec<_> = devices
+ .iter()
+ .map(|device| device.file_name().to_string_lossy().into_owned())
+ .collect();
+ return Ok(result(
+ CheckStatus::Warn,
+ Some("No active ConnectX-7 links".into()),
+ format!(
+ "No active ConnectX-7 RDMA links ({}) for multi-host serving.",
+ names.join(", ")
+ ),
+ Some("Connect a CX7 port to a peer or switch and bring up its network interface."),
+ ));
+ }
+
+ // Use the same GID index and assigned-address verification as serving.
+ let fabric = discover();
+ let mut ready = Vec::new();
+ if let Ok(fabric) = &fabric {
+ let mut unresolved = Vec::new();
+ for endpoint in &fabric.endpoints {
+ // Serving discovers every RDMA adapter. This check covers ConnectX-7 devices.
+ if !active.contains(&endpoint.name) {
+ continue;
+ }
+ let Some((address, prefix)) = endpoint.ipv4 else {
+ unresolved.push(endpoint.name.as_str());
+ continue;
+ };
+ let netdev = root
+ .join(&endpoint.name)
+ .join(format!("ports/1/gid_attrs/ndevs/{}", fabric.gid_index));
+ let Some(interface) = read(&netdev) else {
+ unresolved.push(endpoint.name.as_str());
+ continue;
+ };
+ let mtu = read(&sysfs.join("class/net").join(&interface).join("mtu"))
+ .and_then(|mtu| mtu.parse().ok());
+ ready.push(Interface {
+ device: &endpoint.name,
+ interface,
+ address,
+ prefix,
+ mtu,
+ });
+ }
+ if !ready.is_empty() {
+ let listed = ready
+ .iter()
+ .map(Interface::describe)
+ .collect::>()
+ .join(", ");
+ let mut detail = format!(
+ "{} of {} active CX7 devices supply IPv4 endpoints for serving at RoCEv2 GID index {}: {listed}.",
+ ready.len(),
+ active.len(),
+ fabric.gid_index
+ );
+ let mut warnings = configuration_warnings(&ready);
+ if ready.iter().any(Interface::is_link_local) {
+ detail.push_str(" Link-local IPv4 requires an LLDP-confirmed direct peer.");
+ }
+ let unselected: Vec<_> = active
+ .iter()
+ .filter(|name| {
+ !fabric
+ .endpoints
+ .iter()
+ .any(|endpoint| &endpoint.name == *name)
+ })
+ .map(String::as_str)
+ .collect();
+ if !unselected.is_empty() {
+ detail.push_str(&format!(
+ " Serving discovery did not select {}.",
+ unselected.join(", ")
+ ));
+ }
+ if !unresolved.is_empty() {
+ warnings.push(format!(
+ "Could not resolve a local IPv4 address and prefix for {}.",
+ unresolved.join(", ")
+ ));
+ }
+ if !unreadable.is_empty() {
+ warnings.push(format!(
+ "Could not read the link state for {}.",
+ unreadable.join(", ")
+ ));
+ }
+ if warnings.is_empty() {
+ return Ok(result(CheckStatus::Pass, Some(listed), detail, None));
+ }
+ detail.push(' ');
+ detail.push_str(&warnings.join(" "));
+ return Ok(result(
+ CheckStatus::Warn,
+ Some(listed),
+ detail,
+ Some("Check IPv4 subnet and MTU settings against the intended peers and switch."),
+ ));
+ }
+ }
+
+ let reason = match fabric {
+ Err(error) => error.to_string(),
+ Ok(fabric) => format!(
+ "discovery could not verify a local IPv4 address and prefix on a ConnectX-7 device at RoCEv2 GID index {}",
+ fabric.gid_index
+ ),
+ };
+ Ok(result(
+ CheckStatus::Warn,
+ Some("No usable ConnectX-7 IPv4 endpoint".into()),
+ format!("Active ConnectX-7 links ({}): {reason}.", active.join(", ")),
+ Some(
+ "Check the IPv4 addresses, prefixes, and RoCEv2 GID entries on the ConnectX-7 interfaces.",
+ ),
+ ))
+}
+
+struct Interface<'a> {
+ device: &'a str,
+ interface: String,
+ address: Ipv4Addr,
+ prefix: u8,
+ mtu: Option,
+}
+
+impl Interface<'_> {
+ fn is_link_local(&self) -> bool {
+ link_local((u32::from(self.address), self.prefix))
+ }
+
+ fn describe(&self) -> String {
+ let mtu = self
+ .mtu
+ .map_or_else(String::new, |mtu| format!(", MTU {mtu}"));
+ format!(
+ "{} ({}, {}/{}{mtu})",
+ self.device, self.interface, self.address, self.prefix
+ )
+ }
+}
+
+fn configuration_warnings(ports: &[Interface<'_>]) -> Vec {
+ let mut warnings = Vec::new();
+ for (i, port) in ports.iter().enumerate() {
+ let name = &port.interface;
+ let address = u32::from(port.address);
+ let host_bits = !ipv4_subnet_mask(port.prefix);
+ let host = address & host_bits;
+ if matches!(port.prefix, 0 | 32) || (port.prefix < 31 && (host == 0 || host == host_bits)) {
+ warnings.push(format!(
+ "Review {name}'s IPv4 subnet ({}/{}).",
+ port.address, port.prefix
+ ));
+ }
+
+ match (port.mtu, PREFERRED_MTU) {
+ (Some(mtu), Some(preferred)) if mtu < preferred => {
+ warnings.push(format!(
+ "{name}'s MTU {mtu} is below the preferred {preferred}. A larger MTU can reduce packet overhead when the full path supports it."
+ ));
+ }
+ (None, _) => warnings.push(format!("Could not read the MTU for {name}.")),
+ _ => {}
+ }
+
+ for other in &ports[..i] {
+ if port.interface == other.interface || (port.is_link_local() && other.is_link_local())
+ {
+ continue;
+ }
+ let mask = ipv4_subnet_mask(port.prefix.min(other.prefix));
+ if address & mask == u32::from(other.address) & mask {
+ warnings.push(format!(
+ "IPv4 subnets overlap on {} and {name}.",
+ other.interface
+ ));
+ }
+ }
+ }
+ warnings
+}
+
+#[cfg(all(test, target_os = "linux"))]
+mod tests {
+ use super::*;
+ use crate::doctor::{GpuProbe, Interconnect, Report, evaluate_linux_host, render};
+ use crate::inspect::Canvas;
+ use flare_helios::execution::roce_fabric;
+
+ fn write(root: &Path, path: &str, content: &str) {
+ let file = root.join(path);
+ fs::create_dir_all(file.parent().unwrap()).unwrap();
+ fs::write(file, content).unwrap();
+ }
+
+ fn add_spark(sysfs: &Path) {
+ write(sysfs, "bus/pci/devices/000f:01:00.0/vendor", "0x10de\n");
+ write(sysfs, "bus/pci/devices/000f:01:00.0/device", "0x2e12\n");
+ write(sysfs, "bus/pci/devices/0000:01:00.0/vendor", "0x15b3\n");
+ write(sysfs, "bus/pci/devices/0000:01:00.0/device", "0x1021\n");
+ }
+
+ fn report(sysfs: &Path, prefix: impl Fn(&str, Ipv4Addr) -> Option) -> Report {
+ evaluate_linux_host(
+ GpuProbe {
+ gpus: Vec::new(),
+ interconnect: Interconnect::SingleGpu,
+ notes: Vec::new(),
+ },
+ sysfs,
+ &sysfs.join("params"),
+ &sysfs.join("cmdline"),
+ || {
+ roce_fabric::discover_in(&sysfs.join("class/infiniband"), prefix, |_| {
+ Default::default()
+ })
+ },
+ )
+ }
+
+ fn cx7(report: &Report) -> &Check {
+ report
+ .checks
+ .iter()
+ .find(|check| check.id == "spark.cx7")
+ .unwrap()
+ }
+
+ #[test]
+ fn cx7_readiness_requires_a_live_ipv4_address_at_the_serving_gid_index() {
+ let dir = tempfile::tempdir().unwrap();
+ let sysfs = dir.path();
+ add_spark(sysfs);
+ let no_driver = report(sysfs, |_, _| None);
+ assert!(no_driver.ok);
+ assert_eq!(cx7(&no_driver).status, CheckStatus::Warn);
+ assert!(
+ cx7(&no_driver)
+ .detail
+ .contains("kernel exposes no CX7 RDMA devices")
+ );
+ assert!(render(&no_driver, Canvas::sized(100, false)).contains("1 warning,"));
+
+ let root = sysfs.join("class/infiniband");
+ let port = root.join("roce0/ports/1");
+ write(&root, "roce0/device/vendor", "0x15b3\n");
+ write(&root, "roce0/device/device", "0x1021\n");
+ write(&root, "roce1/device/vendor", "0x15b3\n");
+ write(&root, "roce1/device/device", "0x1021\n");
+ write(&root, "roce1/ports/1/state", "1: DOWN\n");
+ write(&port, "state", "1: DOWN\n");
+ let no_links = report(sysfs, |_, _| None);
+ assert!(no_links.ok);
+ assert_eq!(cx7(&no_links).status, CheckStatus::Warn);
+ assert!(
+ cx7(&no_links)
+ .detail
+ .contains("No active ConnectX-7 RDMA links")
+ );
+ write(&port, "state", "4: ACTIVE\n");
+ write(&port, "gid_attrs/ndevs/3", "enp1s0f0np0\n");
+ write(&port, "gids/3", "0000:0000:0000:0000:0000:ffff:c0a8:0b02\n");
+ write(sysfs, "class/net/enp1s0f0np0/mtu", "9000\n");
+
+ let inspect = |has_ip| {
+ report(sysfs, |netdev, addr| {
+ (has_ip && netdev == "enp1s0f0np0" && addr.octets() == [192, 168, 11, 2])
+ .then_some(24)
+ })
+ };
+ write(&port, "gid_attrs/types/3", "RoCE v1\n");
+ assert_eq!(cx7(&inspect(true)).status, CheckStatus::Warn);
+ write(&port, "gid_attrs/types/3", "RoCE v2\n");
+ assert_eq!(cx7(&inspect(false)).status, CheckStatus::Warn);
+ let report = inspect(true);
+ let ready = cx7(&report);
+ assert!(report.ok);
+ assert_eq!(ready.status, CheckStatus::Pass, "{}", ready.detail);
+ assert!(
+ ready
+ .actual
+ .as_deref()
+ .unwrap()
+ .contains("enp1s0f0np0, 192.168.11.2/24, MTU 9000")
+ );
+ write(sysfs, "class/net/enp1s0f0np0/mtu", "1500\n");
+ let standard_mtu = inspect(true);
+ assert!(standard_mtu.ok);
+ assert_eq!(cx7(&standard_mtu).status, CheckStatus::Pass);
+ assert!(cx7(&standard_mtu).detail.contains("MTU 1500"));
+ fs::remove_file(sysfs.join("class/net/enp1s0f0np0/mtu")).unwrap();
+ let unreadable_mtu = inspect(true);
+ assert_eq!(cx7(&unreadable_mtu).status, CheckStatus::Warn);
+ assert!(
+ cx7(&unreadable_mtu)
+ .detail
+ .contains("Could not read the MTU")
+ );
+ fs::remove_file(port.join("state")).unwrap();
+ let unreadable_link = inspect(true);
+ assert!(!unreadable_link.all_verified);
+ assert_eq!(cx7(&unreadable_link).status, CheckStatus::Unverified);
+ }
+
+ #[test]
+ fn cx7_preflight_reports_unselected_devices_and_unresolved_prefixes() {
+ let dir = tempfile::tempdir().unwrap();
+ let sysfs = dir.path();
+ add_spark(sysfs);
+ for i in 0..3 {
+ let device = sysfs.join(format!("class/infiniband/roce{i}"));
+ write(&device, "device/vendor", "0x15b3\n");
+ write(&device, "device/device", "0x1021\n");
+ write(&device, "ports/1/state", "4: ACTIVE\n");
+ if i == 2 {
+ continue;
+ }
+ write(&device, "ports/1/gid_attrs/types/3", "RoCE v2\n");
+ write(&device, "ports/1/gid_attrs/ndevs/3", &format!("eth{i}\n"));
+ write(
+ &device,
+ "ports/1/gids/3",
+ &format!("0000:0000:0000:0000:0000:ffff:c0a8:{i:02x}02\n"),
+ );
+ write(sysfs, &format!("class/net/eth{i}/mtu"), "9000\n");
+ }
+ let ready = report(sysfs, |_, _| Some(24));
+ let check = cx7(&ready);
+ assert_eq!(check.status, CheckStatus::Pass, "{}", check.detail);
+ assert!(check.detail.contains("2 of 3 active CX7 devices"));
+ assert!(
+ check
+ .detail
+ .contains("Serving discovery did not select roce2.")
+ );
+
+ let unresolved = report(sysfs, |netdev, _| (netdev == "eth0").then_some(24));
+ assert!(unresolved.ok);
+ let check = cx7(&unresolved);
+ assert_eq!(check.status, CheckStatus::Warn, "{}", check.detail);
+ assert!(
+ check
+ .detail
+ .contains("Serving discovery did not select roce2.")
+ );
+ assert!(
+ check
+ .detail
+ .contains("Could not resolve a local IPv4 address and prefix for roce1.")
+ );
+ }
+
+ #[test]
+ fn cx7_subnets_accept_point_to_point_prefixes_and_flag_overlap() {
+ let mut interfaces = [
+ Interface {
+ device: "roce0",
+ interface: "enp1s0f0np0".into(),
+ address: Ipv4Addr::new(192, 168, 0, 0),
+ prefix: 31,
+ mtu: Some(9000),
+ },
+ Interface {
+ device: "roce1",
+ interface: "enp1s0f1np1".into(),
+ address: Ipv4Addr::new(192, 168, 1, 15),
+ prefix: 24,
+ mtu: Some(9000),
+ },
+ ];
+ assert!(configuration_warnings(&interfaces).is_empty());
+ interfaces[1].address = Ipv4Addr::new(192, 168, 0, 15);
+ assert!(
+ configuration_warnings(&interfaces)
+ .join(" ")
+ .contains("subnets overlap")
+ );
+ interfaces[1].prefix = 32;
+ assert!(
+ configuration_warnings(&interfaces)
+ .join(" ")
+ .contains("192.168.0.15/32")
+ );
+ interfaces[0].address = Ipv4Addr::new(169, 254, 1, 2);
+ interfaces[1].address = Ipv4Addr::new(169, 254, 2, 2);
+ interfaces.iter_mut().for_each(|port| port.prefix = 16);
+ assert!(configuration_warnings(&interfaces).is_empty());
+ }
+}
diff --git a/flare-cli/src/orbit/controller.rs b/flare-cli/src/orbit/controller.rs
index f6e1f5afa..75ac6f13f 100644
--- a/flare-cli/src/orbit/controller.rs
+++ b/flare-cli/src/orbit/controller.rs
@@ -2290,8 +2290,9 @@ fn describe(
.ok_or("the core path names no file")?
.to_owned();
let cluster = runtime_core::core_cluster(authorized);
+ let hardware = authorized.identity().map_err(|e| e.to_string())?.hardware;
let needs = CoreNeeds {
- revision: super::gpu::capability_revision(first.architecture[0], first.architecture[1]),
+ revision: super::gpu::core_revision(&hardware, first.architecture[0], first.architecture[1]),
multi_host: cluster.is_some(),
rank_bytes: rank_needs.iter().map(|r| r.device_bytes).collect(),
reserve_bytes: runtime_core::reserve_bytes(authorized),
diff --git a/flare-cli/src/orbit/gpu.rs b/flare-cli/src/orbit/gpu.rs
index aed8197a5..64bf76415 100644
--- a/flare-cli/src/orbit/gpu.rs
+++ b/flare-cli/src/orbit/gpu.rs
@@ -35,7 +35,7 @@ pub struct Gpu {
pub uuid: String,
/// Product name, such as `NVIDIA GB300`.
pub name: String,
- /// Flare hardware revision: `gb10`, `gb202`, `gb300`, or `sm{major}{minor}` for any other
+ /// Flare hardware revision: a `PLATFORMS` name, or `sm{major}{minor}` for an unlisted
/// compute capability.
pub revision: String,
/// Device memory in bytes. NVML reports no device memory for an integrated GPU that shares
@@ -218,11 +218,17 @@ pub fn enumerate() -> Result, Failure> {
}
}
-/// The Flare hardware revision of a compute capability: `gb10`, `gb202`, `gb300`, or
-/// `sm{major}{minor}`.
+/// The Flare hardware revision of a compute capability, for devices the PCI table does not list
+/// and cores that record no device identity.
pub fn capability_revision(major: i32, minor: i32) -> String {
+ if major > 0
+ && minor >= 0
+ && let Some(platform) =
+ flare_helios::core::naming::platform_from_capability(major as u32, minor as u32)
+ {
+ return platform.into();
+ }
match (major, minor) {
- (8, 7) => "ga10b".into(),
(12, 1) => "gb10".into(),
(12, 0) => "gb202".into(),
(10, 3) => "gb300".into(),
@@ -230,6 +236,16 @@ pub fn capability_revision(major: i32, minor: i32) -> String {
}
}
+/// The revision a core requires of its GPUs: the platform recorded in its signed device identity
+/// when that is one Flare names, otherwise the capability of the architecture it was prepared for
+/// (legacy cores record no device identity).
+pub fn core_revision(hardware: &str, major: i32, minor: i32) -> String {
+ if flare_helios::core::naming::PLATFORMS.contains(&hardware) {
+ return hardware.to_owned();
+ }
+ capability_revision(major, minor)
+}
+
/// The `CUDA_VISIBLE_DEVICES` value that exposes exactly `uuids`, in that order.
pub fn visible_devices(uuids: &[String]) -> String {
uuids.join(",")
@@ -295,25 +311,9 @@ fn text(buffer: &[u8]) -> String {
}
fn revision(pci_device_id: u32, major: c_int, minor: c_int) -> String {
- if let Some(revision) = platform(pci_device_id) {
- return revision.into();
- }
- capability_revision(major, minor)
-}
-
-/// The PCI ID table of `crate::hardware`, which selects a revision before compute capability.
-fn platform(pci_id: u32) -> Option<&'static str> {
- if pci_id & 0xffff != 0x10de {
- return None;
- }
- match pci_id >> 16 {
- device if flare_helios::core::naming::GB300_DEVICES.contains(&device) => Some("gb300"),
- 0x2e12 => Some("gb10"),
- 0x2b85 | 0x2b87 | 0x2b8c | 0x2bb1 | 0x2bb2 | 0x2bb3 | 0x2bb4 | 0x2bb5 | 0x2bb9 | 0x2bbc => {
- Some("gb202")
- }
- _ => None,
- }
+ flare_helios::core::naming::platform_from_pci(pci_device_id)
+ .map(str::to_owned)
+ .unwrap_or_else(|| capability_revision(major, minor))
}
/// Total and available host memory in bytes, which an integrated GPU allocates from.
@@ -347,19 +347,38 @@ mod tests {
assert_eq!(revision(0x31c210de, 9, 9), "gb300");
assert_eq!(revision(0x31c310de, 9, 9), "gb300");
assert_eq!(revision(0x2e1210de, 12, 1), "gb10");
+ assert_eq!(revision(0x2e1310de, 12, 1), "gb10");
assert_eq!(revision(0x2bb410de, 12, 0), "gb202");
assert_eq!(revision(0x2b8510de, 9, 9), "gb202");
+ assert_eq!(revision(0x2c3110de, 12, 0), "gb203");
+ assert_eq!(revision(0x290110de, 10, 0), "gb100");
+ assert_eq!(revision(0x220410de, 8, 6), "ga102");
+ assert_eq!(revision(0x248410de, 8, 6), "ga104");
}
#[test]
fn unknown_pci_ids_fall_back_to_compute_capability() {
assert_eq!(revision(0x31c410de, 10, 3), "gb300");
assert_eq!(revision(0x31c21234, 9, 0), "sm90");
- assert_eq!(revision(0x2e1310de, 12, 1), "gb10");
+ assert_eq!(revision(0x2e0710de, 12, 1), "gb10");
assert_eq!(revision(0x2c0010de, 12, 0), "gb202");
assert_eq!(revision(0x2bb41234, 9, 0), "sm90");
assert_eq!(revision(0x233010de, 9, 0), "sm90");
- assert_eq!(revision(0x290110de, 10, 0), "sm100");
+ assert_eq!(revision(0x29ff10de, 10, 0), "sm100");
+ assert_eq!(revision(0, 8, 7), "ga10b");
+ assert_eq!(revision(0, 11, 0), "gb10b");
+ assert_eq!(revision(0x24ff10de, 8, 6), "sm86");
+ }
+
+ #[test]
+ fn a_core_requires_the_revision_its_device_identity_records() {
+ // Compute capability 12.0 covers several dies, so the signed identity decides.
+ assert_eq!(core_revision("gb203", 12, 0), "gb203");
+ assert_eq!(core_revision("ga104", 8, 6), "ga104");
+ // A legacy core records no device identity and keeps the capability fallback.
+ assert_eq!(core_revision("", 12, 0), "gb202");
+ assert_eq!(core_revision("", 11, 0), "gb10b");
+ assert_eq!(core_revision("sm120", 9, 0), "sm90");
}
#[test]
diff --git a/flare-cli/src/orbit/plan.rs b/flare-cli/src/orbit/plan.rs
index df667c840..b365be00a 100644
--- a/flare-cli/src/orbit/plan.rs
+++ b/flare-cli/src/orbit/plan.rs
@@ -35,8 +35,8 @@ const GIB: f64 = (1u64 << 30) as f64;
/// What a core needs from the pool.
#[derive(Clone, Debug)]
pub struct Needs {
- /// The hardware revision every GPU of the group must have: `gb10`, `gb202`, `gb300`, or
- /// `sm{major}{minor}`.
+ /// The hardware revision every GPU of the group must have: a `PLATFORMS` name, or
+ /// `sm{major}{minor}` for a core that records no device identity.
pub revision: String,
/// True for a multi-host core: one node per rank, one GPU each. False for a single-host
/// tensor-parallel core: one node with one GPU per rank, run as one process.
diff --git a/flare-winui/Dashboard.inl b/flare-winui/Dashboard.inl
index 3f2126d4c..8e0270c1c 100644
--- a/flare-winui/Dashboard.inl
+++ b/flare-winui/Dashboard.inl
@@ -24,7 +24,7 @@
StackPanel info;info.Spacing(5);Grid::SetColumn(info,1);info.VerticalAlignment(VerticalAlignment::Center);
if(model.recommended())info.Children().Append(recommendation_badge());
auto name=label(model.name,15);name.MaxLines(2);name.FontWeight(Windows::UI::Text::FontWeights::SemiBold());info.Children().Append(name);
- auto metadata=model.available()?(model.size_known?bytes(model.size)+L" · ":L"")+(model.flags&FLARE_MODEL_LOCAL?L"Downloaded":L"On this PC"):L"";
+ auto metadata=model.available()?(model.size_known?bytes(model.size)+L" · ":L"")+(model.previous()?L"Previous Version":model.flags&FLARE_MODEL_LOCAL?L"Downloaded":L"On this PC"):L"";
if(!model.available()&&(model.metadata_known&FLARE_MODEL_REVISION_SIZE))metadata=bytes(model.revision_bytes)+L" repository files";
if(!model.revision_updated_at.empty())metadata+=(metadata.empty()?L"":L" · ")+std::wstring(L"Hub updated ")+updated_text(model.revision_updated_at,true);
if(!model.error.empty())metadata=L"Needs attention";
@@ -34,16 +34,20 @@
Button use;use.Content(box_value(model.flags&FLARE_MODEL_ACTIVE?L"In use":model.available()?L"Run model":home_inventory_pending_?L"Checking…":L"Download"));use.Style(control