llmcompressor.modifiers.autoround.utils
Functions:
-
fix_attention_mask–Normalize attention masks for AutoRound custom datasets.
-
init_gpu_group_dist–Initialize DDP for AutoRound's rank-local GPU grouping.
fix_attention_mask
Normalize attention masks for AutoRound custom datasets.
AutoRound expects at least one masked position when the calibration mask is fully dense. When every token is marked valid, set the final position to 0 while preserving the original dtype and shape. More details can be found here: https://github.com/intel/auto-round/blob/50ee58c9e176e9da2a744dbe6ed220f26e80eccd/auto_round/calibration/llm.py#L315-L355
Source code in src/llmcompressor/modifiers/autoround/utils.py
init_gpu_group_dist
Initialize DDP for AutoRound's rank-local GPU grouping.
Standard DDP binds each rank to LOCAL_RANK. AutoRound can instead use a
rank-local group of GPUs to tune a single decoding block, so the process group
must be initialized on LOCAL_RANK * gpus_per_group from the start.