deploy: the low-RAM fallback keeps kar_source none (no archive to map)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
67f4466642
commit
c8501da9d8
@@ -342,8 +342,11 @@ pub fn apply(
|
||||
profile.memory.hard_floor_mib = raised(profile.memory.hard_floor_mib, hard);
|
||||
}
|
||||
if let Some(resident) = plan.mapped_resident_gib {
|
||||
profile.kar_source = KarSource::File;
|
||||
profile.memfd_extents = crate::profile::MemfdExtents::Full;
|
||||
// `kar_source: none` has no archive to map: it stays none (the PLE table is read from the shard either way)
|
||||
if profile.kar_source != KarSource::None {
|
||||
profile.kar_source = KarSource::File;
|
||||
profile.memfd_extents = crate::profile::MemfdExtents::Full;
|
||||
}
|
||||
profile.expert_source = ExpertSource::Mapped;
|
||||
profile.memory.resident_budget_gib.get_or_insert(resident);
|
||||
profile.memory.lock = Some("off".into());
|
||||
@@ -825,6 +828,22 @@ mod tests {
|
||||
profile.validate().unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_low_ram_fallback_keeps_a_profile_without_an_archive_without_one() {
|
||||
let plan = compute(
|
||||
&host(32, 121, 70),
|
||||
Some(&gpu(32607, 32100)),
|
||||
&Profile::builtin("rtx5090-32g-gguf-ple").unwrap(),
|
||||
Preset::Workstation,
|
||||
);
|
||||
assert!(plan.mapped_resident_gib.is_some(), "{plan:?}");
|
||||
let mut profile = Profile::builtin("rtx5090-32g-gguf-ple").unwrap();
|
||||
apply(&plan, &mut profile, &mut BTreeMap::new(), false);
|
||||
assert_eq!(profile.kar_source, KarSource::None);
|
||||
assert_eq!(profile.expert_source, ExpertSource::Mapped);
|
||||
profile.validate().unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_small_host_gets_zero_resident_experts_and_dedicated_switches_too() {
|
||||
let plan = compute(
|
||||
|
||||
Reference in New Issue
Block a user