llmcompressor.modifiers.awq.mappings
Classes:
-
AWQMapping–Dataclass storing config of activation mappings to smooth
Functions:
-
get_layer_mappings_from_architecture–:param architecture: str: The architecture of the model
AWQMapping dataclass
Dataclass storing config of activation mappings to smooth The output activations of smooth_layer are input activations into the balance_layers
AWQMappings are resolved into ResolvedMappings, which retain pointers to the actual torch.nn.Modules and additional metadata at runtime
ResolvedMapping dataclass
ResolvedMapping(
smooth_name: str,
smooth_layer: Module,
balance_layers: List[Module],
balance_names: Optional[List[str]] = None,
parent: Optional[Module] = None,
parent_name: Optional[str] = None,
)
Dataclass for storing the resolved mappings between an activation layer and the following weights that must be balanced during smoothing
Parameters:
-
(smooth_namestr) –name of the activation layer
-
(smooth_layerModule) –PyTorch module storing the activation layer
-
(balance_layersList[Module]) –list of PyTorch modules that smooth_layer feeds into, must be balanced to offset the smoothing of smooth_layer
-
(balance_namesOptional[List[str]], default:None) –optional list of names of the balance_layers
-
(parentOptional[Module], default:None) –parent module of the balance_layers
-
(parent_nameOptional[str], default:None) –name of the parent module
get_layer_mappings_from_architecture
Parameters:
-
(architecturestr) –str: The architecture of the model
Returns:
-
List[AWQMapping]–list: The layer mappings for the given architecture