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

[MODEL]add mobilellm support #509

Merged
merged 2 commits into from
Nov 1, 2024
Merged
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
Next Next commit
add mobilellm support
LRL-ModelCloud committed Nov 1, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 2960e4dbebfe1b4d7e6c867a9d3943a45bb56524
1 change: 1 addition & 0 deletions gptqmodel/models/_const.py
Original file line number Diff line number Diff line change
@@ -59,6 +59,7 @@ def get_device_by_type(type_value: str):
"grinmoe",
"mllama",
"granite",
"mobilellm",
]

EXLLAMA_DEFAULT_MAX_INPUT_LENGTH = 2048
2 changes: 2 additions & 0 deletions gptqmodel/models/auto.py
Original file line number Diff line number Diff line change
@@ -45,6 +45,7 @@
from .definitions.starcoder2 import Starcoder2GPTQ
from .definitions.xverse import XverseGPTQ
from .definitions.yi import YiGPTQ
from .definitions.mobilellm import MobileLLMGPTQ

MODEL_MAP = {
"bloom": BloomGPTQ,
@@ -89,6 +90,7 @@
"grinmoe": GrinMOEGPTQ,
"mllama": MLlamaGPTQ,
"granite": GraniteGPTQ,
"mobilellm": MobileLLMGPTQ,
}


3 changes: 2 additions & 1 deletion gptqmodel/models/definitions/__init__.py
Original file line number Diff line number Diff line change
@@ -36,4 +36,5 @@
from .stablelmepoch import StableLMEpochGPTQ
from .starcoder2 import Starcoder2GPTQ
from .xverse import XverseGPTQ
from .yi import YiGPTQ
from .yi import YiGPTQ
from .mobilellm import MobileLLMGPTQ
16 changes: 16 additions & 0 deletions gptqmodel/models/definitions/mobilellm.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from ..base import BaseGPTQModel


class MobileLLMGPTQ(BaseGPTQModel):
require_trust_remote_code = True

base_modules = ["model.embed_tokens", "model.norm"]

layers_node = "model.layers"
layer_type = "LlamaDecoderLayer"
layer_modules = [
["self_attn.k_proj", "self_attn.v_proj", "self_attn.q_proj"],
["self_attn.o_proj"],
["mlp.up_proj", "mlp.gate_proj"],
["mlp.down_proj"],
]