Skip to content

llmcompressor.modifiers.smoothquant.utils

Backwards compatibility shim for SmoothQuantModifier utils module.

This module has been moved to llmcompressor.modifiers.transform.smoothquant.utils. This shim will be removed in a future version.

Functions:

get_layer_mappings_from_architecture

get_layer_mappings_from_architecture(
    architecture: str,
) -> list[LayerMap]

Parameters:

  • architecture

    (str) –

    str: The architecture of the model

Returns:

  • list[LayerMap]

    list: The layer mappings for the given architecture

Source code in llmcompressor/modifiers/transform/smoothquant/utils.py
def get_layer_mappings_from_architecture(architecture: str) -> list[LayerMap]:
    """
    :param architecture: str: The architecture of the model
    :return: list: The layer mappings for the given architecture
    """

    if architecture not in MAPPINGS_REGISTRY:
        logger.info(
            f"Architecture {architecture} not found in mappings. "
            f"Using default mappings: {DEFAULT_SMOOTHQUANT_MAPPINGS}"
        )

    return MAPPINGS_REGISTRY.get(architecture, DEFAULT_SMOOTHQUANT_MAPPINGS)