Skip to content

Commit cc927d7

Browse files
authored
Feature llama 33 (#826)
* added llama 3.3 config * fixed key * added debug point * updated model compatibility notebook * ran format * removed log point
1 parent d0d0750 commit cc927d7

File tree

2 files changed

+32
-6
lines changed

2 files changed

+32
-6
lines changed

demos/Colab_Compatibility.ipynb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,14 @@
5858
},
5959
{
6060
"cell_type": "code",
61-
"execution_count": 2,
61+
"execution_count": 1,
6262
"metadata": {},
6363
"outputs": [
6464
{
6565
"name": "stdout",
6666
"output_type": "stream",
6767
"text": [
68-
"TransformerLens currently supports 205 models out of the box.\n"
68+
"TransformerLens currently supports 206 models out of the box.\n"
6969
]
7070
}
7171
],
@@ -429,6 +429,7 @@
429429
" \"meta-llama/Llama-2-70b-chat-hf\",\n",
430430
" \"meta-llama/Llama-3.1-70B\",\n",
431431
" \"meta-llama/Llama-3.1-70B-Instruct\",\n",
432+
" \"meta-llama/Llama-3.3-70B-Instruct\",\n",
432433
" \"meta-llama/Meta-Llama-3-70B\",\n",
433434
" \"meta-llama/Meta-Llama-3-70B-Instruct\",\n",
434435
" \"mistralai/Mixtral-8x7B-Instruct-v0.1\",\n",

transformer_lens/loading_from_pretrained.py

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,15 @@
151151
"meta-llama/Meta-Llama-3-8B-Instruct",
152152
"meta-llama/Meta-Llama-3-70B",
153153
"meta-llama/Meta-Llama-3-70B-Instruct",
154-
"meta-llama/Llama-3.2-1B",
155-
"meta-llama/Llama-3.2-3B",
156-
"meta-llama/Llama-3.2-1B-Instruct",
157-
"meta-llama/Llama-3.2-3B-Instruct",
158154
"meta-llama/Llama-3.1-70B",
159155
"meta-llama/Llama-3.1-8B",
160156
"meta-llama/Llama-3.1-8B-Instruct",
161157
"meta-llama/Llama-3.1-70B-Instruct",
158+
"meta-llama/Llama-3.2-1B",
159+
"meta-llama/Llama-3.2-3B",
160+
"meta-llama/Llama-3.2-1B-Instruct",
161+
"meta-llama/Llama-3.2-3B-Instruct",
162+
"meta-llama/Llama-3.3-70B-Instruct",
162163
"Baidicoot/Othello-GPT-Transformer-Lens",
163164
"bert-base-cased",
164165
"roneneldan/TinyStories-1M",
@@ -960,6 +961,30 @@ def convert_hf_model_config(model_name: str, **kwargs):
960961
"NTK_by_parts_high_freq_factor": 4.0,
961962
"NTK_by_parts_factor": 32.0,
962963
}
964+
elif "Llama-3.3-70B" in official_model_name:
965+
cfg_dict = {
966+
"d_model": 8192,
967+
"d_head": 128,
968+
"n_heads": 64,
969+
"d_mlp": 28672,
970+
"n_layers": 80,
971+
"n_ctx": 2048, # capped due to memory issues
972+
"eps": 1e-5,
973+
"d_vocab": 128256,
974+
"act_fn": "silu",
975+
"n_key_value_heads": 8,
976+
"normalization_type": "RMS",
977+
"positional_embedding_type": "rotary",
978+
"rotary_adjacent_pairs": False,
979+
"rotary_dim": 32,
980+
"final_rms": True,
981+
"gated_mlp": True,
982+
"rotary_base": 500000.0,
983+
"use_NTK_by_parts_rope": True,
984+
"NTK_by_parts_low_freq_factor": 1.0,
985+
"NTK_by_parts_high_freq_factor": 4.0,
986+
"NTK_by_parts_factor": 8.0,
987+
}
963988
elif "Llama-3.1-8B" in official_model_name:
964989
cfg_dict = {
965990
"d_model": 4096,

0 commit comments

Comments
 (0)