Skip to content

Commit

Permalink
add phi2 modeling changes to the qeff (quic#56)
Browse files Browse the repository at this point in the history
Signed-off-by: vbaddi <quic_vbaddi@quicinc.com>
  • Loading branch information
vbaddi authored Jul 2, 2024
1 parent 604c7f0 commit 6846c8a
Show file tree
Hide file tree
Showing 4 changed files with 397 additions and 0 deletions.
7 changes: 7 additions & 0 deletions QEfficient/transformers/modeling_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
MixtralSparseMoeBlock,
)
from transformers.models.mpt.modeling_mpt import MptAttention, MptBlock, MptForCausalLM, MptModel
from transformers.models.phi.modeling_phi import PhiAttention, PhiForCausalLM, PhiModel
from transformers.models.phi3.modeling_phi3 import Phi3Attention, Phi3ForCausalLM, Phi3Model, Phi3RMSNorm
from transformers.models.qwen2.modeling_qwen2 import Qwen2Attention, Qwen2ForCausalLM, Qwen2Model, Qwen2RMSNorm
from transformers.models.starcoder2.modeling_starcoder2 import (
Expand Down Expand Up @@ -75,6 +76,7 @@
QEffMixtralSparseMoeBlock,
)
from .models.mpt.modeling_mpt import QEffMptAttention, QEffMptBlock, QEffMptForCausalLM, QEFfMptModel
from .models.phi.modeling_phi import QEffPhiAttention, QEffPhiForCausalLM, QEffPhiModel
from .models.phi3.modeling_phi3 import QEffPhi3Attention, QEffPhi3ForCausalLM, QEffPhi3Model
from .models.qwen2.modeling_qwen2 import QEffQwen2Attention, QEffQwen2ForCausalLM, QEffQwen2Model
from .models.starcoder2.modeling_starcoder2 import (
Expand All @@ -97,6 +99,7 @@
MistralForCausalLM.__name__,
MixtralForCausalLM.__name__,
Phi3ForCausalLM.__name__,
PhiForCausalLM.__name__,
FalconForCausalLM.__name__,
Qwen2ForCausalLM.__name__,
Starcoder2ForCausalLM.__name__,
Expand Down Expand Up @@ -145,6 +148,10 @@
Phi3Model: QEffPhi3Model,
Phi3ForCausalLM: QEffPhi3ForCausalLM,
Phi3RMSNorm: CustomRMSNormAIC,
# Phi model layers
PhiAttention: QEffPhiAttention,
PhiModel: QEffPhiModel,
PhiForCausalLM: QEffPhiForCausalLM,
# Falcon model layers
FalconAttention: QEffFalconAttention,
FalconForCausalLM: QEffFalconForCausalLM,
Expand Down
6 changes: 6 additions & 0 deletions QEfficient/transformers/models/phi/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# -----------------------------------------------------------------------------
#
# Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
#
# -----------------------------------------------------------------------------
Loading

0 comments on commit 6846c8a

Please sign in to comment.