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

Function patch_compiled_func

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

Source from the content-addressed store, hash-verified

72
73
74def patch_compiled_func():
75
76 global enabled_patched_func
77 enabled_patched_func = True
78
79 class PatchedFunction(torch.autograd.Function, metaclass=FunctionMeta):
80 pass
81
82 global original_grad_fn
83 original_grad_fn = torch.autograd.Function
84 torch.autograd.Function = PatchedFunction
85
86 return backward_inputs
87
88
89def register_backward_frame(frame_key):

Calls

no outgoing calls