Unverified Commit 1bf2dd9d authored by Blueyo0's avatar Blueyo0 Committed by GitHub
Browse files

[Gemma2] add bitsandbytes support for Gemma2 (#8338)

parent 5a60699c
...@@ -312,6 +312,14 @@ class Gemma2ForCausalLM(nn.Module, SupportsLoRA): ...@@ -312,6 +312,14 @@ class Gemma2ForCausalLM(nn.Module, SupportsLoRA):
# Gemma does not apply LoRA to the embedding layer. # Gemma does not apply LoRA to the embedding layer.
embedding_modules = {} embedding_modules = {}
embedding_padding_modules = [] embedding_padding_modules = []
bitsandbytes_stacked_params_mapping = {
# shard_name, weight_name, index
"q_proj": ("qkv_proj", 0),
"k_proj": ("qkv_proj", 1),
"v_proj": ("qkv_proj", 2),
"gate_proj": ("gate_up_proj", 0),
"up_proj": ("gate_up_proj", 1),
}
def __init__( def __init__(
self, self,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment