Modalities / modalities

Modalities, a PyTorch-native framework for distributed and reproducible foundation model training.
MIT License
63 stars 8 forks source link

Lora: Support merged linear layers #244

Open rrutmann opened 2 months ago

rrutmann commented 2 months ago

Feature request

Currently, all linear layers that are specified in our training config to be adapted for Lora are converted to type LoraLinearLayer. There might be cases, where different matrices are combined into one linear layer for efficiency (e.g. q, k, v in the attention layer are combined in a single layer q_k_v). Such layers have to be treated differently and should therefore be converted to LoraMergedLinearLayer instead.

Motivation

-