From e0c388076ec3881fef1490f596b2d680877ca55b Mon Sep 17 00:00:00 2001 From: laoyao0822 Date: Sat, 13 Jun 2026 01:02:56 +0800 Subject: [PATCH] Keep CP compose on CUDA IPC after syh rebasing The syh branch still passed symm writer metadata into the RAGGED MLA partial-current compose path. After rebasing the CUDA IPC staging path, those keyword arguments no longer belong to the runtime contract and would raise at runtime before reaching the IPC compose implementation. Constraint: Main-stream CP shared-KV compose should use the measured CUDA IPC staging path; symm remains an experimental/benchmark path. Rejected: Keep writer-rank arguments behind the symm env | the runtime signature has been restored to the IPC contract and the env-gated symm compose is not the production default. Confidence: high Scope-risk: narrow Tested: python -m py_compile nsa_backend.py cp_shared_kv_runtime.py cp_shared_kv_prefetch.py nsa_indexer.py Not-tested: Local pytest blocked by missing orjson in this environment; remote CUDA/ETE not run in this step --- .../srt/layers/attention/nsa_backend.py | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/python/sglang/srt/layers/attention/nsa_backend.py b/python/sglang/srt/layers/attention/nsa_backend.py index 06a1259a2..e160cc400 100644 --- a/python/sglang/srt/layers/attention/nsa_backend.py +++ b/python/sglang/srt/layers/attention/nsa_backend.py @@ -37,7 +37,6 @@ from sglang.srt.layers.attention.nsa.cp_shared_kv_runtime import ( mask_batch_logical_pages_to_valid_lengths, materialize_prefix_and_reuse_current_kv_page_slots, materialize_shared_token_kv_buffer, - maybe_build_current_page_writer_ranks, pack_current_mla_kv_for_reuse, tensor_debug_checksum, tensor_debug_summary, @@ -2115,19 +2114,6 @@ class NativeSparseAttnBackend( current_slot_spans=current_slot_spans, layer_id=layer.layer_id, nvtx_source="mla.current_only_page_slots", - current_page_writer_ranks=( - maybe_build_current_page_writer_ranks( - forward_batch=forward_batch, - prefix_lens_cpu=getattr( - forward_batch, "extend_prefix_lens_cpu", None - ), - extend_lens_cpu=getattr( - forward_batch, "extend_seq_lens_cpu", None - ), - page_size=page_size, - layout=forward_batch.cp_shared_kv_layout, - ) - ), ) ) else: @@ -2274,15 +2260,6 @@ class NativeSparseAttnBackend( prefix_slot_spans=prefix_slot_spans, current_slot_spans=current_slot_spans, layer_id=layer.layer_id, - current_page_writer_ranks=( - maybe_build_current_page_writer_ranks( - forward_batch=forward_batch, - prefix_lens_cpu=prefix_lens_cpu, - extend_lens_cpu=extend_lens_cpu, - page_size=page_size, - layout=forward_batch.cp_shared_kv_layout, - ) - ), ) ) if (