Remove temporary CP cache-hit trace instrumentation
The GSM8K/cache-hit debugging pass added request-correlation logs across scheduler, radix, HiCache, Mooncake, and prefill handoff. The root cause work has moved to request-slot remap semantics, so those high-cardinality traces are no longer needed in the runtime diff. This removes the temporary tracing helpers and call sites while leaving existing fail-fast checks, fallback warnings, and explicit debug/timing infrastructure that is still part of normal CP shared-KV diagnostics. Constraint: Production CP hot paths should not carry investigation-only request signatures or transfer summaries Rejected: Keep all debug logs gated by env | even gated logs increase maintenance surface and encourage stale diagnosis paths Confidence: high Scope-risk: moderate Directive: Reintroduce request-correlation logs only as a narrow opt-in probe with a planned removal point Tested: Local py_compile for touched runtime files; remote py_compile; remote pytest test_cp_shared_kv_runtime.py, test_nsa_cp_utils.py, test_cp_shared_kv_layout.py => 263 passed, 5 warnings, 2 subtests passed Not-tested: Long-running ETE log-volume comparison after removal
This commit is contained in:
@@ -64,21 +64,6 @@ def _cp_draft_shared_kv_debug(message: str, *args, limit: int = 64) -> None:
|
||||
logger.info("[CP_DRAFT_SHARED_KV] " + message, *args)
|
||||
|
||||
|
||||
def _cp_shared_kv_bs_gt1_mooncake_debug(
|
||||
key: str, message: str, *args, limit: Optional[int] = None
|
||||
) -> None:
|
||||
if not envs.SGLANG_CP_SHARED_KV_BS_GT1_DEBUG.get():
|
||||
return
|
||||
if limit is None:
|
||||
limit = int(envs.SGLANG_CP_SHARED_KV_BS_GT1_DEBUG_LIMIT.get())
|
||||
count_key = "bs_gt1:" + key
|
||||
count = _CP_SHARED_DEBUG_COUNTS.get(count_key, 0)
|
||||
if limit > 0 and count >= limit:
|
||||
return
|
||||
_CP_SHARED_DEBUG_COUNTS[count_key] = count + 1
|
||||
logger.info("[CP_SHARED_KV_BS_GT1_DEBUG] event=%s " + message, key, *args)
|
||||
|
||||
|
||||
def _mooncake_transfer_stats_enabled() -> bool:
|
||||
return envs.SGLANG_DISAGGREGATION_TRANSFER_STATS.get()
|
||||
|
||||
@@ -1226,19 +1211,6 @@ class MooncakeKVManager(CommonKVManager):
|
||||
_np_summary(chunked_dst_kv_indice),
|
||||
kv_chunk.is_last_chunk,
|
||||
)
|
||||
_cp_shared_kv_bs_gt1_mooncake_debug(
|
||||
"transfer_worker_kv",
|
||||
"cp_rank=%s room=%s prefill_pages=%s "
|
||||
"logical_positions=%s dst_pages=%s is_last=%s "
|
||||
"session=%s",
|
||||
self.attn_cp_rank,
|
||||
kv_chunk.room,
|
||||
_np_summary(kv_chunk.prefill_kv_indices),
|
||||
_np_summary(kv_chunk.logical_page_positions),
|
||||
_np_summary(chunked_dst_kv_indice),
|
||||
kv_chunk.is_last_chunk,
|
||||
req.mooncake_session_id,
|
||||
)
|
||||
if envs.SGLANG_DEBUG_CP_SHARED_KV.get():
|
||||
_cp_shared_debug_log(
|
||||
"transfer_worker_kv",
|
||||
@@ -1354,18 +1326,6 @@ class MooncakeKVManager(CommonKVManager):
|
||||
),
|
||||
_np_summary(dst_state_indices),
|
||||
)
|
||||
_cp_shared_kv_bs_gt1_mooncake_debug(
|
||||
"transfer_worker_state",
|
||||
"cp_rank=%s room=%s prefill_state_pages=%s "
|
||||
"state_positions=%s dst_state_pages=%s "
|
||||
"session=%s",
|
||||
self.attn_cp_rank,
|
||||
kv_chunk.room,
|
||||
_np_summary(kv_chunk.state_indices),
|
||||
_np_summary(kv_chunk.state_logical_page_positions),
|
||||
_np_summary(dst_state_indices),
|
||||
req.mooncake_session_id,
|
||||
)
|
||||
self.maybe_send_extra(
|
||||
req,
|
||||
kv_chunk.state_indices,
|
||||
@@ -1746,22 +1706,6 @@ class MooncakeKVSender(CommonKVSender):
|
||||
is_last_chunk,
|
||||
getattr(self.kv_mgr.kv_args, "draft_kv_buffer_count", None),
|
||||
)
|
||||
_cp_shared_kv_bs_gt1_mooncake_debug(
|
||||
"sender_filter",
|
||||
"cp_rank=%s room=%s page_start=%s orig_kv_pages=%s "
|
||||
"filtered_kv_pages=%s kv_positions=%s orig_state_pages=%s "
|
||||
"filtered_state_pages=%s state_positions=%s is_last=%s",
|
||||
self.kv_mgr.attn_cp_rank,
|
||||
self.bootstrap_room,
|
||||
chunk_page_start,
|
||||
_np_summary(orig_kv_indices),
|
||||
_np_summary(kv_indices),
|
||||
_np_summary(logical_page_positions),
|
||||
_np_summary(orig_state_indices),
|
||||
_np_summary(state_indices),
|
||||
_np_summary(state_logical_page_positions),
|
||||
is_last_chunk,
|
||||
)
|
||||
# Special handling for cp
|
||||
elif self.kv_mgr.enable_all_cp_ranks_for_transfer:
|
||||
kv_indices, index_slice = filter_kv_indices_for_cp_rank(
|
||||
|
||||
Reference in New Issue
Block a user