[edge-infer] WIP snapshot: uncommitted M0/W1/W4/W5 edge work as of 2026-09-18

Verbatim copy of the edge/omni-edge working tree (tracked diffs + untracked
edge/local, tests/edge/local, docs/edge, pipeline files). Taken so that
vLLM-Omni v0.29.0rc1 can be merged on a branch without touching the
user's working tree. logs_edge/ and benchmark .npy outputs excluded.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
tzhouamandClaude Fable 5.1 committed 2026-09-18 09:47:29 +08:00
1 parent 3834de3105
commit 4e3e8a1ebc
62 files changed
+11043 -56

No files matched your search

+16 -1
View File
@@ -1169,7 +1169,22 @@ def launch_stage_replica(
from vllm_omni.engine.stage_engine_core_proc_manager import StageEngineCoreProcManager
addresses = get_engine_zmq_addresses(vllm_config)
# [edge-infer W1] Ask for concrete ports, not "tcp://host:0" placeholders.
#
# vLLM mints ":0" by default and expects the *consumer* to bind, recover the
# kernel-assigned port via zmq.LAST_ENDPOINT and write it back before the
# engine handshake -- a recovery that needs
# client_addresses["actual_address_pipe"]. This colocated path cannot do it:
# it starts the child *first*, handing it the raw placeholder, and
# StageRuntime._client_addresses_from_zmq never passes that pipe. The child
# then "connects" to port 0, nothing is ever transmitted, and the client
# waits out VLLM_ENGINE_READY_TIMEOUT_S for a ready message that cannot come.
#
# No-op on Linux, where client_local_only is true and _addr() takes the
# ipc:// branch regardless of this flag -- which is exactly why the bug is
# invisible until the engine runs somewhere without ipc:// (measured: native
# Windows mints ":0" here, WSL mints real ipc:// paths).
addresses = get_engine_zmq_addresses(vllm_config, defer_api_server_ports=False)
handshake_address = get_open_zmq_ipc_path()
engines_to_handshake = [CoreEngine(index=0, local=True)]
with scoped_spawn_device_env(stage_visible_devices, spawn_device_lock, stage_id=stage_id, replica_id=replica_id):
+8 -3
View File
@@ -12,7 +12,12 @@ out of StageEngineCoreClient into reusable functions.
from __future__ import annotations
import copy
import fcntl
# [edge-infer W1] fcntl does not exist on Windows; this module is in the
# import closure of AsyncOmni, so the bare import makes the engine
# unimportable before anything can be configured. The locking logic is
# sound and torch-free -- only the primitive changes. The shim keeps the
# BlockingIOError contract this file's stale-lock path depends on.
from vllm_omni._filelock_compat import flock_exclusive_nb, funlock
import importlib
import json
import multiprocessing as mp
@@ -1750,7 +1755,7 @@ def acquire_device_locks(
try:
lock_fd, lock_writable = open_device_lock_file(lock_file)
try:
fcntl.flock(lock_fd, fcntl.LOCK_EX | fcntl.LOCK_NB)
flock_exclusive_nb(lock_fd)
record_lock_holder_pid(lock_fd, lock_writable)
lock_acquired = True
lock_fds.append(lock_fd)
@@ -1803,7 +1808,7 @@ def release_device_locks(lock_fds: list[int]) -> None:
"""Release file locks acquired by acquire_device_locks."""
for lock_fd in lock_fds:
try:
fcntl.flock(lock_fd, fcntl.LOCK_UN)
funlock(lock_fd)
os.close(lock_fd)
logger.debug("Released initialization lock (fd=%s)", lock_fd)
except (OSError, ValueError):