[feature] Add layerwise NVTX support (#11870)
This commit is contained in:
@@ -149,6 +149,7 @@ from sglang.srt.utils import (
|
||||
slow_rank_detector,
|
||||
xpu_has_xmx_support,
|
||||
)
|
||||
from sglang.srt.utils.nvtx_pytorch_hooks import PytHooks
|
||||
from sglang.srt.utils.offloader import (
|
||||
create_offloader_from_server_args,
|
||||
get_offloader,
|
||||
@@ -772,6 +773,11 @@ class ModelRunner:
|
||||
|
||||
get_offloader().post_init()
|
||||
|
||||
# Register model for layerwise NVTX profiling if enabled
|
||||
if self.server_args.enable_layerwise_nvtx_marker:
|
||||
self.pyt_hooks = PytHooks()
|
||||
self.pyt_hooks.register_hooks(self.model, module_prefix="model")
|
||||
|
||||
if self.server_args.kv_cache_dtype == "fp8_e4m3":
|
||||
if self.server_args.quantization_param_path is not None:
|
||||
if callable(getattr(self.model, "load_kv_cache_scales", None)):
|
||||
|
||||
Reference in New Issue
Block a user