Fix autograd retention in CUDA graph capture tail hooks (#43854)

This commit is contained in:
ix-48
2026-10-12 12:31:18 -07:00
committed by GitHub
parent 0efbb3d2b9
commit b60444c621
+3
View File
@@ -1086,6 +1086,9 @@ class Scheduler(
if self.draft_worker is not None:
self.draft_worker.init_attention_backends()
# Not DynamicGradMode: tensors created under inference mode here could not
# be written in place by the no_grad disagg event loops.
@torch.no_grad()
def init_all_cuda_graphs(self):
"""Capture cuda graphs for all workers."""
self.tp_worker.init_cuda_graphs()