llmcompressor.pipelines.sequential.ast_helpers
Functions:
-
autowrap_forwards
–Replace the
forward
method of the given modules with a recompiled version where
autowrap_forward
Replace the forward
method of the given module with a recompiled version where all untraceble code patterns are removed and replaced with torch.fx function wrappers.
For a list of untraceable code patterns and their explainations, see https://github.com/vllm-project/llm-compressor/pull/1411
Parameters:
-
module
Module
) –module whose forward method should be replaced
-
ignore
List[str]
) –explicit list of function names to wrap
Source code in llmcompressor/pipelines/sequential/ast_helpers.py
autowrap_forwards
Replace the forward
method of the given modules with a recompiled version where all untraceble code patterns are removed and replaced with torch.fx function wrappers
Parameters:
-
modules
List[Module]
) –list of modules whose forward methods should be replaced
-
ignore
List[str]
) –explicit list of function names to wrap