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

Add int8 models to Llama2 and Llama3 #1734

Merged
merged 2 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions keras_nlp/src/models/llama/llama_presets.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@
},
"kaggle_handle": "kaggle://keras/llama2/keras/llama2_7b_en/1",
},
"llama2_7b_en_int8": {
"metadata": {
"description": "LLaMA 2 7B Quantized Base model",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe LLaMA 2 7B base model with weight quantized to int8.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have updated the description to follow Gemma's convention.

Additionally, I used "with activation and weights quantized to int8." to indicate that we are using dynamic int8 quantization instead of weights-only quantization.

WDYT?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sgtm!

"params": 6739839488,
"official_name": "LLaMA 2",
"path": "llama2",
"model_card": "https://github.com/meta-llama/llama",
},
"kaggle_handle": "kaggle://keras/llama2/keras/llama2_7b_en_int8/1",
},
"llama2_instruct_7b_en": {
"metadata": {
"description": "LLaMA 2 7B Chat model",
Expand All @@ -35,6 +45,16 @@
},
"kaggle_handle": "kaggle://keras/llama2/keras/llama2_instruct_7b_en/1",
},
"llama2_instruct_7b_en_int8": {
"metadata": {
"description": "LLaMA 2 7B Quantized Chat model",
"params": 6739839488,
"official_name": "LLaMA 2",
"path": "llama2",
"model_card": "https://github.com/meta-llama/llama",
},
"kaggle_handle": "kaggle://keras/llama2/keras/llama2_instruct_7b_en_int8/1",
},
"vicuna_1.5_7b_en": {
"metadata": {
"description": "Vicuna v1.5 7B Chat model",
Expand Down
20 changes: 20 additions & 0 deletions keras_nlp/src/models/llama3/llama3_presets.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@
},
"kaggle_handle": "kaggle://keras/llama3/keras/llama3_8b_en/3",
},
"llama3_8b_en_int8": {
"metadata": {
"description": "LLaMA 3 8B Quantized Base model",
"params": 8031894016,
"official_name": "LLaMA 3",
"path": "llama3",
"model_card": "https://github.com/meta-llama/llama3",
},
"kaggle_handle": "kaggle://keras/llama3/keras/llama3_8b_en_int8/1",
},
"llama3_instruct_8b_en": {
"metadata": {
"description": "LLaMA 3 8B Instruct model",
Expand All @@ -35,4 +45,14 @@
},
"kaggle_handle": "kaggle://keras/llama3/keras/llama3_instruct_8b_en/3",
},
"llama3_instruct_8b_en_int8": {
"metadata": {
"description": "LLaMA 3 8B Quantized Instruct model",
"params": 8031894016,
"official_name": "LLaMA 3",
"path": "llama3",
"model_card": "https://github.com/meta-llama/llama3",
},
"kaggle_handle": "kaggle://keras/llama3/keras/llama3_instruct_8b_en_int8/1",
},
}
Loading