[refactor] Adopt get_parallel() everywhere and close out the parallel wrapper surface (#30492)

This commit is contained in:
Cheng Wan
2026-07-09 02:09:39 -07:00
committed by GitHub
parent 06eb1b1838
commit e703f9e566
71 changed files with 341 additions and 415 deletions
@@ -555,15 +555,11 @@ def _capture_eagle_draft_extend_graph_runner(
"sglang.srt.model_executor.runner.decode_cuda_graph_runner.graph_capture",
_single_rank_graph_capture,
),
patch(
"sglang.srt.model_executor.runner.decode_cuda_graph_runner.get_tensor_model_parallel_rank",
lambda: 0,
),
patch(
"sglang.srt.model_executor.runner.decode_cuda_graph_runner.get_available_gpu_memory",
lambda *args, **kwargs: 0.0,
),
get_parallel().override(attn_cp_size=1),
get_parallel().override(attn_cp_size=1, tp_rank=0),
):
_reset_cuda_graph_test_buffers()
return EAGLEDraftExtendCudaGraphRunner(
@@ -437,15 +437,11 @@ def _capture_eagle_draft_graph_runner(
"sglang.srt.model_executor.runner.decode_cuda_graph_runner.graph_capture",
_single_rank_graph_capture,
),
patch(
"sglang.srt.model_executor.runner.decode_cuda_graph_runner.get_tensor_model_parallel_rank",
lambda: 0,
),
patch(
"sglang.srt.model_executor.runner.decode_cuda_graph_runner.get_available_gpu_memory",
lambda *args, **kwargs: 0.0,
),
get_parallel().override(attn_cp_size=1),
get_parallel().override(attn_cp_size=1, tp_rank=0),
):
_reset_cuda_graph_test_buffers()
return EAGLEDraftCudaGraphRunner(
@@ -463,15 +459,11 @@ def _capture_frozen_kv_mtp_graph_runner(
"sglang.srt.model_executor.runner.decode_cuda_graph_runner.graph_capture",
_single_rank_graph_capture,
),
patch(
"sglang.srt.model_executor.runner.decode_cuda_graph_runner.get_tensor_model_parallel_rank",
lambda: 0,
),
patch(
"sglang.srt.model_executor.runner.decode_cuda_graph_runner.get_available_gpu_memory",
lambda *args, **kwargs: 0.0,
),
get_parallel().override(attn_cp_size=1),
get_parallel().override(attn_cp_size=1, tp_rank=0),
):
_reset_cuda_graph_test_buffers()
return FrozenKVMTPCudaGraphRunner(worker)