MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / unpatch_compiled_func

Function unpatch_compiled_func

deepspeed/compile/patch_compiled_func.py:101–110  ·  view source on GitHub ↗

Restore torch.autograd.Function and discard inputs captured for this compile cycle.

()

Source from the content-addressed store, hash-verified

99
100
101def unpatch_compiled_func():
102 """Restore torch.autograd.Function and discard inputs captured for this compile cycle."""
103 global enabled_patched_func
104 enabled_patched_func = False
105
106 global original_grad_fn
107 if original_grad_fn is not None:
108 torch.autograd.Function = original_grad_fn
109 original_grad_fn = None
110 clear_backward_inputs()
111
112
113def get_backward_inputs(frame_key=None):

Calls 1

clear_backward_inputsFunction · 0.85