diff --git a/docs/advanced_features/nsa_prefill_cp_page_aligned_cache_contract.md b/docs/advanced_features/nsa_prefill_cp_page_aligned_cache_contract.md index c7b3b19f4..90bac0e9a 100644 --- a/docs/advanced_features/nsa_prefill_cp_page_aligned_cache_contract.md +++ b/docs/advanced_features/nsa_prefill_cp_page_aligned_cache_contract.md @@ -1966,3 +1966,20 @@ C32 correction update: transfer surfaces are registered. - Synced `prefill.py` and `decode.py` to remote `g0034:/mnt/beegfs/cjy/sglang-dev`; remote container py_compile passed for the updated files. + +### C33. EAGLE accept startup diagnostic must read speculative config from scheduler-owned state + +Finding: + +- Enabling `SGLANG_EAGLE_ACCEPT_DEBUG=1` caused prefill startup to fail in `PrefillBootstrapQueue._init_kv_manager()` with `AttributeError: 'PrefillBootstrapQueue' object has no attribute 'spec_algorithm'`. +- The diagnostic added in C32 incorrectly assumed the bootstrap/prealloc queue objects expose `self.spec_algorithm`. They only retain `self.scheduler`; the speculative algorithm lives on `self.scheduler.spec_algorithm` in these queue classes. +- The same incorrect diagnostic reference existed in `DecodePreallocQueue._init_kv_manager()`, which would have produced the analogous decode startup failure under the same debug env. + +Correction: + +- Read `self.scheduler.spec_algorithm.is_eagle()` in both prefill and decode KV-manager startup audits. +- This is a diagnostic-path-only fix. It does not change KV registration, cache ownership, transfer, prefetch, or EAGLE acceptance behavior. + +Guardrail: + +- Future diagnostics inside disaggregation helper queues should use scheduler-owned runtime state unless the queue constructor explicitly copies that state onto `self`. diff --git a/python/sglang/srt/disaggregation/decode.py b/python/sglang/srt/disaggregation/decode.py index cfb9495b6..069983be2 100644 --- a/python/sglang/srt/disaggregation/decode.py +++ b/python/sglang/srt/disaggregation/decode.py @@ -509,7 +509,7 @@ class DecodePreallocQueue: len(kv_args.state_data_ptrs), ) - if envs.SGLANG_EAGLE_ACCEPT_DEBUG.get() and self.spec_algorithm.is_eagle(): + if envs.SGLANG_EAGLE_ACCEPT_DEBUG.get() and self.scheduler.spec_algorithm.is_eagle(): logger.info( "[EAGLE_ACCEPT_DEBUG] decode_kv_manager cp_rank=%s " "target_kv_bufs=%s draft_kv_bufs=%s total_kv_bufs=%s " diff --git a/python/sglang/srt/disaggregation/prefill.py b/python/sglang/srt/disaggregation/prefill.py index 21bc2407b..b47ba5948 100644 --- a/python/sglang/srt/disaggregation/prefill.py +++ b/python/sglang/srt/disaggregation/prefill.py @@ -350,7 +350,7 @@ class PrefillBootstrapQueue: len(kv_args.state_data_ptrs), ) - if envs.SGLANG_EAGLE_ACCEPT_DEBUG.get() and self.spec_algorithm.is_eagle(): + if envs.SGLANG_EAGLE_ACCEPT_DEBUG.get() and self.scheduler.spec_algorithm.is_eagle(): logger.info( "[EAGLE_ACCEPT_DEBUG] prefill_kv_manager cp_rank=%s " "target_kv_bufs=%s draft_kv_bufs=%s total_kv_bufs=%s "