mirror of
https://github.com/hasso5703/alzeo.git
synced 2026-12-05 12:24:28 +01:00
install-inkling.sh serves Thinking Machines' Inkling 2 Mini (thinkingmachines/Inkling-2-Mini at its pinned revision, Apache-2.0: a looped mixture of experts, 26.4B parameters with 3.4B active, text and images in) with the DSpark draft head its checkpoint carries, on the text port behind the proxy, as model inkling-2-mini. The engine is SGLang from the image its cookbook gives the model (lmsysorg/sglang:inkling-2-mini, by the digest of its arm64 build), with the cookbook's DGX Spark recipe and its DSpark arm word for word, as the reference box measured it on 2026-11-22: a static share of 0.45, FA4, bfloat16, pages of 128, 8 draft tokens verified per step, MAX_JOBS=4 and the four SGLANG_OPT_* variables, xgrammar, images on, the inkling reasoning and inkling2 tool-call parsers; the model's window of 1,048,576 tokens and the 48 requests SGLang set itself, said so that no later default moves them; and what every SGLang lane of this box passes besides (the key by --config, the scheduler parked when idle, the metrics, the cache report). Its fetch pins refs/main, through which SGLang reads the draft head by the model's name. Its caches keep the kernels its engine compiles at its first start. The lane in every list: the registry, boxmem (refused on a 64 GB box: measured on a 128 GB one only), every engine unit's Conflicts= and After=, the proxy's hold units and its pair's lane names, install.sh (--with-inkling, --no-inkling, on demand by default, its boot kept by an update, its proof, its summary line), switch-model.sh (target inkling), prepare-lane.sh, uninstall.sh (its image is its own: the uninstall takes its tag and a prune reclaims it), check-pins.sh, the cockpit's sudoers lines, the CI's lists and gates, and lane-templates-check.py (its template as published, rendered for every client shape as SGLang hands them). The cockpit follows it as an SGLang text lane (the canary, the pool guard and the autoheal are its own), with its card, its names, its note with the reference box's measures, its engine, its boot default (222 s measured), its journal and its container; its mark is a plain badge of Thinking Machines' initials, no icon set having one. Its clients: opencode's provider inkling (oc-inkling.py), images in, five variants each a level its template reads by name, a pair of 374,000 and 32,000 that fits the pool measured at its window, and oc-fit-limits.py keeping that output as its ceiling whatever its window (ANSWER_CAPPED), as its card recommends limits on output tokens. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
158 lines
8.3 KiB
Python
158 lines
8.3 KiB
Python
#!/usr/bin/env python3
|
|
"""What this box is: its memory class, the lanes that fit it, and its maker's name.
|
|
|
|
Since 2026-10-23 the DGX Spark comes in two sizes. NVIDIA's product page gives "64 GB LPDDR5X* or
|
|
128 GB LPDDR5x, coherent unified system memory" on one 256-bit bus at 273 GB/s, the 64 GB
|
|
"available exclusively through participating OEM partners", and its blog of 2026-10-21 names what
|
|
the 64 GB runs: "Nemotron 3.5 Bolt 74B 24GB, Qwen3.8 27B and Gemma 4 26B-A4B". Linux sees less
|
|
than the label says: 121.6 GiB of MemTotal on the reference box's 128 GB (130.6 GB). The class
|
|
comes from MemTotal, in GiB as the kernel counts it. The maker's name comes from DMI
|
|
(/sys/class/dmi/id), which ASUS gives both sizes alike ("GX10"), so it never decides the class.
|
|
|
|
install.sh and the lane installers read it through lanes.sh (box_mem_class, lane_fits), and the
|
|
cockpit loads it the way it loads conformity.py. Standard library only.
|
|
"""
|
|
import argparse
|
|
import os
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
GIB = 1024 ** 3
|
|
# MemTotal from which a box is of the 128 GB class: what install.sh asked of every box until the
|
|
# 64 GB one (110 GiB, below the 112.3 GiB a 128 GB box keeps on the 7.0 kernel without kho=off,
|
|
# forum t/383222).
|
|
MIN_128_GIB = 110
|
|
# MemTotal from which a box is of the 64 GB class; below it nothing here fits with room to spare.
|
|
MIN_64_GIB = 48
|
|
# The lanes of the 64 GB class, by the names install.sh gives them: the 27B (23.5 GB of weights
|
|
# and drafter on disk), Nemotron 3.5 Bolt (24.1 GiB in memory) and the speech lane, on the CPU.
|
|
# The text lanes left out weigh 45.8 GB (Kolibri) to 135.3 GB (the flash); the video lane peaks
|
|
# at 75 to 80 GiB (docs/video-lane.md); the image lane waits for its own measurement on a 64 GB
|
|
# budget; MiniMax-H3-Image peaked at 92.3 GB and its recipe asks 106 GiB free at its start
|
|
# (docs/image-h3-lane.md); the NVIDIA Nemotron Transcribe lane was measured on a 128 GB box only
|
|
# (2026-11-14): no 64 GB run, so none is claimed; nor was the Liquid AI LFM2.5 24B-A2B lane, which left 24 GiB
|
|
# available at its lowest on a 128 GB box (2026-11-14), nor the Liquid AI LFM3 lane, whose share of 0.75 of the memory
|
|
# the engine sees is about 91 GiB on a 128 GB box: no 64 GB share was measured; nor the Inkling 2 Mini lane, which held
|
|
# 53.1 GiB of GPU memory at its peak on a 128 GB box (2026-11-22) with the static share SGLang's cookbook gives a DGX
|
|
# Spark (0.45): no 64 GB run was made, so no 64 GB share is claimed.
|
|
FITS_64 = ("27b", "nemotron", "speech")
|
|
LANES = ("27b", "flash", "image", "video", "kolibri", "nemotron", "nemotron-super", "flash-local",
|
|
"ornith-122b", "flash-unsloth", "image-h3", "transcribe", "lfm25", "lfm3", "inkling", "speech")
|
|
# Each target switch-model.sh and MODEL_CHOICE name, and its lane.
|
|
TARGETS = {"stock": "27b", "uncensored": "27b", "fp8": "27b", "uncensored-fp8": "27b", "arete": "27b",
|
|
"daisyrose": "27b",
|
|
"flash": "flash", "flash-nvda": "flash", "flash-uncensored": "flash",
|
|
"image": "image", "image-turbo": "image", "video": "video",
|
|
"kolibri": "kolibri", "kolibri-nvfp4": "kolibri", "nemotron": "nemotron",
|
|
"nemotron-super": "nemotron-super", "flash-local": "flash-local", "ornith-122b": "ornith-122b",
|
|
"flash-unsloth": "flash-unsloth", "flash-unsloth-iq3": "flash-unsloth",
|
|
"image-h3": "image-h3", "transcribe": "transcribe",
|
|
"lfm25": "lfm25", "lfm3": "lfm3", "inkling": "inkling"}
|
|
# Targets of a lane that fits, which a 64 GB box still does not take: Qwen's FP8 weights of the 27B
|
|
# (30.9 GB against 21.9 GB for NVFP4) leave its KV pool too little, and no 64 GB run measured them.
|
|
# Arete's NVFP4 (21.1 GB) weighs less than RadixArk's and takes the same KV cache: it goes where that one goes.
|
|
# DaisyRose's NVFP4 (21.95 GB) is RadixArk's own recipe at RadixArk's size and takes the same KV cache: it goes where stock goes.
|
|
HEAVY_64 = ("fp8", "uncensored-fp8")
|
|
# (sys_vendor, product_name) as a box's DMI gives them, each read on a real box and never
|
|
# guessed, and the name its maker sells it under. Any other box is named by its DMI as it is.
|
|
KNOWN = {
|
|
# both GX10 the project is measured on (gx10-eff9 and gx10-f56c), read 2026-10-22
|
|
("ASUSTeK COMPUTER INC.", "GX10"): "ASUS Ascent GX10",
|
|
}
|
|
|
|
|
|
def mem_total(meminfo=None):
|
|
"""MemTotal in bytes, or None when the file has no such line."""
|
|
path = meminfo or os.environ.get("QWEN38_MEMINFO") or "/proc/meminfo"
|
|
for line in Path(path).read_text().splitlines():
|
|
if line.startswith("MemTotal:"):
|
|
return int(line.split()[1]) * 1024
|
|
return None
|
|
|
|
|
|
def mem_class(meminfo=None):
|
|
""""128", "64", or None for a box too small for any lane. QWEN38_MEMORY_CLASS forces it: the
|
|
tests, and the 64 GB proofs on a 128 GB box with memory held aside."""
|
|
forced = os.environ.get("QWEN38_MEMORY_CLASS")
|
|
if forced:
|
|
if forced not in ("128", "64"):
|
|
raise ValueError(f"QWEN38_MEMORY_CLASS={forced}: 128 or 64")
|
|
return forced
|
|
total = mem_total(meminfo)
|
|
if total is None:
|
|
return None
|
|
if total >= MIN_128_GIB * GIB:
|
|
return "128"
|
|
if total >= MIN_64_GIB * GIB:
|
|
return "64"
|
|
return None
|
|
|
|
|
|
def fits(lane, cls):
|
|
"""Whether a lane fits a box of that class."""
|
|
if lane not in LANES:
|
|
raise ValueError(f"{lane}: not a lane ({', '.join(LANES)})")
|
|
return cls == "128" or (cls == "64" and lane in FITS_64)
|
|
|
|
|
|
def target_fits(target, cls):
|
|
"""Whether a target (a MODEL_CHOICE, a switch's argument) fits a box of that class."""
|
|
if target not in TARGETS:
|
|
raise ValueError(f"{target}: not a target ({', '.join(TARGETS)})")
|
|
return fits(TARGETS[target], cls) and not (cls == "64" and target in HEAVY_64)
|
|
|
|
|
|
def machine(dmi=None):
|
|
"""{vendor, product, family, name}: what the box's DMI says, and the name to show for it."""
|
|
d = Path(dmi or os.environ.get("QWEN38_DMI_DIR") or "/sys/class/dmi/id")
|
|
|
|
def read(key):
|
|
try:
|
|
return (d / key).read_text(errors="replace").strip()
|
|
except OSError:
|
|
return ""
|
|
vendor, product, family = read("sys_vendor"), read("product_name"), read("product_family")
|
|
name = KNOWN.get((vendor, product)) or " ".join(x for x in (vendor, product) if x) or None
|
|
return {"vendor": vendor, "product": product, "family": family, "name": name}
|
|
|
|
|
|
def main(argv=None):
|
|
ap = argparse.ArgumentParser(prog="boxmem.py", description=__doc__.split("\n")[0])
|
|
sub = ap.add_subparsers(dest="cmd", required=True)
|
|
sub.add_parser("class", help="print the box's memory class: 128, 64, or none")
|
|
sub.add_parser("gib", help="print MemTotal in GiB, one decimal")
|
|
f = sub.add_parser("fits", help="exit 0 when the lane fits this box, 1 when it does not")
|
|
f.add_argument("lane", choices=LANES)
|
|
f.add_argument("--class", dest="cls", choices=("128", "64", "none"),
|
|
help="the class already read (install.sh's MEM_CLASS) instead of reading it again")
|
|
t = sub.add_parser("fits-target", help="exit 0 when the target fits this box, 1 when it does not")
|
|
t.add_argument("target", choices=tuple(TARGETS))
|
|
t.add_argument("--class", dest="cls", choices=("128", "64", "none"),
|
|
help="the class already read (install.sh's MEM_CLASS) instead of reading it again")
|
|
sub.add_parser("machine", help="print the box's name, as its DMI gives it")
|
|
g = sub.add_parser("fitting", help="print the lanes that fit this box, in LANES' order")
|
|
g.add_argument("--class", dest="cls", choices=("128", "64", "none"),
|
|
help="the class already read (install.sh's MEM_CLASS) instead of reading it again")
|
|
a = ap.parse_args(argv)
|
|
if a.cmd == "class":
|
|
print(mem_class() or "none")
|
|
elif a.cmd == "gib":
|
|
total = mem_total()
|
|
print(f"{total / GIB:.1f}" if total is not None else "unknown")
|
|
elif a.cmd == "fits":
|
|
cls = a.cls if a.cls else mem_class()
|
|
return 0 if fits(a.lane, None if cls == "none" else cls) else 1
|
|
elif a.cmd == "fits-target":
|
|
cls = a.cls if a.cls else mem_class()
|
|
return 0 if target_fits(a.target, None if cls == "none" else cls) else 1
|
|
elif a.cmd == "machine":
|
|
print(machine()["name"] or "unknown")
|
|
elif a.cmd == "fitting":
|
|
cls = a.cls if a.cls else mem_class()
|
|
print(" ".join(lane for lane in LANES if fits(lane, None if cls == "none" else cls)))
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(main())
|