From fb784c96987f148ce91879ac61e11f1e3c8ce6c7 Mon Sep 17 00:00:00 2001 From: Alexander Korolev Date: Sun, 22 Nov 2026 21:54:28 +0100 Subject: [PATCH] core: give GB203 its own platform identifier `ignition export` on an RTX PRO 4500 Blackwell (GB203GL, `10de:2c31`) reaches "Materialize weight payloads" and then fails with RuntimeError: NVML reports unsupported GPU PCI id 0x2c3110de because `platform_from_pci` returns None for a device outside these tables and `current_platform` in heliopause's capture turns that into a hard error. `flare run` refuses the same card for the same reason. The platform string is the revision that selects a prepared core, so it has to name the hardware variant the artifacts were prepared on. GB203 is a separate die from GB202 with 82 streaming multiprocessors and 32 GB of memory against 188 and 96 GB, and preparation records the device in the published core's signed `hardware_identity`, which selects that core's revision. One `gb202` revision for both dies would let a GB203 host download cores prepared on GB202 hardware. This adds `GB203_DEVICES` (`0x2c31`) and `gb203` to `PLATFORMS`, so export names the card `gb203-tp-`, and `platform_from_pci` becomes the single table for detection, export naming, and the agent's reported revision. `flare-cli` resolves a device's revision through that table instead of a second copy of it, which is why the CLI named this card `gb202` through its capability-12.0 fallback while export rejected it. The copy had drifted in both directions: it omitted `0x2c31` and four of the five GB10 identifiers, and it listed `0x2bbc` (RTX PRO 6000D Blackwell Max-Q), which `GB202_DEVICES` does not. GA102 devices now report `ga102` from the table instead of `sm86` from the capability fallback. Orbit placement follows. `describe` took a core's required revision from its rank architecture, so after this change a GB203 core would require `gb202` while its host reports `gb203`, and no core of either case would place; GA102 hosts would likewise have regressed. A core's requirement now comes from its signed device identity when that is a `PLATFORMS` name, and the capability fallback covers legacy cores that record no identity. `capability_revision` therefore also maps compute capability 8.6 to `ga102`, matching the table that lists those devices. Validation, rebased onto `c915b5f0`: `helios` with `--features runtime-core,server` (1626 passed, 0 failed), `flare` (228 passed), and `flare-cli` (198 passed) all pass with the `FLARE_TEST_TEMPLATE_DIR` fixtures and `LimitMEMLOCK=infinity` that CI uses. `published_build_match_uses_all_platform_branches` keeps two platform names that share a prefix apart (`gb202` against `gb203-tp1`) without a per-platform fixture; `pci_ids_select_the_platform_identifier` asserts `0x2c31` literally; `a_core_requires_the_revision_its_device_identity_records` covers GB203, GA102, and the legacy fallback. On the card, `flare hardware-revision 1` reports `gb203`, where the build without this change reports `gb202`; a full Inkling 2 Mini preparation completes, and the core it wrote loads and serves under this build with 3920 KV pages, 501,760 KV tokens, and a matching chat completion. Only `0x2c31` hardware was available; the other identifiers were not exercised. No `gb203` revision is published on any repository yet, so `flare run ORG/MODEL` on this card requests a branch that does not exist until one is published; `--revision gb202` remains the explicit override. Design-Signed-Off-By: pi agent (deepseek-v4.1-flash); design-review=eb2f Signed-off-by: Alexander Korolev --- docs/cli-design.md | 19 +++++----- docs/core-format-design.md | 4 +-- docs/orbit.md | 5 +-- flare-cli/src/cli.rs | 3 +- flare-cli/src/orbit/controller.rs | 3 +- flare-cli/src/orbit/gpu.rs | 60 ++++++++++++++++--------------- flare-cli/src/orbit/plan.rs | 4 +-- flare/src/catalog.rs | 19 ++++++---- helios/src/core/naming.rs | 23 +++++++++--- 9 files changed, 84 insertions(+), 56 deletions(-) diff --git a/docs/cli-design.md b/docs/cli-design.md index 6d4e22e5b..3977b44bc 100644 --- a/docs/cli-design.md +++ b/docs/cli-design.md @@ -885,10 +885,12 @@ 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 `ga102`, `gb10`, `gb202`, `gb203`, 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`; known GB203 devices, including RTX PRO 4500 Blackwell, select `gb203`; GB300 +selects `gb300`; known GA102 devices select `ga102`. All selected GPUs must belong to the same +family. 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 @@ -899,9 +901,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 a detected platform revision that begins `gb` (`gb10`, `gb202`, +`gb203`, `gb300`), the shared CLI and desktop downloader tries the corresponding +`-tp1` revision if the initial revision lookup returns HTTP 404; `ga102` is 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 @@ -921,7 +924,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 `ga102`, `gb10`, `gb202`, `gb203`, or `gb300` | | `--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 | diff --git a/docs/core-format-design.md b/docs/core-format-design.md index 8582e4a11..a6d9d1e6b 100644 --- a/docs/core-format-design.md +++ b/docs/core-format-design.md @@ -750,8 +750,8 @@ 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 device identifier recorded by preparation (`ga102`, `gb10`, `gb202`, +`gb203`, or `gb300`), 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/orbit.md b/docs/orbit.md index 9c331b063..36a09b0ee 100644 --- a/docs/orbit.md +++ b/docs/orbit.md @@ -318,8 +318,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 (`ga102`, `gb10`, `gb202`, `gb203`, `gb300` from the PCI device id, or +`sm{major}{minor}` for a compute capability that names no platform), 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/flare-cli/src/cli.rs b/flare-cli/src/cli.rs index 02d81c76b..b647d5230 100644 --- a/flare-cli/src/cli.rs +++ b/flare-cli/src/cli.rs @@ -199,7 +199,8 @@ 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 ga102, gb10, gb202, + /// gb203, or gb300. #[arg(long, value_name = "REVISION", help_heading = "Download options")] pub revision: Option, 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 620cca123..ffecb6c50 100644 --- a/flare-cli/src/orbit/gpu.rs +++ b/flare-cli/src/orbit/gpu.rs @@ -35,8 +35,8 @@ 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 - /// compute capability. + /// Flare hardware revision: a `PLATFORMS` name, or `sm{major}{minor}` for a compute + /// capability that identifies no platform. pub revision: String, /// Device memory in bytes. NVML reports no device memory for an integrated GPU that shares /// host memory (GB10); this field then holds the host's `MemTotal`. @@ -219,17 +219,28 @@ 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 { match (major, minor) { (12, 1) => "gb10".into(), (12, 0) => "gb202".into(), (10, 3) => "gb300".into(), + (8, 6) => "ga102".into(), _ => format!("sm{major}{minor}"), } } +/// 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,30 +306,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(); - } - match (major, minor) { - (12, 1) => "gb10".into(), - (12, 0) => "gb202".into(), - (10, 3) => "gb300".into(), - _ => format!("sm{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. @@ -354,6 +344,8 @@ mod tests { assert_eq!(revision(0x2e1210de, 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(0x220410de, 8, 6), "ga102"); } #[test] @@ -367,6 +359,18 @@ mod tests { assert_eq!(revision(0x290110de, 10, 0), "sm100"); } + #[test] + fn a_core_requires_the_revision_its_device_identity_records() { + // Compute capability 12.0 covers both dies, so the signed identity decides. + assert_eq!(core_revision("gb203", 12, 0), "gb203"); + assert_eq!(core_revision("gb202", 12, 0), "gb202"); + assert_eq!(core_revision("ga102", 8, 6), "ga102"); + // A legacy core records no device identity and keeps the capability fallback. + assert_eq!(core_revision("", 12, 0), "gb202"); + assert_eq!(core_revision("", 8, 6), "ga102"); + assert_eq!(core_revision("sm120", 9, 0), "sm90"); + } + #[test] fn visible_devices_lists_uuids_in_order() { let uuids = ["GPU-b".to_string(), "GPU-a".to_string()]; 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/src/catalog.rs b/flare/src/catalog.rs index adeff0329..90ac5d877 100644 --- a/flare/src/catalog.rs +++ b/flare/src/catalog.rs @@ -558,14 +558,19 @@ mod tests { assert_eq!(entry.build_target_match, Some(target == published)); } } - let refs = serde_json::from_value(json!({"branches": [ - {"name": "ga102-tp1"}, {"name": "gb10-tp1"}, {"name": "gb202"}, {"name": "gb300-tp8"} - ]})).unwrap(); - let mut entry = CatalogEntry::default(); - let branches = apply_refs(&mut entry, refs, Some(target)); - assert_eq!(entry.build_target_match, Some(true)); - assert_eq!(branch_platform(select_revision(&branches, Some(target)).unwrap()), Some(target)); } + // Two platforms whose names share a prefix must still select apart, so no + // per-platform fixture is needed as the table grows. + let branches = ["gb202", "gb203-tp1"].map(String::from).into_iter().collect(); + assert_eq!( + select_revision(&branches, Some("gb203")).map(String::as_str), + Some("gb203-tp1") + ); + assert_eq!( + select_revision(&branches, Some("gb202")).map(String::as_str), + Some("gb202") + ); + assert_eq!(branch_platform("gb203-tp1"), Some("gb203")); } #[test] fn unknown_builds_or_hardware_do_not_hide_discovery_entries() { diff --git a/helios/src/core/naming.rs b/helios/src/core/naming.rs index 109557032..57e01c264 100644 --- a/helios/src/core/naming.rs +++ b/helios/src/core/naming.rs @@ -12,16 +12,20 @@ use std::time::{SystemTime, UNIX_EPOCH}; /// Platforms a core may be named for. These are the NVIDIA device /// identifiers Flare already uses for revisions, not SM architecture names. -pub const PLATFORMS: [&str; 4] = ["ga102", "gb10", "gb202", "gb300"]; +pub const PLATFORMS: [&str; 5] = ["ga102", "gb10", "gb202", "gb203", "gb300"]; -/// Platform for one NVIDIA PCI id in NVML's `device<<16 | vendor` layout. -/// -/// This table is the single source consumed by Flare's device detection and by -/// core export naming; do not duplicate the identifiers elsewhere. +/// GB202 device identifiers for the SM120 platform. pub const GB202_DEVICES: [u32; 9] = [ 0x2b85, 0x2b87, 0x2b8c, 0x2bb1, 0x2bb2, 0x2bb3, 0x2bb4, 0x2bb5, 0x2bb9, ]; +/// GB203 device identifiers for the SM120 platform: RTX PRO 4500 Blackwell. +/// +/// GB203 is a separate die from GB202 with fewer streaming multiprocessors and +/// less memory, so it is a separate hardware variant even though it shares +/// compute capability 12.0 and the SM120 programming model. +pub const GB203_DEVICES: [u32; 1] = [0x2c31]; + /// GB10 and RTX Spark N1X device identifiers for the SM121 platform. pub const GB10_DEVICES: [u32; 5] = [0x2e02, 0x2e03, 0x2e06, 0x2e12, 0x2e2a]; @@ -32,11 +36,19 @@ pub const GA102_DEVICES: [u32; 6] = [0x2203, 0x2204, 0x2206, 0x2208, 0x220a, 0x2 /// GB300 device identifiers. `0x31c3` is the SM103 GPU of DGX Station GB300. pub const GB300_DEVICES: [u32; 2] = [0x31c2, 0x31c3]; +/// Platform for one NVIDIA PCI id in NVML's `device<<16 | vendor` layout. +/// +/// These tables are the single source consumed by Flare's device detection, by +/// core export naming, and by the agent's reported revision; do not duplicate +/// the identifiers elsewhere. pub fn platform_from_pci(pci_id: u32) -> Option<&'static str> { if pci_id & 0xffff != 0x10de { return None; } let device = pci_id >> 16; + if GB203_DEVICES.contains(&device) { + return Some("gb203"); + } if GB10_DEVICES.contains(&device) { return Some("gb10"); } @@ -194,6 +206,7 @@ mod tests { "{device:#06x}" ); } + assert_eq!(platform_from_pci(0x2c31_10de), Some("gb203")); for device in GA102_DEVICES { assert_eq!( platform_from_pci(device << 16 | 0x10de),