Skip to content

Commit a06f774

Browse files
committed
Inital commit
Signed-off-by: Amit Raj <[email protected]>
1 parent 8369da9 commit a06f774

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

QEfficient/base/pytorch_transforms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def mutate(cls, original_module: nn.Module, parent_module: nn.Module):
9090
raise NotImplementedError("Please implement your own method by inheriting this class")
9191

9292

93-
class ModuleMethodMapperTransform(PytorchTransform):
93+
class ExternalModuleMapperTransform(PytorchTransform):
9494
"""
9595
Serves as base class for any transform that want to map a particular method of a class to a new method implementation.
9696
"""
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -----------------------------------------------------------------------------
22
#
3-
# Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
3+
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
44
# SPDX-License-Identifier: BSD-3-Clause
55
#
6-
# -----------------------------------------------------------------------------
6+
# ----------------------------------------------------------------------------
77

QEfficient/transformers/models/grok_1/modeling_grok1.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# -----------------------------------------------------------------------------
22
#
3-
# Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
3+
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
44
# SPDX-License-Identifier: BSD-3-Clause
55
#
6-
# -----------------------------------------------------------------------------
6+
# ----------------------------------------------------------------------------
7+
78
from typing import List, Optional, Tuple, Union
89

910
import torch

QEfficient/transformers/models/modeling_auto.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
)
3737
from QEfficient.transformers.models.pytorch_transforms import (
3838
CustomOpsTransform,
39-
KVCacheModuleMethodMapperTransform,
39+
KVCacheExternalModuleMapperTransform,
4040
KVCacheTransform,
4141
SpDTransform,
4242
VlmKVOffloadTransform,
@@ -403,7 +403,7 @@ class QEffVisionEncoderForTextImageToTextModel(QEFFBaseModel):
403403
GPTQToMatmulNbitsTransform,
404404
CustomOpsTransform,
405405
KVCacheTransform,
406-
KVCacheModuleMethodMapperTransform,
406+
KVCacheExternalModuleMapperTransform,
407407
]
408408
_onnx_transforms = [FP16ClipTransform, SplitTensorsTransform]
409409

@@ -863,7 +863,7 @@ class _QEFFAutoModelForImageTextToTextSingleQPC(QEFFTransformersBase, Multimodal
863863
GPTQToMatmulNbitsTransform,
864864
CustomOpsTransform,
865865
KVCacheTransform,
866-
KVCacheModuleMethodMapperTransform,
866+
KVCacheExternalModuleMapperTransform,
867867
VlmNoKVOffloadTransform,
868868
]
869869
_onnx_transforms = [FP16ClipTransform, SplitTensorsTransform]
@@ -1299,7 +1299,7 @@ class QEFFAutoModelForCausalLM(QEFFBaseModel):
12991299
FP8DeQuantLinearToLinearTransform,
13001300
CustomOpsTransform,
13011301
KVCacheTransform,
1302-
KVCacheModuleMethodMapperTransform,
1302+
KVCacheExternalModuleMapperTransform,
13031303
]
13041304
_onnx_transforms = [FP16ClipTransform, SplitTensorsTransform]
13051305

QEfficient/transformers/models/pytorch_transforms.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131
WhisperPositionalEmbedding,
132132
)
133133

134-
from QEfficient.base.pytorch_transforms import ModuleMappingTransform, ModuleMethodMapperTransform
134+
from QEfficient.base.pytorch_transforms import ModuleMappingTransform, ExternalModuleMapperTransform
135135
from QEfficient.customop import CustomRMSNormAIC, GemmaCustomRMSNormAIC
136136
from QEfficient.transformers.models.codegen.modeling_codegen import (
137137
QEffCodeGenAttention,
@@ -480,7 +480,7 @@ class VlmNoKVOffloadTransform(ModuleMappingTransform):
480480
}
481481

482482

483-
class KVCacheModuleMethodMapperTransform(ModuleMethodMapperTransform):
483+
class KVCacheExternalModuleMapperTransform(ExternalModuleMapperTransform):
484484
_match_string_replace_method = {
485485
"InternVLChatModel": {
486486
"forward": QEffInternVLModel.forward,

0 commit comments

Comments
 (0)