[Model] Fix Baichuan BNB online quantization (#10572)

Signed-off-by: Chen Wu <cntryroa@gmail.com>
This commit is contained in:
Chen Wu
2024-11-23 13:13:59 +08:00
committed by GitHub
parent 7d8ffb344f
commit cfea9c04ef

View File

@ -350,6 +350,21 @@ class BaiChuanBaseForCausalLM(nn.Module, SupportsLoRA, SupportsPP):
embedding_modules = {}
embedding_padding_modules = []
# BitandBytes specific attributes
default_bitsandbytes_target_modules = [
".W_pack.",
".o_proj.",
".down_proj.",
".up_proj.",
".gate_proj.",
".up_proj.",
]
bitsandbytes_stacked_params_mapping = {
# shard_name, weight_name, index
"gate_proj": ("gate_up_proj", 0),
"up_proj": ("gate_up_proj", 1),
}
def __init__(
self,
*,