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

Function patch_compiled_func

deepspeed/compile/patch_compiled_func.py:81–93  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

79
80
81def patch_compiled_func():
82
83 global enabled_patched_func
84 enabled_patched_func = True
85
86 class PatchedFunction(torch.autograd.Function, metaclass=FunctionMeta):
87 pass
88
89 global original_grad_fn
90 original_grad_fn = torch.autograd.Function
91 torch.autograd.Function = PatchedFunction
92
93 return backward_inputs
94
95
96def register_backward_frame(frame_key):

Calls

no outgoing calls