config: read resolved config via namespace accessors (#33013)

This commit is contained in:
Cheng Wan
2026-07-31 15:06:59 -07:00
committed by GitHub
parent 4862edc85f
commit 55b6769b0e
187 changed files with 1110 additions and 923 deletions
@@ -117,8 +117,17 @@ class TestMambaRatioEnvGate(unittest.TestCase):
enable_mamba_extra_buffer_lazy=lambda: lazy,
)
fake = SimpleNamespace(server_args=server_args)
# The bag reads (disable_radix_cache / disable_overlap_schedule) come
# from the published context; the derived-method calls stay on the
# injected stand-in.
from sglang.srt import runtime_context as rc
with envs.SGLANG_OPT_MAMBA_SKIP_DECODE_LOCK.override(skip):
return KVCacheConfigurator._calculate_mamba_ratio(fake)
with rc.get_context().override_server_args(
disable_radix_cache=False,
disable_overlap_schedule=disable_overlap,
):
return KVCacheConfigurator._calculate_mamba_ratio(fake)
def test_flag_off_restores_original_ratios(self):
r = lambda **kw: self._ratio(skip=False, **kw)