GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(prism): rent 1x B200 on Lium 8x split hosts (#192) · CortexLM/cortex@689154f

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • crates
    • prism-lium-types/src
      • json.rs
      • types.rs
    • prism-lium/src
      • client.rs
      • sim.rs
    • prism-verda/src
      • lib.rs
  • docs
    • PRISM.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎crates/prism-lium-types/src/json.rs‎

Copy file name to clipboardExpand all lines: crates/prism-lium-types/src/json.rs
+16Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,25 @@ pub fn parse_one_offer(item: &Value) -> Option<Offer> {
5050
gpu_count,
5151
price_per_hour: price,
5252
provider: "lium".into(),
53+
min_gpu_count_for_rental: item.get("min_gpu_count_for_rental").and_then(as_u32),
54+
available_gpu_count: item.get("available_gpu_count").and_then(as_u32),
5355
})
5456
}
5557

58+
fn as_u32(v: &Value) -> Option<u32> {
59+
v.as_u64()
60+
.map(|n| n as u32)
61+
.or_else(|| v.as_f64().and_then(finite_u32))
62+
}
63+
64+
fn finite_u32(f: f64) -> Option<u32> {
65+
if f.is_finite() && f >= 0.0 && f <= f64::from(u32::MAX) {
66+
Some(f as u32)
67+
} else {
68+
None
69+
}
70+
}
71+
5672
/// Parse a `/pods/{id}` object.
5773
#[must_use]
5874
pub fn parse_instance(v: &Value, fallback_id: &str) -> Instance {
Collapse file

‎crates/prism-lium-types/src/types.rs‎

Copy file name to clipboardExpand all lines: crates/prism-lium-types/src/types.rs
+149-6Lines changed: 149 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,26 @@ pub struct Offer {
1717
pub price_per_hour: f64,
1818
/// Provider label.
1919
pub provider: String,
20+
/// Lium GPU-split floor (`min_gpu_count_for_rental`). `None` = omitted.
21+
#[serde(default)]
22+
pub min_gpu_count_for_rental: Option<u32>,
23+
/// Free GPUs on the host (`available_gpu_count`).
24+
#[serde(default)]
25+
pub available_gpu_count: Option<u32>,
26+
}
27+
28+
impl Default for Offer {
29+
fn default() -> Self {
30+
Self {
31+
id: String::new(),
32+
gpu_type: String::new(),
33+
gpu_count: 1,
34+
price_per_hour: f64::MAX,
35+
provider: "lium".into(),
36+
min_gpu_count_for_rental: None,
37+
available_gpu_count: None,
38+
}
39+
}
2040
}
2141

2242
/// Plausible discrete GPU counts on marketplace offers (not SKU numbers).
@@ -122,15 +142,50 @@ impl Offer {
122142
effective_gpu_count(self.gpu_count, &self.gpu_type) > 1
123143
}
124144

145+
/// Lium split: `min ≤ wanted ≤ available`.
146+
///
147+
/// Idle 8× B200 rows often omit `min_gpu_count_for_rental` while still
148+
/// listing `available_gpu_count` and `price_per_gpu`. Treat that as
149+
/// min=1 so a 1× pin can rent one card — never the whole 8-pack.
150+
/// Missing `available_gpu_count` means "do not infer split".
151+
#[must_use]
152+
pub fn allows_split_for(&self, wanted: u32) -> bool {
153+
if wanted == 0 {
154+
return false;
155+
}
156+
let Some(avail) = self.available_gpu_count else {
157+
return false;
158+
};
159+
if avail < wanted {
160+
return false;
161+
}
162+
self.min_gpu_count_for_rental.unwrap_or(1) <= wanted
163+
}
164+
165+
/// GPUs to send on `POST /executors/{id}/rent`.
166+
#[must_use]
167+
pub fn rent_count(&self, requested: u32) -> u32 {
168+
if self.allows_split_for(requested) {
169+
return requested.max(1);
170+
}
171+
let effective = effective_gpu_count(self.gpu_count, &self.gpu_type);
172+
if requested <= 1 {
173+
1
174+
} else {
175+
effective.max(requested)
176+
}
177+
}
178+
125179
/// Whether this offer may be rented for `requested` GPUs.
126180
///
127-
/// A 1-GPU request still hard-rejects multi-GPU hosts (live SKU pin).
128-
/// A multi-GPU request accepts a larger host (`effective >= requested`)
129-
/// when no exact-width offer is listed. Lium rejects GPU splitting, so the
130-
/// client rents `gpu_count = effective` (the whole host); the miner caps
131-
/// DDP at the requested width. 8×5090 is never a silent fallback.
181+
/// Accepts an exact-width host, a larger host when `requested > 1`, or a
182+
/// multi-GPU host that advertises (or omits-min) GPU splitting. A 1-GPU
183+
/// pin never takes a non-split 8× pack. 8×5090 is never a silent fallback.
132184
#[must_use]
133185
pub fn matches_gpu_count(&self, requested: u32) -> bool {
186+
if self.allows_split_for(requested) {
187+
return true;
188+
}
134189
let effective = effective_gpu_count(self.gpu_count, &self.gpu_type);
135190
if requested <= 1 {
136191
return effective == 1;
@@ -547,6 +602,7 @@ mod tests {
547602
gpu_count,
548603
price_per_hour: price,
549604
provider: "lium".into(),
605+
..Offer::default()
550606
};
551607
let pin = mk("1xb200", "NVIDIA B200", 1, 5.5);
552608
let eight = mk("8xb200", "NVIDIA B200", 8, 5.6);
@@ -561,13 +617,78 @@ mod tests {
561617
let mut offers = vec![eight.clone(), rtx.clone(), pro.clone(), pin.clone()];
562618
pref.filter_sort_offers(&mut offers, 1);
563619
let ids: Vec<&str> = offers.iter().map(|o| o.id.as_str()).collect();
564-
assert_eq!(ids, ["1xb200"], "exact 1× B200 only; never 5090 or 8× B200");
620+
assert_eq!(
621+
ids,
622+
["1xb200"],
623+
"exact 1× B200 only; never 5090 or unlabeled 8× B200"
624+
);
565625
assert!(pin.matches_gpu_count(1));
566626
assert!(!eight.matches_gpu_count(1));
567627
assert!(!pref.matches_pin(&rtx.gpu_type));
568628
assert!(!pref.matches_pin(&pro.gpu_type));
569629
}
570630

631+
#[test]
632+
fn one_gpu_b200_accepts_lium_split_and_idle_8x() {
633+
let native = Offer {
634+
id: "1xb200".into(),
635+
gpu_type: "NVIDIA B200".into(),
636+
gpu_count: 1,
637+
price_per_hour: 5.5,
638+
..Offer::default()
639+
};
640+
let split8 = Offer {
641+
id: "8xb200-split".into(),
642+
gpu_type: "NVIDIA B200".into(),
643+
gpu_count: 8,
644+
price_per_hour: 5.6,
645+
min_gpu_count_for_rental: Some(1),
646+
available_gpu_count: Some(4),
647+
..Offer::default()
648+
};
649+
let idle8 = Offer {
650+
id: "8xb200-idle".into(),
651+
gpu_type: "NVIDIA B200".into(),
652+
gpu_count: 8,
653+
price_per_hour: 5.85,
654+
available_gpu_count: Some(8),
655+
..Offer::default()
656+
};
657+
let whole8 = Offer {
658+
id: "8xb200-whole".into(),
659+
gpu_type: "NVIDIA B200".into(),
660+
gpu_count: 8,
661+
price_per_hour: 5.0,
662+
..Offer::default()
663+
};
664+
let min4 = Offer {
665+
id: "8xb200-min4".into(),
666+
gpu_type: "NVIDIA B200".into(),
667+
gpu_count: 8,
668+
price_per_hour: 5.1,
669+
min_gpu_count_for_rental: Some(4),
670+
available_gpu_count: Some(8),
671+
..Offer::default()
672+
};
673+
assert!(split8.allows_split_for(1));
674+
assert!(idle8.allows_split_for(1));
675+
assert_eq!(split8.rent_count(1), 1);
676+
assert_eq!(idle8.rent_count(1), 1);
677+
assert!(split8.matches_gpu_count(1));
678+
assert!(idle8.matches_gpu_count(1));
679+
assert!(!whole8.matches_gpu_count(1));
680+
assert!(!min4.matches_gpu_count(1));
681+
let pref = GpuPreference::profile_b200();
682+
let mut offers = vec![whole8, min4, idle8.clone(), split8.clone(), native.clone()];
683+
pref.filter_sort_offers(&mut offers, 1);
684+
let ids: Vec<&str> = offers.iter().map(|o| o.id.as_str()).collect();
685+
assert_eq!(
686+
ids,
687+
["1xb200", "8xb200-split", "8xb200-idle"],
688+
"native 1× first, then split/idle 8× rented as 1"
689+
);
690+
}
691+
571692
#[test]
572693
fn four_gpu_request_matches_only_four_gpu_offers() {
573694
let mk = |id: &str, gpu_type: &str, gpu_count: u32, price: f64| Offer {
@@ -576,6 +697,7 @@ mod tests {
576697
gpu_count,
577698
price_per_hour: price,
578699
provider: "lium".into(),
700+
..Offer::default()
579701
};
580702
let one = mk("1x", "NVIDIA GeForce RTX 5090", 1, 2.0);
581703
let four = mk("4x", "NVIDIA GeForce RTX 5090", 4, 1.0);
@@ -618,6 +740,7 @@ mod tests {
618740
gpu_count,
619741
price_per_hour: price,
620742
provider: "lium".into(),
743+
..Offer::default()
621744
};
622745
let two_6000 = mk(
623746
"2x6000",
@@ -655,20 +778,23 @@ mod tests {
655778
gpu_count: 1,
656779
price_per_hour: 2.0,
657780
provider: "lium".into(),
781+
..Offer::default()
658782
};
659783
let eight = Offer {
660784
id: "8x".into(),
661785
gpu_type: "NVIDIA GeForce RTX 5090".into(),
662786
gpu_count: 8,
663787
price_per_hour: 0.48,
664788
provider: "lium".into(),
789+
..Offer::default()
665790
};
666791
let eight_label = Offer {
667792
id: "8x-label".into(),
668793
gpu_type: "8x RTX 5090".into(),
669794
gpu_count: 1, // lying field; label wins
670795
price_per_hour: 0.48,
671796
provider: "lium".into(),
797+
..Offer::default()
672798
};
673799
assert!(single.matches_gpu_count(1));
674800
assert!(!eight.matches_gpu_count(1));
@@ -741,6 +867,23 @@ mod tests {
741867
assert!(v.telemetry.is_some());
742868
}
743869

870+
#[test]
871+
fn parse_live_idle_8x_b200_is_one_gpu_rent() {
872+
let v = serde_json::json!({
873+
"id": "cb5e952f-bcb4-46ff-b7ae-16fc0118b30a",
874+
"machine_name": "NVIDIA B200",
875+
"gpu_count": 8,
876+
"available_gpu_count": 8,
877+
"min_gpu_count_for_rental": null,
878+
"price_per_gpu": 5.85
879+
});
880+
let o = crate::parse_one_offer(&v).expect("offer");
881+
assert_eq!(o.gpu_type, "NVIDIA B200");
882+
assert!((o.price_per_hour - 5.85).abs() < 1e-9);
883+
assert!(o.matches_gpu_count(1));
884+
assert_eq!(o.rent_count(1), 1);
885+
}
886+
744887
#[test]
745888
fn remote_exec_result_v2_fields_default_absent() {
746889
// Mixed-version payloads (e.g. metrics_version set, other v2 keys
Collapse file

‎crates/prism-lium/src/client.rs‎

Copy file name to clipboardExpand all lines: crates/prism-lium/src/client.rs
+25-6Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -789,12 +789,9 @@ impl EvalJobBackend for LiumClient {
789789
}
790790
let effective =
791791
prism_lium_types::effective_gpu_count(selected.gpu_count, &selected.gpu_type);
792-
// 1-GPU rents 1; else whole host (no split). Never 8×5090 fallback.
793-
let rent_gpu_count = if spec.gpu_count <= 1 {
794-
1
795-
} else {
796-
effective.max(spec.gpu_count)
797-
};
792+
// Split hosts: requested width (1× B200 on an 8× node).
793+
// Non-split: 1-GPU stays 1; else whole host. Never 8×5090 fallback.
794+
let rent_gpu_count = selected.rent_count(spec.gpu_count);
798795
if pref.matches_pin("RTX 5090") && rent_gpu_count >= 8 && spec.gpu_count < 8 {
799796
return Err(LiumError::Api(format!(
800797
"abort: refusing {rent_gpu_count}× 5090 rent (no 8×5090 fallback)"
@@ -1296,6 +1293,28 @@ mod tests {
12961293
assert_eq!(inst.id, "pod-1x");
12971294
}
12981295

1296+
#[tokio::test]
1297+
async fn provision_rents_one_gpu_on_idle_8x_b200() {
1298+
let server = MockServer::start().await;
1299+
mount_common(
1300+
&server,
1301+
serde_json::json!([
1302+
{
1303+
"id": "eight-b200-idle",
1304+
"machine_name": "NVIDIA B200",
1305+
"gpu_count": 8,
1306+
"available_gpu_count": 8,
1307+
"price_per_gpu": 5.85
1308+
}
1309+
]),
1310+
)
1311+
.await;
1312+
mount_rent_path(&server, "eight-b200-idle", "pod-split-1").await;
1313+
let c = LiumClient::with_base_url("test-key", server.uri()).unwrap();
1314+
let inst = c.provision(&provision_spec()).await.unwrap();
1315+
assert_eq!(inst.id, "pod-split-1");
1316+
}
1317+
12991318
#[tokio::test]
13001319
async fn provision_rejects_all_multi_gpu_offers() {
13011320
let server = MockServer::start().await;
Collapse file

‎crates/prism-lium/src/sim.rs‎

Copy file name to clipboardExpand all lines: crates/prism-lium/src/sim.rs
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ impl EvalJobBackend for SimLiumBackend {
5252
gpu_count: 1,
5353
price_per_hour: price,
5454
provider: "sim".into(),
55+
..Offer::default()
5556
};
5657
let mut offers = vec![
5758
mk("sim-blackwell", "NVIDIA RTX BLACKWELL B200", 1.2),
Collapse file

‎crates/prism-verda/src/lib.rs‎

Copy file name to clipboardExpand all lines: crates/prism-verda/src/lib.rs
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,7 @@ impl EvalJobBackend for VerdaClient {
487487
gpu_count: 1,
488488
price_per_hour: 0.0,
489489
provider: "verda".into(),
490+
..Offer::default()
490491
})
491492
})
492493
.collect())
Collapse file

‎docs/PRISM.md‎

Copy file name to clipboardExpand all lines: docs/PRISM.md
+9-4Lines changed: 9 additions & 4 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -954,16 +954,21 @@ overridable Docker `CMD` so the provider bootstrap can run.
954954
**GPU profiles + netns contract.** Lium profiles, never mixed in one job:
955955

956956
1. **Default / 1B dense:** `PRISM_POD_GPU_COUNT=1` + name match **NVIDIA B200**
957-
(needles `B200`, `NVIDIA B200`). Exact 1× only — **do not** fall through to
958-
8× B200, 5090, or RTX PRO 6000. ~180–192 GB → dense-1b uses mb≥8,
957+
(needles `B200`, `NVIDIA B200`). Rent **one** GPU: a native 1× offer, or an
958+
8× B200 host that advertises Lium GPU splitting (`min_gpu_count_for_rental`
959+
≤ 1 ≤ `available_gpu_count`, or omitted `min` with `available ≥ 1` on idle
960+
hosts). Do **not** buy the whole 8-pack, and do **not** fall through to
961+
5090 or RTX PRO 6000. ~180–192 GB → dense-1b uses mb≥8,
959962
`DENSE1B_TE=1` default, checkpoint off, DDP world=1.
960963
2. **Explicit env fallbacks:** `PRISM_POD_GPU_COUNT=4` + **RTX 5090** (exact
961964
4×; **do not** fall through to 8×5090). `PRISM_POD_GPU_COUNT=2` or `8` +
962965
**RTX PRO 6000 Blackwell** (Server Edition). ~96 GB/card → mb≥4, TE on,
963966
checkpoint off.
964967

965-
Lium inventory snapshot (2026-08-19): **1× NVIDIA B200** listed at
966-
**$5.50/gpu-hr** (two offers). 8× B200 @ $5.60/gpu-hr is **not** the pin.
968+
Lium inventory snapshot (2026-08-22): marketplace lists **8× NVIDIA B200**
969+
hosts at **$5.60–$6.53/gpu-hr**. Native 1× B200 is often empty; the pin
970+
rents `gpu_count=1` on those 8× rows. A non-split 8× pack (no
971+
`available_gpu_count`) is **not** the pin.
967972
RTX PRO 6000 Server Edition remains an env fallback (1× @ $1.29; 8× @
968973
$1.01–$1.85). Ada “RTX 6000” is **not** the 6000 pin. Do **not** treat a
969974
5090 as a B200.

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.