Conditionally recapture cuda graph after model weight update from disk (#12060)

This commit is contained in:
harrisonlimh
2025-11-03 05:51:27 -08:00
committed by GitHub
parent 14d8064803
commit ffb32a8548
3 changed files with 7 additions and 1 deletions

View File

@@ -862,6 +862,7 @@ class ModelRunner:
model_path: str,
load_format: str,
weight_name_filter: Optional[Callable[[str], bool]] = None,
recapture_cuda_graph: bool = False,
) -> tuple[bool, str]:
"""Update engine weights in-place from the disk."""
logger.info(
@@ -917,6 +918,9 @@ class ModelRunner:
self.server_args.load_format = load_format
self.load_config = load_config
if recapture_cuda_graph and self.device == "cuda":
self.init_device_graphs()
logger.info("Update weights end.")
return True, "Succeeded to update model weights."