An adopted engine's state is written without its command; engine-check finds the installed build
SetCompute on an engine adopted from an earlier agent called writeState, which read the command line from sh.cmd - nil for a process this agent did not start - and the agent crashed at every start on the PoC's nodes until fixed. An adopted shard now keeps the command line its state file had. engine-check looked for llama-server one directory too shallow; the agent installs it under <version-variant>/llama-<build>/. It now looks at both, preferring a CUDA build on a machine with NVIDIA GPUs. Run on cuda01: a token computed on CUDA0, 25 of 25 layers offloaded. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
b5d650af16
commit
2f595f5999
4 files changed
+85
-7
No files matched your search
@@ -309,14 +309,30 @@ func checkDevices(ctx context.Context, name string, fb engines.CPUFallback, out
|
||||
return nil
|
||||
}
|
||||
|
||||
// installedLlama is the newest llama-server the agent installed here.
|
||||
// llamaRoot is where the agent installs llama.cpp builds.
|
||||
var llamaRoot = "/opt/llmgw/engines/llamacpp"
|
||||
|
||||
// installedLlama is the llama-server the agent installed here: under
|
||||
// llamaRoot/<version-variant>/llama-<build>/, or one level up for older
|
||||
// layouts; on a machine with NVIDIA GPUs a CUDA build first, then the newest.
|
||||
func installedLlama() string {
|
||||
m, _ := filepath.Glob("/opt/llmgw/engines/llamacpp/*/llama-server")
|
||||
if len(m) == 0 {
|
||||
var found []string
|
||||
for _, pat := range []string{"*/llama-server", "*/*/llama-server"} {
|
||||
m, _ := filepath.Glob(filepath.Join(llamaRoot, pat))
|
||||
found = append(found, m...)
|
||||
}
|
||||
if len(found) == 0 {
|
||||
return ""
|
||||
}
|
||||
sort.Strings(m)
|
||||
return m[len(m)-1]
|
||||
sort.Strings(found)
|
||||
if _, err := exec.LookPath("nvidia-smi"); err == nil {
|
||||
for i := len(found) - 1; i >= 0; i-- {
|
||||
if strings.Contains(found[i], "cuda") {
|
||||
return found[i]
|
||||
}
|
||||
}
|
||||
}
|
||||
return found[len(found)-1]
|
||||
}
|
||||
|
||||
// weightDirs are where a node keeps models it has fetched.
|
||||
|
||||
Reference in new issue
Block a user