Add opt-in CUDA-graph capture-trace export (#28551)

This commit is contained in:
Lucia Fang
2026-06-18 18:51:14 -07:00
committed by GitHub
parent 6b7ecca663
commit 1c8551169d
3 changed files with 36 additions and 0 deletions
@@ -101,6 +101,7 @@ from sglang.srt.utils import (
require_mlp_sync,
require_mlp_tp_gather,
)
from sglang.srt.utils.profile_utils import export_cuda_graph_capture_trace
try:
from kt_kernel import KTMoEWrapper
@@ -604,6 +605,16 @@ class DecodeCudaGraphRunner(BaseCudaGraphRunner):
)
logger.info(log_message)
# Optionally persist the shaped capture trace (record_shapes=True) for
# offline per-kernel analysis -- opt-in via
# SGLANG_ENABLE_CUDA_GRAPH_CAPTURE_TRACE; the in-log tables above are
# unchanged.
export_cuda_graph_capture_trace(
prof_context,
runner_name=type(self).__name__,
tp_rank=get_tensor_model_parallel_rank(),
)
def capture_prepare(
self,
size: int,