Skip to content

Commit

Permalink
phi moe support for multipack
Browse files Browse the repository at this point in the history
  • Loading branch information
winglian committed Aug 26, 2024
1 parent 17af1d7 commit 4dd4495
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/axolotl/common/architectures.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"JetMoeMoE",
],
"mixtral": "MixtralSparseMoeBlock",
"phimoe": "PhiMoESparseMoeBlock",
"qwen2_moe": "Qwen2MoeSparseMoeBlock",
"deepseek_v2": "DeepseekV2MoE",
}
3 changes: 3 additions & 0 deletions src/axolotl/monkeypatch/multipack.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"falcon",
"phi",
"phi3",
"phimoe",
"gemma",
"gemma2",
"gemmoe",
Expand All @@ -31,6 +32,8 @@ def patch_for_multipack(model_type, model_name=None, is_remote_code=False):
patch_remote(model_name, ".configuration_gemmoe", ".modeling_gemmoe")
elif model_type == "deepseek_v2":
patch_remote(model_name, ".configuration_deepseek", ".modeling_deepseek")
elif model_type == "phimoe":
patch_remote(model_name, ".configuration_phimoe", ".modeling_phimoe")
elif hasattr(transformers, "modeling_flash_attention_utils") and not is_remote_code:
transformers.modeling_flash_attention_utils._get_unpad_data = ( # pylint: disable=protected-access
get_unpad_data
Expand Down

0 comments on commit 4dd4495

Please sign in to comment.