Files
alzeo/tests/test_engine_rendezvous_file.py
Hasan BasbunarandClaude Opus 5.5 12eccea5c3 qwen4-35b: the Qwen4 35B-A3B lane, RadixArk's NVFP4 with its DFlash2 draft on SGLang's qwen4 image, the model's KV in FP8
Qwen published Qwen4-35B-A3B on 2026-12-04. The lane serves RadixArk's NVFP4 of it with RadixArk's DFlash2 draft, on the
image SGLang's cookbook gives Qwen4 (lmsysorg/sglang:qwen4, by its arm64 digest), with the DFlash2 arm of the cookbook's
DGX Spark recipe, which the published image serves though the cookbook says otherwise (measured on the reference box). Two
settings of its own, measured: the model's KV cache in FP8, since with the draft's in BF16 SGLang kept it in BF16 too and
held 612,672 tokens, less than the window; a share of 0.72, 1,278,336 tokens and 41 requests at a time. Qwen's tokenizer is
the checkpoint's own code (--trust-remote-code), read whole before it ran.

Its installer and unit, the switch (the checkpoint and the draft, each pinned as refs/main), the uninstall, the cockpit (its
card and note, its draft checked before a start, its start's default), opencode (823000/200000, four levels), pi and omp
(omp's minimal sent as off, a tier omp left out), the CI's checks, Qwen's native encoder in lane-templates-check, every
list of lanes, the licences (the draft's card states none), its pages and the v1.62.0 notes. Decisions 1703, 1704, 1707
and 1709 to 1719.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-04 11:58:14 +01:00

62 lines
3.4 KiB
Python

#!/usr/bin/env python3
"""The SGLang text engines open no port for their rendezvous, and keep gloo and NCCL on lo (2026-10-30).
An SGLang engine of one process still sets torch.distributed up, by default through a TCPStore at
tcp://127.0.0.1:<a free port>, and torch makes that store listen on every interface whatever address
it is given: the 27B lane, its container on the host's network, listened on *:23906 with no key on
the reference box, which has no firewall. Both pinned images read SGLANG_DISTRIBUTED_INIT_METHOD_OVERRIDE
(srt/distributed/bootstrap.py, _resolve_dist_init_method; read in the 27B's v0.5.22 and the flash lane's
nightly on 2026-10-30): set to file:///tmp/sglang-rdv, the rendezvous goes through a file in the
container, which --rm makes new at each start, and no port opens for it. The 27B lane started that way
with nothing listening past loopback that FP4-Local alone did not have, and answered (2026-10-30).
"""
import pathlib
import unittest
REPO = pathlib.Path(__file__).resolve().parents[1]
FLAG = "-e SGLANG_DISTRIBUTED_INIT_METHOD_OVERRIDE=file:///tmp/sglang-rdv "
# gloo's and NCCL's bootstrap on lo: under the real clients the 27B lane listened on four ports of the
# reference box's LAN address without it, though the box's name resolves to 127.0.0.1 (2026-10-30), and
# the flash lane and the diffusion lanes did the same.
IFNAMES = "-e GLOO_SOCKET_IFNAME=lo -e NCCL_SOCKET_IFNAME=lo "
def sglang_starts():
"""Every file of the repo that starts an SGLang text engine."""
return sorted(p.name for p in [*REPO.glob("*.template"), REPO / "run.sh"]
if "sglang.launch_server" in p.read_text())
class EveryEngineStartTakesTheFileRendezvous(unittest.TestCase):
def test_the_starts_are_the_ones_this_test_knows(self):
# a new SGLang lane is held to it as soon as its unit exists
self.assertEqual(sglang_starts(), ["qwen38-flash-launch.sh.template", "qwen38-inkling.service.template",
"qwen38-lfm25.service.template", "qwen38-ocr.service.template",
"qwen38-qwen4-35b.service.template", "qwen38-sglang-1m.service.template", "qwen38-sglang-64.service.template",
"qwen38-sglang.service.template", "run.sh"])
def test_each_docker_run_passes_it_once_with_a_fresh_container(self):
for name in sglang_starts():
with self.subTest(name=name):
text = (REPO / name).read_text()
run = text[text.index("docker run"):]
self.assertEqual(run.count(FLAG), 1)
self.assertEqual(run.count(IFNAMES), 1)
# the file is the container's own: new at each start, never one a mount carries over
self.assertIn("docker run --rm ", text)
self.assertNotRegex(run, r"-v [^ ]*:/tmp[ /:]")
def test_the_units_say_why(self):
for name in sglang_starts():
if name == "run.sh":
continue # the native unit's docker run: CI compares their flags and
# values, and the test above their -e lines
with self.subTest(name=name):
text = (REPO / name).read_text()
self.assertIn("SGLANG_DISTRIBUTED_INIT_METHOD_OVERRIDE: the rendezvous of the engine's one process",
text[:text.index("docker run")])
if __name__ == "__main__":
unittest.main()