llmcompressor.pipelines.sequential.ast_helpers
autowrap_forward(module, ignore)
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:
Name | Type | Description | Default |
---|---|---|---|
module | Module | module whose forward method should be replaced | required |
ignore | List[str] | explicit list of function names to wrap | required |
Source code in llmcompressor/pipelines/sequential/ast_helpers.py
autowrap_forwards(modules, ignore)
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:
Name | Type | Description | Default |
---|---|---|---|
modules | List[Module] | list of modules whose forward methods should be replaced | required |
ignore | List[str] | explicit list of function names to wrap | required |