llmcompressor.modeling.fuse
center_embeddings(embedding)
Shift each embedding to have a mean of zero
Parameters:
Name | Type | Description | Default |
---|---|---|---|
embedding | Module | embedding module containing embeddings to center | required |
Source code in llmcompressor/modeling/fuse.py
fuse_norm_linears(norm, linears)
Fuse the scaling operation of norm layer into subsequent linear layers. This useful for ensuring transform invariance between norm and linear layers.
Note that unitary transforms (rotation) commute with normalization, but not scaling
Parameters:
Name | Type | Description | Default |
---|---|---|---|
norm | Module | norm layer whose weight will be fused into subsequent linears | required |
linears | Iterable[Linear] | linear layers which directly follow the norm layer | required |