Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gemma2 in Nemo2 with Recipes #11037

Merged
merged 16 commits into from
Oct 30, 2024
10 changes: 10 additions & 0 deletions nemo/collections/llm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@
CodeLlamaConfig13B,
CodeLlamaConfig34B,
CodeLlamaConfig70B,
Gemma2Config,
Gemma2Config2B,
Gemma2Config9B,
Gemma2Config27B,
Gemma2Model,
GemmaConfig,
GemmaConfig2B,
GemmaConfig7B,
Expand Down Expand Up @@ -165,6 +170,11 @@
"CodeGemmaConfig2B",
"CodeGemmaConfig7B",
"GemmaModel",
"Gemma2Model",
"Gemma2Config9B",
"Gemma2Config",
"Gemma2Config27B",
"Gemma2Config2B",
"Baichuan2Config",
"Baichuan2Config7B",
"Baichuan2Model",
Expand Down
12 changes: 12 additions & 0 deletions nemo/collections/llm/gpt/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@
GemmaConfig7B,
GemmaModel,
)
from nemo.collections.llm.gpt.model.gemma2 import (
Gemma2Config,
Gemma2Config2B,
Gemma2Config9B,
Gemma2Config27B,
Gemma2Model,
)
from nemo.collections.llm.gpt.model.hf_auto_model_for_causal_lm import HfAutoModelForCausalLM
from nemo.collections.llm.gpt.model.llama import (
CodeLlamaConfig7B,
Expand Down Expand Up @@ -142,6 +149,11 @@
"CodeGemmaConfig2B",
"CodeGemmaConfig7B",
"GemmaModel",
"Gemma2Config",
"Gemma2Config27B",
"Gemma2Config2B",
"Gemma2Config9B",
"Gemma2Model",
"LlamaModel",
"Baichuan2Config",
"Baichuan2Config7B",
Expand Down
2 changes: 1 addition & 1 deletion nemo/collections/llm/gpt/model/gemma.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def make_vocab_size_divisible_by(vocab_size):
rotary_base=source.rope_theta,
gated_linear_unit=True,
make_vocab_size_divisible_by=make_vocab_size_divisible_by(source.vocab_size),
share_embeddings_and_output_weights=False,
share_embeddings_and_output_weights=True,
fp16=(dtype_from_hf(source) == torch.float16),
bf16=(dtype_from_hf(source) == torch.bfloat16),
params_dtype=dtype_from_hf(source),
Expand Down
Loading
Loading