[Rebase] Row dump removed, lint, knob read-site census

The debug PLE row dump is deleted; ruff findings on fork lines cleared; a
read-site census test pins which fork knobs are read and where.

Co-Authored-By: Hinata <hinata@idihore.id>
Signed-off-by: MOVZX <movzx@yahoo.com>
This commit is contained in:
2026-10-09 20:01:43 +07:00
co-authored by Hinata
parent 7f6055caa2
commit e3fcd7e3ae
9 changed files with 172 additions and 165 deletions
+30 -17
View File
@@ -345,8 +345,10 @@ if TYPE_CHECKING:
# catch-all branch in _get_ple_embedding_quant_method, which lived in the
# half of models/qwen4_exp/nvidia/ple_layer.py that #54371 deleted. With no
# reader it cannot change an artifact, so hashing it would only invalidate
# caches for nothing; and on this uncompiled NVIDIA path (#55272) there may
# be no AOT artifact to key at all. It gives NO capture protection either.
# caches for nothing. (The AOT artifact is real on this tree: #55272
# removed torch.compile from the NVIDIA Qwen4Exp path, the compile-profile guard restored it,
# and the vLLM 0.30 rebase ran AOT cache-load boots -- so the reason is "no
# reader", not "no artifact".) It gives NO capture protection either.
# v0.30.0 selects the FP8 PLE method from the CONFIG KEY
# text_config.ple_embedding_dtype == "float8_e4m3fn"
# (ngram_embedding.py:174-175) -- see
@@ -434,14 +436,12 @@ if TYPE_CHECKING:
# cross-change knob table). Each mirrors its read site's
# parse; if a read site changes, the entry here must be reconciled.
# (Both read sites below are now live.)
# *** INERT ON THE 0.30 BASE: NO READ SITE. ***
# Its reader is the slot-ownership assertion code (an earlier commit), which edits
# vllm/v1/ple_offload/connector.py -- a module that does not exist on
# v0.30.0. Setting this on the 0.30 base does NOTHING, and NOTHING WARNS
# (validate_environ only reports UNregistered names). Already an ignored
# factor, correctly. Kept registered so the contract is recorded; it
# becomes live again only together with the pull transport
# (the PLE transport choice).
# LIVE: read once at
# import as envs.VLLM_E2_PLE_FLAG_CHECK by vllm/v1/ple_offload/connector.py
# (the PLE pull-transport flag check, rank-gated, off by default). On
# the 0.30 base it had NO read site: the PLE-diagnostics half
# had not been relanded after the PLE pull-transport port restored connector.py. The
# census in tests/test_envs.py now asserts the read site exists.
# AOT: no. CAPTURE: no -- strictly host-side and outside capture.
# off|warn|raise (1 = warn), normalised by _e2_diagnostic_mode like the
# rest of the family. The mamba ownership check moved this gate off a plain
@@ -492,6 +492,9 @@ if TYPE_CHECKING:
VLLM_NIC_SELECTION_VARS: str = ""
VLLM_ENABLE_HPC_OPS: bool = False
MERLIN_TOPK_EXACT_COUNTERS_LOG: int = 0
# Pre-tie-determinism fallback for the counter reader's slot count; runtime-only
# (ignored factor), never consulted on this build. See the dict entry.
MERLIN_TOPK_COUNTER_SLOTS: str | None = None
#
# --- determinism toggles -----------------------------------------
# The three nondeterminism mechanisms (FULL_K, QSA_SORT, TIE_DET/TIE_RECENT).
@@ -561,11 +564,13 @@ if TYPE_CHECKING:
# The same restart on an overflowing DECODE row.
MERLIN_TOPK_EXACT_DECODE: str | None = None
# Deterministic placement and tie membership on the LARGE path.
# Registered here ahead of its code, exactly as the four toggles above
# were, so the full tree is complete; its read site is
# det_large_enabled() in topk.cu on the large path. Setting it without that
# code does nothing, which is why it is a passthrough and not a parsed
# bool that would imply this tree can act on it.
# LIVE on this tree since the v2.2 kernel port: the
# read site is det_large_enabled() in csrc/libtorch_stable/topk.cu, a
# std::getenv resolved once per process, and the resolved value reaches
# the large-path radix_topk as a launch argument, so a cudagraph bakes it
# in. CAPTURE: yes. AOT: not established (built into the extension, not by
# the AOT compiler); hashed conservatively like the switches above. A raw
# passthrough because the C++ getter is the single source of truth.
MERLIN_TOPK_DET_LARGE: str | None = None
#
# The large-path FAULT INJECTORS. TEST
@@ -611,8 +616,8 @@ if TYPE_CHECKING:
# without first deleting it from the fence -- which means writing down its
# AOT and capture identity against its real read site -- is the exact
# failure the fork's env rule exists to prevent, and
# tests/test_envs.py::test_unaudited_host_side_knob_stays_listed_until_it_is_classified
# fails on it.
# test_unaudited_host_side_knob_stays_listed_until_it_is_classified (in
# tests/test_envs.py) fails on it.
#
# The fence holds NOTHING BUT the names, one per line. Prose belongs out
# here: the gate reads the fence as a set of identifiers, and a knob name
@@ -2661,6 +2666,11 @@ environment_variables: dict[str, Callable[[], Any]] = {
"MERLIN_TOPK_EXACT_COUNTERS_LOG": lambda: int(
os.getenv("MERLIN_TOPK_EXACT_COUNTERS_LOG", "0")
),
# Fallback slot count for the counter reader on a build WITHOUT the
# persistent_topk_exact_counters_slots op (pre-tie-determinism). This tree registers
# that op, so topk_counters.slot_count() never consults the variable here.
# Raw passthrough: the reader's int(os.getenv(..., "5")) is the parser.
"MERLIN_TOPK_COUNTER_SLOTS": lambda: os.getenv("MERLIN_TOPK_COUNTER_SLOTS", None),
# Determinism toggles. See the declaration block above for the AOT /
# capture classification and for why three of these are raw passthroughs.
# All four are absent from ignored_factors on purpose, so all four are
@@ -2898,6 +2908,9 @@ def compile_factors() -> dict[str, object]:
# host-side timer and a snapshot op, and is read by no compiled code, so
# hashing it would invalidate every compile cache for a log interval.
"MERLIN_TOPK_EXACT_COUNTERS_LOG",
# Host-side reader fallback (buffer length for a snapshot op outside
# capture); dead on a build that answers the _slots query.
"MERLIN_TOPK_COUNTER_SLOTS",
# ------------------------------------------------------------------
"FORCE_COLOR",
}