Gemma#
Googleβs Gemma is a family of open-weight language models built on the same research and technology as Gemini. Gemma models are available in multiple sizes and versions, with improvements in each generation including local sliding window attention (Gemma 2) and interleaved global/local attention (Gemma 3).
Task |
Text Generation |
Architecture |
|
Parameters |
1B β 27B |
HF Org |
Available Models#
Gemma 3: 1B, 4B, 12B, 27B
Gemma 2: 2B, 9B, 27B
Gemma (v1): 2B, 7B
Architectures#
GemmaForCausalLMβ Gemma v1Gemma2ForCausalLMβ Gemma 2Gemma3ForCausalLMβ Gemma 3
Example HF Models#
Model |
HF ID |
|---|---|
Gemma 1.1 2B IT |
|
Gemma 2B |
|
Gemma 2 9B IT |
|
Gemma 2 27B |
|
Gemma 3 1B IT |
|
Gemma 3 4B IT |
|
Gemma 3 27B IT |
Example Recipes#
Recipe |
Description |
|---|---|
SFT β Gemma 2 9B IT on SQuAD |
|
LoRA β Gemma 2 9B IT on SQuAD |
|
SFT β Gemma 3 270M on SQuAD |
|
LoRA β Gemma 3 270M on SQuAD |
Try with NeMo AutoModel#
1. Install (full instructions):
pip install nemo-automodel
2. Clone the repo to get the example recipes:
git clone https://github.com/NVIDIA-NeMo/Automodel.git
cd Automodel
3. Run the recipe from inside the repo:
automodel --nproc-per-node=8 examples/llm_finetune/gemma/gemma_2_9b_it_squad.yaml
Run with Docker
1. Pull the container and mount a checkpoint directory:
docker run --gpus all -it --rm \
--shm-size=8g \
-v $(pwd)/checkpoints:/opt/Automodel/checkpoints \
nvcr.io/nvidia/nemo-automodel:26.02.00
2. Navigate to the AutoModel directory (where the recipes are):
cd /opt/Automodel
3. Run the recipe:
automodel --nproc-per-node=8 examples/llm_finetune/gemma/gemma_2_9b_it_squad.yaml
See the Installation Guide and LLM Fine-Tuning Guide.
Fine-Tuning#
See the LLM Fine-Tuning Guide for full SFT and LoRA instructions.