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),