You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs/gpu-llm-analysis-worker.md and docs/gpu-ml-worker-acceleration.md state resource-containment rules that the checked-in compose files they themselves declare canonical ("The checked-in files are canonical; the inline Compose example ... must not be copied") no longer agree with. Two distinct divergences:
1. Keep-alive: three different values presented as one knob, with the wrong one asserted as the effective unload behavior for the slot the sharing budget was written around.
The guides' hard rule is OLLAMA_KEEP_ALIVE=10m -- unload the model when idle so the ML worker can use the GPU for retraining (LLM guide §5 :199, repeated as the worker-retention claim in its T7 :489), and acceleration guide §5's consumer table makes it a budget parameter: "On LLM requests; unloads 10 min after last use (OLLAMA_KEEP_ALIVE=10m)".
The deployed canonical compose deliberately sets something else: analysis/ghidra/docker-compose.ghidra.yml :87 has OLLAMA_KEEP_ALIVE: '30m' under an explicit rationale comment -- "Keep the model resident between samples. A drain analyses a queue one binary at a time, and reloading several GB of weights per workflow call costs more than the inference does." That is the opposite trade-off from the 10-minute-unload-to-free-VRAM rule the docs teach.
The reconciliation lives in code nobody's doc mentions: llm-worker/worker.py keeps its own per-request keep_alive (LLM_KEEP_ALIVE, default 10m, validated at :113/:253) and sends it inside every request body (:367, :405, :1334). Ollama honors request-level keep-alive over the server default -- so the docs' "10 minutes" is true only where llm-worker made the request (sessions/payload/report jobs), while ghidra drain and revdeck traffic on the same shared card runs under the deliberate 30m residency.
Practical consequence is mostly latent today (the ml-worker still pins torch==2.13.0+cpu, so there is no GPU retraining to collide with), but #569's lifted-overlap-rule arithmetic and acceleration-guide §5's VRAM table were reasoned around a 10-minute unload window that does not govern the heaviest consumer described in that very table (the ghidra slot at ~14.1 GiB / 32k context).
2. G6 cites a "12 GiB RAM limit" that exists nowhere.
LLM guide guardrail G6 (:545-548): "Respect the VRAM budget in §5 (MAX_LOADED_MODELS=1, NUM_PARALLEL=1, KEEP_ALIVE=10m, 12 GiB RAM limit)." A repo-wide sweep finds no mem_limit/memory: value anywhere near 12g attached to ollama or either worker -- the only nearby memory constraint in the ghidra stack is an unrelated helper service's mem_limit: 1g. MAX_LOADED_MODELS/NUM_PARALLEL do check out against the compose (:93/:102); the fourth item in a guardrail labeled "read before implementing" is a phantom from an earlier draft of the deployment.
Evidence or Why it matters
These are agent-targeted implementation guides ("Audience: a human operator or an AI coding agent implementing this feature"). An implementer auditing their own work against G6/T7 enforces a memory limit that isn't declared anywhere and rewrites a residency setting whose removal contradicts a documented rationale (ghidra reload cost). Conversely, someone reasoning about whether ml-worker retraining can start mid-drain gets the docs' 10-minute answer when the real server-side bound is 30 minutes.
What needs to change
Split the keep-alive documentation into its two actual layers: server default (OLLAMA_KEEP_ALIVE, currently 30m by authored decision for drain residency, quoting the compose rationale) vs worker request override (LLM_KEEP_ALIVE, 10m, sent per-request and therefore governing llm-worker traffic only). Fix all three claims: LLM guide :199, :489; acceleration guide :197 table row.
Summary
docs/gpu-llm-analysis-worker.mdanddocs/gpu-ml-worker-acceleration.mdstate resource-containment rules that the checked-in compose files they themselves declare canonical ("The checked-in files are canonical; the inline Compose example ... must not be copied") no longer agree with. Two distinct divergences:1. Keep-alive: three different values presented as one knob, with the wrong one asserted as the effective unload behavior for the slot the sharing budget was written around.
OLLAMA_KEEP_ALIVE=10m -- unload the model when idle so the ML worker can use the GPU for retraining(LLM guide §5 :199, repeated as the worker-retention claim in its T7 :489), and acceleration guide §5's consumer table makes it a budget parameter: "On LLM requests; unloads 10 min after last use (OLLAMA_KEEP_ALIVE=10m)".analysis/ghidra/docker-compose.ghidra.yml:87 hasOLLAMA_KEEP_ALIVE: '30m'under an explicit rationale comment -- "Keep the model resident between samples. A drain analyses a queue one binary at a time, and reloading several GB of weights per workflow call costs more than the inference does." That is the opposite trade-off from the 10-minute-unload-to-free-VRAM rule the docs teach.llm-worker/worker.pykeeps its own per-requestkeep_alive(LLM_KEEP_ALIVE, default10m, validated at :113/:253) and sends it inside every request body (:367, :405, :1334). Ollama honors request-level keep-alive over the server default -- so the docs' "10 minutes" is true only where llm-worker made the request (sessions/payload/report jobs), while ghidra drain and revdeck traffic on the same shared card runs under the deliberate 30m residency.Practical consequence is mostly latent today (the ml-worker still pins
torch==2.13.0+cpu, so there is no GPU retraining to collide with), but #569's lifted-overlap-rule arithmetic and acceleration-guide §5's VRAM table were reasoned around a 10-minute unload window that does not govern the heaviest consumer described in that very table (the ghidra slot at ~14.1 GiB / 32k context).2. G6 cites a "12 GiB RAM limit" that exists nowhere.
LLM guide guardrail G6 (:545-548): "Respect the VRAM budget in §5 (
MAX_LOADED_MODELS=1,NUM_PARALLEL=1,KEEP_ALIVE=10m, 12 GiB RAM limit)." A repo-wide sweep finds nomem_limit/memory:value anywhere near 12g attached to ollama or either worker -- the only nearby memory constraint in the ghidra stack is an unrelated helper service'smem_limit: 1g.MAX_LOADED_MODELS/NUM_PARALLELdo check out against the compose (:93/:102); the fourth item in a guardrail labeled "read before implementing" is a phantom from an earlier draft of the deployment.Evidence or Why it matters
These are agent-targeted implementation guides ("Audience: a human operator or an AI coding agent implementing this feature"). An implementer auditing their own work against G6/T7 enforces a memory limit that isn't declared anywhere and rewrites a residency setting whose removal contradicts a documented rationale (ghidra reload cost). Conversely, someone reasoning about whether ml-worker retraining can start mid-drain gets the docs' 10-minute answer when the real server-side bound is 30 minutes.
What needs to change
OLLAMA_KEEP_ALIVE, currently 30m by authored decision for drain residency, quoting the compose rationale) vs worker request override (LLM_KEEP_ALIVE, 10m, sent per-request and therefore governing llm-worker traffic only). Fix all three claims: LLM guide :199, :489; acceleration guide :197 table row.Acceptance criteria
grep -rn "OLLAMA_KEEP_ALIVE\|LLM_KEEP_ALIVE" docs/results each match the semantics of the corresponding compose variable.Related