A machine too small for the models it would serve is said so first
CI / test (push) Successful in 8m42s
CI / test (push) Successful in 8m42s
A control plane that is also a node, serving the starter model and two judges, needs about 10.5 GB: 3.5 for itself, 2 for the starter, 2 for each judge, and one more because the scheduler counts whole gigabytes. On 8 GB the install did every step and then had nowhere to run the starter. The setup's checks now fail this machine's memory and name what it would serve, and server init refuses before it installs anything, naming the flags that leave those models off it. quick-install.md said 8 GB; it says 12. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
06baa38858
commit
d110968243
10 files changed
+131
-5
No files matched your search
@@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"math"
|
||||
"net"
|
||||
"os"
|
||||
"path"
|
||||
"slices"
|
||||
"strconv"
|
||||
@@ -11,6 +12,8 @@ import (
|
||||
"time"
|
||||
|
||||
"gitea.mynodes.xyz/ilker/llmgw/internal/agent/provision"
|
||||
"gitea.mynodes.xyz/ilker/llmgw/internal/pgha"
|
||||
"gitea.mynodes.xyz/ilker/llmgw/internal/preflight"
|
||||
)
|
||||
|
||||
// What a first install lets a person choose beyond which parts it has: which
|
||||
@@ -154,6 +157,62 @@ func (s starterSpec) minMemoryGB() int {
|
||||
return max(2, int(math.Ceil(s.SizeGB+1.5)))
|
||||
}
|
||||
|
||||
// servingMemoryMB is what this machine needs, beyond what the control plane
|
||||
// does, for the models it will serve itself: the starter's and the judges'
|
||||
// reservations, and a gigabyte more because the scheduler counts a machine's
|
||||
// memory in whole gigabytes, rounded down — 7.75 GB is 7. Zero when it serves
|
||||
// none of them; what names those it does.
|
||||
//
|
||||
// Asked before anything is installed: the 8 GB machine the guide was first
|
||||
// recorded on finished every step and then had no room for the starter, the
|
||||
// one thing a person asks first.
|
||||
func (in *serverInit) servingMemoryMB(judgesElsewhere bool) (mb int, what string) {
|
||||
if in.noNode {
|
||||
return 0, ""
|
||||
}
|
||||
gb := 0
|
||||
var parts []string
|
||||
if !in.noModel && (!in.noMirror || in.mirrorURL != "") {
|
||||
gb += in.starterModelSpec().minMemoryGB()
|
||||
parts = append(parts, "the starter model")
|
||||
}
|
||||
if !in.noGuardModel && !judgesElsewhere {
|
||||
n := in.judgeFor().Replicas
|
||||
gb += n * judgeMemoryGB
|
||||
parts = append(parts, fmt.Sprintf("%d judges", n))
|
||||
}
|
||||
if gb == 0 {
|
||||
return 0, ""
|
||||
}
|
||||
return (gb + 1) * 1024, strings.Join(parts, " and ")
|
||||
}
|
||||
|
||||
// checkMemory refuses, before anything is installed, a machine too small for
|
||||
// the models it would serve as well as the control plane.
|
||||
func (in *serverInit) checkMemory() error {
|
||||
if in.unitPath == "" {
|
||||
return nil // a development run, served by nothing
|
||||
}
|
||||
meminfo, err := os.ReadFile("/proc/meminfo")
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
total, ok := pgha.MemTotal(string(meminfo))
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
extra, what := in.servingMemoryMB(len(in.judgeMachines) > 0)
|
||||
if extra == 0 {
|
||||
return nil
|
||||
}
|
||||
have, need := int(total>>20), preflight.Needs[preflight.RoleControl].MemoryMB+extra
|
||||
if have >= need {
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("memory: this machine has %d MB; the control plane and %s it would serve need %d. "+
|
||||
"Give it more, or leave them off it: --no-model, --no-guard-model, or --no-node to serve models only on nodes added later", have, what, need)
|
||||
}
|
||||
|
||||
// defaultContext is the context a client may use of the starter.
|
||||
const defaultContext = 4096
|
||||
|
||||
|
||||
Reference in new issue
Block a user