Files
sglang/test/registered
laoyao0822 3fc7a5c18c Move CP shared-KV prefetch reduce into attention overlap
Phase8 prefetch was starting local materialization and the CP all-reduce from the same late hook, after rank-skewed MQA/topk/materialize work had already separated CP ranks. This commit separates local prefix materialization from reduce launch, starts next-layer prefetch earlier in MLA prepare, and explicitly launches pending MLA/index reduces at attention boundaries so the collectives can overlap the intended window instead of drifting behind skewed ranks.

Constraint: Prefetch remains optional and gated by the existing CP shared-KV prefetch environment controls.

Constraint: Profiling required per-source materialize all-reduce ranges, so NVTX labels are gated behind SGLANG_CP_SHARED_KV_MATERIALIZE_NVTX.

Rejected: Launch all-reduce immediately in start_next_layer_prefix | this reproduced the old skew-sensitive timing and could put prefetch behind current-layer work.

Rejected: Remove later hooks entirely | they are still needed as fallbacks when the early MLA prepare hook is bypassed.

Confidence: medium

Scope-risk: moderate

Directive: Preserve the consume-time fallback launch; otherwise missed launch paths silently lose correctness or overlap.

Tested: Remote g0034 docker py_compile for changed SGLang files; python -m pytest -q test/registered/unit/mem_cache/test_cp_shared_kv_runtime.py -q (50 passed).

Not-tested: Full GLM5 multi-node prefill/decode profile after this exact commit.
2026-05-12 20:31:19 +08:00
..
2026-03-21 17:10:35 +08:00

Registered Tests

Tests under this directory are auto-discovered by run_suite.py via CI registration decorators.

Where Should I Put My New Test?

No server / engine launch required

What you're testing Directory Requires
Component logic in isolation (cache, scheduler, config, parser, etc.) unit/<module>/ CPU or GPU
CUDA kernel correctness kernels/ GPU

Server / engine launch required (E2E)

What you're testing Directory Requires
Model inference correctness models/, 4-gpu-models/, 8-gpu-models/ GPU
Feature-specific (OpenAI API, LoRA, speculative, distributed, VLM, etc.) openai_server/, lora/, spec/, distributed/, ... GPU
Benchmarks (performance, accuracy, stress) benchmark/ GPU
Platform-specific amd/, ascend/ Vendor GPU

See unit/README.md for unit test conventions.