hooks
¶
Modules¶
fastvideo.hooks.hooks
¶
Classes¶
fastvideo.hooks.hooks.ForwardHook
¶
Base class for forward hooks. Hooks are used in the way: modified_args, modified_kwargs = hook.pre_forward(module, args, kwargs) output = module.forward(modified_args, **modified_kwargs) modified_output = hook.post_forward(module, output)
Functions¶
fastvideo.hooks.hooks.ForwardHook.on_attach
¶ fastvideo.hooks.hooks.ForwardHook.on_detach
¶Called once when the hook is detached from the module. Note: this function is not guaranteed to be called if the module is deleted before the hook is detached.
fastvideo.hooks.hooks.ForwardHook.post_forward
¶ fastvideo.hooks.hooks.ForwardHook.pre_forward
¶
fastvideo.hooks.layerwise_offload
¶
Classes¶
fastvideo.hooks.layerwise_offload.LayerwiseOffloadHook
¶
Bases: ForwardHook
A hook that enables layerwise CPU offloading during forward pass.