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 Phi 3 128k model #1800

Merged
merged 3 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
18 changes: 18 additions & 0 deletions litgpt/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1660,6 +1660,24 @@ def norm_class(self) -> Type:
sliding_window_size=2048,
sliding_window_layer_placing="all",
),
# https://huggingface.co/microsoft/Phi-3-mini-128k-instruct/blob/main/config.json
dict(
name="Phi-3-mini-128k-instruct",
hf_config=dict(org="microsoft", name="Phi-3-mini-128k-instruct"),
vocab_size=32000,
padded_vocab_size=32064,
block_size=131072,
n_embd=3072,
n_layer=32,
rotary_percentage=1.0,
bias=False,
norm_class_name="RMSNorm",
intermediate_size=8192,
mlp_class_name="LLaMAMLP",
parallel_residual=False,
sliding_window_size=262145,
sliding_window_layer_placing="all",
),
# https://huggingface.co/microsoft/Phi-3.5-mini-instruct/blob/main/config.json
dict(
name="Phi-3.5-mini-instruct",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def test_against_hf_phi(model_name, device, dtype):


@torch.inference_mode()
@pytest.mark.parametrize("model_name", ("Phi-3-mini-4k-instruct", "Phi-3.5-mini-instruct"))
@pytest.mark.parametrize("model_name", ("Phi-3-mini-4k-instruct", "Phi-3-mini-128k-instruct", "Phi-3.5-mini-instruct"))
@pytest.mark.parametrize(
("device", "dtype"),
[
Expand Down
1 change: 1 addition & 0 deletions tutorials/download_model_weights.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ meta-llama/Meta-Llama-3.1-8B
meta-llama/Meta-Llama-3.1-8B-Instruct
microsoft/phi-1_5
microsoft/phi-2
microsoft/Phi-3-mini-128k-instruct
microsoft/Phi-3-mini-4k-instruct
microsoft/Phi-3.5-mini-instruct
mistralai/mathstral-7B-v0.1
Expand Down
Loading