You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tooling.apache.org by gs...@apache.org on 2026/10/11 23:29:44 UTC
(tooling-llmao) branch main updated: hosting: count disk once per model in the fit check
This is an automated email from the ASF dual-hosted git repository.
gstein pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tooling-llmao.git
The following commit(s) were added to refs/heads/main by this push:
new 8167c9c hosting: count disk once per model in the fit check
8167c9c is described below
commit 8167c9c2d9c913bd6e5e9ab1adda94a248b51762
Author: Greg Stein <gs...@gmail.com>
AuthorDate: Sun Oct 11 18:28:52 2026 -0500
hosting: count disk once per model in the fit check
check_fit summed disk_gb over every server, so two servers of the same
model were charged for two copies of the weights and a box with enough
disk was refused. They share one copy under HF_HOME, so the requirement
is now taken once per distinct model. VRAM is unchanged: each server
loads its own copy.
Co-authored-by: Claude Opus 5.5 <no...@anthropic.com>
---
hosting/vast/install_set.py | 8 +++++++-
tests/test_hosting.py | 14 ++++++++++++++
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/hosting/vast/install_set.py b/hosting/vast/install_set.py
index 49b6eeb..78caa51 100755
--- a/hosting/vast/install_set.py
+++ b/hosting/vast/install_set.py
@@ -230,7 +230,13 @@ def check_fit(specs: list[dict[str, Any]], *, data_dir: str) -> list[str]:
f"Weights alone -- KV cache comes out of what is left."
)
- want_disk = sum(s["disk_gb"] for s in specs if s.get("disk_gb"))
+ # Once per model, not per server: two servers of the same model share
+ # one copy of the weights under HF_HOME.
+ per_model: dict[str, float] = {}
+ for s in specs:
+ if s.get("disk_gb"):
+ per_model[s["model"]] = max(per_model.get(s["model"], 0.0), s["disk_gb"])
+ want_disk = sum(per_model.values())
have_disk = free_disk_gb(data_dir)
if want_disk and have_disk is not None and want_disk > have_disk:
problems.append(f"disk: need {want_disk:.1f}GB under {data_dir}, {have_disk:.1f}GB free")
diff --git a/tests/test_hosting.py b/tests/test_hosting.py
index f59cc30..be7aa50 100644
--- a/tests/test_hosting.py
+++ b/tests/test_hosting.py
@@ -242,6 +242,20 @@ def test_check_fit_silent_when_model_declares_nothing(monkeypatch):
assert inst.check_fit([_spec()], data_dir="/workspace") == []
+def test_check_fit_counts_disk_once_per_model(monkeypatch):
+ """Two servers of one model share a single copy of the weights."""
+ monkeypatch.setattr(inst, "free_vram_gb", lambda: None)
+ monkeypatch.setattr(inst, "free_disk_gb", lambda p: 60.0)
+ same = [_spec(name="a", disk=55), _spec(name="b", disk=55)]
+ assert inst.check_fit(same, data_dir="/workspace") == []
+
+ other = _spec(name="c", disk=55)
+ other["model"] = "another/model"
+ problems = inst.check_fit([same[0], other], data_dir="/workspace")
+ assert len(problems) == 1
+ assert "need 110.0GB" in problems[0]
+
+
def test_check_fit_reports_disk_shortfall(monkeypatch):
monkeypatch.setattr(inst, "free_vram_gb", lambda: 80.0)
monkeypatch.setattr(inst, "free_disk_gb", lambda p: 20.0)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tooling.apache.org
For additional commands, e-mail: commits-help@tooling.apache.org