mirror of
https://github.com/hasso5703/alzeo.git
synced 2026-12-05 12:24:28 +01:00
qwen4-35b: the box is its own, no lane beside it (decision 1725)
Hasan, 2026-12-04: a Qwen4 lane on a machine dedicated to it, with all the context it can hold. Its Load stops every lane beside first, the embeddings lane too (the OCR and Clipstral lanes already, for want of room), and none of them starts while it serves or is the boot lane: the embeddings lane's unit's head refuses it now as the OCR and Clipstral lanes' do, and the cockpit says so before the click. Tests red on the old code (the head, the plan), green now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b56a32b2e9
commit
c773ac2643
7 files changed
+75
-14
No files matched your search
+5
-4
@@ -97,10 +97,11 @@
|
||||
share of the memory is fixed and leaves too little, or one this browser stopped for want of room). Its unit's head holds the same
|
||||
outside the cockpit, as the Clipstral lane's does: not beside those three lanes, nor while the box boots one of the two whose
|
||||
share is fixed; one stopped since the box booted is no longer on its way.
|
||||
- **In its turn beside the Qwen4 lane.** That lane's share of 0.72 left the box 13.5 GiB of memory available under 24 agents
|
||||
(its proof, 2026-12-04), less than the 16 GiB the OCR lane starts with: the cockpit's Load of the OCR or the Clipstral lane
|
||||
stops it first, as for Kolibri-1 in FP8 and Nemotron 3.5 Super VL, and their units' heads refuse to start beside it. The
|
||||
proof found it: started beside it, the OCR lane's own head refused (the box had 14 GiB).
|
||||
- **The Qwen4 lane takes the box alone** (decision 1725). Its Load stops every lane beside first, the OCR, Clipstral and
|
||||
embeddings lanes, and none of them starts while it serves or is the boot lane: their units' heads refuse it, the cockpit says
|
||||
so before the click, and the OCR lane's Load stops it first, in its turn. Its KV cache holds its whole window with nothing else
|
||||
in memory, and its share of 0.72 left the box 13.5 GiB under 24 agents (its proof, 2026-12-04), less than the 16 GiB the OCR
|
||||
lane starts with: the proof found it, the OCR lane's own head refusing a start beside it (the box had 14 GiB).
|
||||
- **Mistral's `/v1/ocr`, through the proxy (v6.69)**, with the box's key: a PDF or a picture as a `data:` URL, Mistral's shape in and out
|
||||
(pages, Markdown, tables, header and footer, dimensions, usage), and this lane's own fields: `mode`, `fields`, `stream` (the pages as
|
||||
server-sent events, each when it is read), `include_page_image`, `include_blocks`. LiteLLM's multipart form is read too. A URL of the
|
||||
|
||||
@@ -1234,10 +1234,12 @@ function laneJourneySteps(target){
|
||||
// a lane whose share of the memory is fixed and which leaves the box too little for the Clipstral lane beside it: that one stops
|
||||
// first, and does not start again while this one serves or boots (its unit's head)
|
||||
const at = steps.findIndex(s => s.name === 'unit' && s.params.unit === unit && s.params.verb !== 'stop');
|
||||
for (const b of [CLIPSTRAL_UNIT, OCR_UNIT])
|
||||
if (at >= 0 && unit !== UFLASH && LEAVES_LITTLE_GIB(unit, target) && besideUp(b))
|
||||
// a lane that takes the box alone (decision 1725) stops every lane beside first, the embeddings lane too
|
||||
for (const b of [EMBED_UNIT, CLIPSTRAL_UNIT, OCR_UNIT])
|
||||
if (at >= 0 && unit !== UFLASH && besideUp(b) && (ALONE.has(unit) || (b !== EMBED_UNIT && LEAVES_LITTLE_GIB(unit, target))))
|
||||
steps.splice(at, 0, {name: 'unit', params: {verb: 'stop', unit: b}, title: `Stop ${LANE_NAME[b]}`,
|
||||
desc: `${LANE_NAME[unit]} leaves the box as little as ${LEAVES_LITTLE_GIB(unit, target)} GiB, and this lane holds ${BESIDE_HOLDS_GIB[b]}: start it again once another lane serves.`});
|
||||
desc: ALONE.has(unit) ? `${LANE_NAME[unit]} takes the box alone, its KV cache holding its whole window: this lane stops first. Start it again once another lane serves.`
|
||||
: `${LANE_NAME[unit]} leaves the box as little as ${LEAVES_LITTLE_GIB(unit, target)} GiB, and this lane holds ${BESIDE_HOLDS_GIB[b]}: start it again once another lane serves.`});
|
||||
// the lane the OvisOCR3 lane's Load stopped for want of room: the two did not fit, and the OCR lane stops first (decision 1669)
|
||||
if (at >= 0 && ocrTurn() === unit && !steps.some(s => s.name === 'unit' && s.params.unit === OCR_UNIT && s.params.verb === 'stop'))
|
||||
steps.splice(at, 0, {name: 'unit', params: {verb: 'stop', unit: OCR_UNIT}, title: `Stop ${LANE_NAME[OCR_UNIT]}`,
|
||||
@@ -1273,6 +1275,9 @@ const BESIDE_ROOM_GIB = {[EMBED_UNIT]: 9, [CLIPSTRAL_UNIT]: 12, [OCR_UNIT]: 16},
|
||||
BESIDE_HOLDS_GIB = {[EMBED_UNIT]: 1, [CLIPSTRAL_UNIT]: 5, [OCR_UNIT]: 13};
|
||||
const LEAVES_LITTLE_GIB = (unit, target) => ({[UFLASH]: 6.9, [NEMOTRON_SUPER_UNIT]: 9.1, [QWEN4_35B_UNIT]: 13.5})[unit] || (unit === KOLIBRI_UNIT && target === 'kolibri' ? 10.9 : 0);
|
||||
const leavesLittle = u => LEAVES_LITTLE_GIB(u, laneTarget(u));
|
||||
// The lanes that take the box alone (decision 1725, Hasan: the Qwen4 35B-A3B lane with all the context it can hold): their Load
|
||||
// stops every lane beside first, and no lane beside starts while one serves or is the boot lane (their units' heads refuse it).
|
||||
const ALONE = new Set([QWEN4_35B_UNIT]);
|
||||
const besideUp = u => { const e = engines()[u]; return !!e && !UNIT_DOWN.has(e.state); };
|
||||
// The lane the OvisOCR3 lane's Load stopped for want of room (decision 1662), as this browser remembers it: the two did not fit,
|
||||
// and that lane's Load stops the OCR lane first (decision 1669). A lane stopped because it leaves the box too little needs no
|
||||
@@ -1301,6 +1306,9 @@ function roomWarns(unit, target, steps){
|
||||
// the OvisOCR3 lane's Load that stops the lane that serves first: its step says why, and the start then has its room
|
||||
if (unit === OCR_UNIT && steps.some(s => s.name === 'unit' && s.params.verb === 'stop' && s.params.unit !== unit)) return [];
|
||||
const starts = does(['start']), again = does(['restart']), out = [];
|
||||
const sv = servingEngine(), alone = [sv && sv[0], bootUnit()].find(u => u && ALONE.has(u));
|
||||
if (starts && alone && unit !== OCR_UNIT)
|
||||
return [`${LANE_NAME[alone]} takes the box alone, its KV cache holding its whole window: this lane does not start beside it, nor while it is the boot lane. Load another lane first.`];
|
||||
const tight = starts ? tightLane() : null, little = tight ? leavesLittle(tight) : 0, holds = BESIDE_HOLDS_GIB[unit];
|
||||
if (tight && unit === CLIPSTRAL_UNIT) out.push(`${LANE_NAME[tight]} leaves the box as little as ${little} GiB, and this lane holds ${holds}: its start would be refused. Load another lane first.`);
|
||||
// the boot lane, stopped, that leaves the box too little (the one that serves would have stopped first, above): the two
|
||||
|
||||
@@ -451,6 +451,27 @@ class ItsLoadStopsNothing(unittest.TestCase):
|
||||
self.assertFalse([s for s in self.warned("nemotron-super", 112, {"qwen38-nemotron-super.service": ["stopped", "nemotron-super"],
|
||||
"qwen38-clipstral.service": "stopped"})["steps"] if "clipstral" in s])
|
||||
|
||||
def test_the_qwen4_lane_takes_the_box_alone(self):
|
||||
# decision 1725 (Hasan): its Load stops every lane beside first, the embeddings lane too, and no lane beside starts while it
|
||||
# serves or is the boot lane, which their units' heads refuse
|
||||
runs = {"qwen38-embed.service": "ready", "qwen38-clipstral.service": "ready"}
|
||||
r = self.warned("qwen4-35b", 108, {"qwen38-qwen4-35b.service": ["stopped", "qwen4-35b"], **runs})
|
||||
start = [i for i, s in enumerate(r["steps"]) if "systemctl start qwen38-qwen4-35b.service" in s]
|
||||
for b in ("qwen38-embed.service", "qwen38-clipstral.service"):
|
||||
stop = [i for i, s in enumerate(r["steps"]) if f"systemctl stop {b}" in s]
|
||||
self.assertTrue(stop and start and stop[0] < start[0], (b, r["steps"]))
|
||||
self.assertEqual(r["warns"], [], "every lane beside stops first: nothing is left to keep its memory")
|
||||
for target, unit in (("embeddings", "qwen38-embed.service"), ("clipstral", "qwen38-clipstral.service")):
|
||||
for state in ("ready", "stopped"):
|
||||
w = self.warned(target, 40, {"qwen38-qwen4-35b.service": [state, "qwen4-35b"], unit: "stopped"},
|
||||
boot="qwen38-qwen4-35b.service")["warns"]
|
||||
self.assertEqual(len(w), 1, (target, state, w))
|
||||
self.assertIn("Qwen4 35B-A3B takes the box alone, its KV cache holding its whole window: this lane does not start "
|
||||
"beside it, nor while it is the boot lane.", w[0])
|
||||
# beside another lane the embeddings lane starts as before
|
||||
self.assertEqual(self.warned("embeddings", 40, {"qwen38-sglang.service": ["ready", "stock"], "qwen38-embed.service": "stopped"},
|
||||
boot="qwen38-sglang.service")["warns"], [])
|
||||
|
||||
def test_what_the_window_says_of_those_lanes_is_what_their_pages_give(self):
|
||||
for page, said in (("flash-lane.md", "(MemAvailable sampled throughout, floor 6.9 GiB)"),
|
||||
("nemotron-super-lane.md", "| MemAvailable, lowest seen | 9.1 GiB "), ("kolibri-lane.md", "| MemAvailable, lowest seen | 10.9 GiB |"),
|
||||
|
||||
+3
-1
@@ -4,7 +4,9 @@ Perplexity's [pplx-embed-v1-0.6b](https://huggingface.co/perplexity-ai/pplx-embe
|
||||
vector of 1,024 dimensions, the int8 one its card publishes, of norm 1: the dot product of two of them says how near their texts are. This lane serves it on the
|
||||
CPU, on a port of its own (30028) and on 127.0.0.1 alone, answering `/v1/embeddings` in the OpenAI shape, by this repo's own server
|
||||
since v1.61.0. It is a lane beside every lane, like the [speech lane](speech-lane.md) and the [Clipstral lane](clipstral-lane.md):
|
||||
its engine never touches the GPU, so it runs beside whichever lane serves, its Load stops nothing, and nothing stops for it. The
|
||||
its engine never touches the GPU, so it runs beside whichever lane serves, its Load stops nothing, and nothing stops for it,
|
||||
but for the Qwen4 35B-A3B lane, which takes the box alone (decision 1725): its Load stops this lane first, and this lane does not
|
||||
start beside it, nor while it is the boot lane. The
|
||||
need it serves is an indexing service (discussion #69: one embedding at the start of a task, the queries of an agent beside it),
|
||||
for which the CPU's throughput is enough, and a GPU engine would contend with generation.
|
||||
|
||||
|
||||
@@ -172,7 +172,8 @@ The checkpoint is published under the Apache License 2.0, as Qwen's own.
|
||||
(101 GB with its image). A 64 GB DGX Spark leaves it out: its memory was measured on a 128 GB box only, and no 64 GB run
|
||||
was made. `./install-qwen4-35b.sh --uninstall` removes its unit and its image's tag: the checkpoint and the image stay,
|
||||
named, and a `docker image prune` reclaims the image.
|
||||
- Beside it, the OCR and Clipstral lanes run in their turn. Under 24 agents, in the lane's proof of 2026-12-04, the box's
|
||||
MemAvailable, lowest seen: 13.5 GiB, less than the 16 GiB the OCR lane starts with, its share of 0.72 the reason. The
|
||||
cockpit's Load of either lane stops this one first, as for Kolibri-1 in FP8 and Nemotron 3.5 Super VL, and their units'
|
||||
heads refuse to start beside it.
|
||||
- **The box is its own** (decision 1725): its Load stops every lane beside first (the OCR, Clipstral and embeddings lanes),
|
||||
and none of them starts while it serves or is the boot lane: their units' heads refuse it, the cockpit says so before the
|
||||
click, and the OCR lane's Load stops it first, in its turn. Its KV cache then holds its whole window with nothing else in
|
||||
memory. Under 24 agents, in the lane's proof of 2026-12-04, the box's MemAvailable, lowest seen: 13.5 GiB, less than the
|
||||
16 GiB the OCR lane starts with.
|
||||
@@ -19,7 +19,8 @@ ExecStartPre=-/usr/bin/docker rm -f qwen38-embed
|
||||
# (Each refusal waits a second after its line: the journal does not know whose the last words of a process are that ends at once.)
|
||||
# Then the memory it takes has to be there (EMBED_ROOM_GIB): the lane that serves may leave the box too little, and the cap
|
||||
# below protects the box from this container's growth, not from its start. What a lane that stops hands back gets 30 s to come.
|
||||
# A start of systemd's own, after a death, asks for what it holds and the 3 GiB alone (EMBED_AGAIN_GIB).
|
||||
# A start of systemd's own, after a death, asks for what it holds and the 3 GiB alone (EMBED_AGAIN_GIB). The Qwen4 35B-A3B
|
||||
# lane takes the box alone (decision 1725): beside it, or while it is the boot lane, this lane does not start.
|
||||
# This repo's own server (pplx-server.py) and module (pplx_model.py), in the 27B lane's SGLang image, whose torch and
|
||||
# tokenizers they run on: nothing of the model's repository but its weights and its tokenizer is read, and none of its
|
||||
# Python is run.
|
||||
@@ -37,7 +38,10 @@ ExecStart=/bin/bash -c 'for t in {0..30}; do lacks=""; \
|
||||
snap="__HF_CACHE__/hub/models--__EMBED_MODEL_DASH__/snapshots/__EMBED_REV__"; for f in model.safetensors tokenizer.json; do [ -f "$snap/$f" ] || { lacks="$f"; break; }; done; \
|
||||
[ -n "$lacks" ] || break; [ "$t" = 30 ] || sleep 3; done; \
|
||||
[ -z "$lacks" ] || { echo "preflight: qwen38-embed.service lacks its model: $snap/$lacks (its disk is not mounted, or the model was never fetched: Load the lane from the cockpit, or ./install-embeddings.sh --fetch)" >&2; sleep 1; exit 78; }; \
|
||||
case "$(systemctl show -p NRestarts --value qwen38-embed.service 2>/dev/null)" in ""|0) g=__EMBED_ROOM_GIB__ ;; *) g=__EMBED_AGAIN_GIB__ ;; esac; \
|
||||
case "$(systemctl show -p NRestarts --value qwen38-embed.service 2>/dev/null)" in ""|0) g=__EMBED_ROOM_GIB__; \
|
||||
systemctl -q is-active qwen38-qwen4-35b.service 2>/dev/null || systemctl -q is-enabled qwen38-qwen4-35b.service 2>/dev/null && { \
|
||||
echo "preflight: qwen38-embed.service lacks room: qwen38-qwen4-35b.service takes the box alone, its KV cache holding its whole window: load another lane, then start this one again" >&2; sleep 1; exit 78; } ;; \
|
||||
*) g=__EMBED_AGAIN_GIB__ ;; esac; \
|
||||
for t in {0..10}; do while read -r k v _; do [ "$k" = MemAvailable: ] && break; done < /proc/meminfo; \
|
||||
[ -z "$v" ] || [ "$v" -ge $((g * 1048576)) ] && break; [ "$t" = 10 ] || sleep 3; done; \
|
||||
[ -z "$v" ] || [ "$v" -ge $((g * 1048576)) ] || { echo "preflight: qwen38-embed.service lacks room: the box had $((v / 1048576)) GiB of memory available and this lane starts with $g GiB at least, the 3 GiB under which generations are stopped among them: stop the lane that serves or load one that leaves the box more, then start this one again" >&2; sleep 1; exit 78; }; \
|
||||
|
||||
@@ -29,6 +29,30 @@ def flat(path):
|
||||
class ItsUnit(vector_lanes.UnitTests, unittest.TestCase):
|
||||
L = LANE
|
||||
|
||||
def test_it_does_not_start_beside_the_qwen4_lane_nor_while_the_box_boots_it(self):
|
||||
"""The Qwen4 35B-A3B lane takes the box alone (decision 1725, Hasan: all the context it can hold): beside it, or while
|
||||
it is the boot lane, this lane does not start; beside another lane it does, and a start of systemd's own after a death
|
||||
asks the room alone."""
|
||||
unit = self.stage()
|
||||
snap = pathlib.Path(re.search(vector_lanes.PREFLIGHT, unit).group(1))
|
||||
snap.mkdir(parents=True)
|
||||
for f in re.search(vector_lanes.PREFLIGHT, unit).group(2).split():
|
||||
(snap / f).write_text("x")
|
||||
head = re.search(r"ExecStart=/bin/bash -c '(.*?)exec /usr/bin/docker run ", unit, re.S).group(1).replace("\\\n", " ")
|
||||
head = head.replace("/proc/meminfo", str(self.meminfo(40)))
|
||||
|
||||
def starts(**kw):
|
||||
r = subprocess.run(["bash", "-c", self.systemctl(**kw) + "sleep(){ :; }; " + head + " exit 0"], capture_output=True, text=True)
|
||||
return r.returncode, r.stderr
|
||||
q4, stock = "qwen38-qwen4-35b.service", "qwen38-sglang.service"
|
||||
for kw in ({"up": (q4,)}, {"boot": (q4,)}):
|
||||
rc, said = starts(**kw)
|
||||
self.assertEqual(rc, 78, kw)
|
||||
self.assertIn("preflight: qwen38-embed.service lacks room: qwen38-qwen4-35b.service takes the box alone, its KV cache "
|
||||
"holding its whole window: load another lane, then start this one again", said)
|
||||
for kw in ({"up": (stock,)}, {"boot": (stock,)}, {}, {"up": (q4,), "n": 1}):
|
||||
self.assertEqual(starts(**kw)[0], 0, kw)
|
||||
|
||||
|
||||
class ItsCode(vector_lanes.CodeTests, unittest.TestCase):
|
||||
L = LANE
|
||||
|
||||
Reference in new issue
Block a user