Skip to content

Commit ab98dff

Browse files
Fix lint and fmt
Signed-off-by: Thara Palanivel <[email protected]>
1 parent 50aea62 commit ab98dff

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

fms_mo/custom_ext_kernels/utils.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ def exllama_ops_load_and_reg(qcfg=None, run_unit_test=False):
500500
1. need to install gptqmodel python package
501501
2. Op registration signature changed drastically from torch 2.1 - 2.4. TODO: add 2.4 support
502502
503-
see https://github.com/ModelCloud/GPTQModel/tree/main?tab=readme-ov-file for installation instructions
503+
see https://github.com/ModelCloud/GPTQModel for installation instructions
504504
"""
505505
if qcfg is None:
506506
qcfg = {}
@@ -509,7 +509,9 @@ def exllama_ops_load_and_reg(qcfg=None, run_unit_test=False):
509509

510510
namespace = "gptqmodel_gemm"
511511
# check before compile
512-
if hasattr(torch.ops, namespace) and hasattr(torch.ops.gptqmodel_gemm, "exv1_i4f16"):
512+
if hasattr(torch.ops, namespace) and hasattr(
513+
torch.ops.gptqmodel_gemm, "exv1_i4f16"
514+
):
513515
logger.info("Custom GPTQModel functions have been loaded already!")
514516
qcfg["GPTQMODEL_AVAILABLE"] = True
515517
need_registration = False
@@ -623,7 +625,8 @@ def exv2_i4f16_fxinputs_abstract(
623625
)
624626

625627
logger.info(
626-
f"New GPTQModel gemm functions have been loaded and registered to torch.ops.{namespace}."
628+
f"New GPTQModel gemm functions have been loaded and registered to \
629+
torch.ops.{namespace}."
627630
)
628631
if qcfg:
629632
qcfg["GPTQMODEL_AVAILABLE"] = True
@@ -1110,10 +1113,14 @@ def swap_nnlinear_to_quantlinear(model, qconfig, prefix=None, qlinear2use=None):
11101113
QuantLinear = qlinear2use
11111114
elif exVer == 1:
11121115
# Third Party
1113-
from gptqmodel.nn_modules.qlinear.exllama import ExllamaQuantLinear as QuantLinear
1116+
from gptqmodel.nn_modules.qlinear.exllama import (
1117+
ExllamaQuantLinear as QuantLinear,
1118+
)
11141119
else:
11151120
# Third Party
1116-
from gptqmodel.nn_modules.qlinear.exllamav2 import ExllamaV2QuantLinear as QuantLinear
1121+
from gptqmodel.nn_modules.qlinear.exllamav2 import (
1122+
ExllamaV2QuantLinear as QuantLinear,
1123+
)
11171124

11181125
num_swapped = 0
11191126
for n, m in model.named_modules():

fms_mo/modules/linear.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1402,14 +1402,14 @@ def forward(self, x: torch.Tensor) -> torch.Tensor:
14021402

14031403
try:
14041404
# Third Party
1405+
from exllama_kernels import prepare_buffers, set_tuning_params
14051406
from gptqmodel.nn_modules.qlinear.exllama import (
14061407
ExllamaQuantLinear as QLinearExllamaV1,
14071408
)
14081409
from gptqmodel.nn_modules.qlinear.exllamav2 import (
14091410
ExllamaV2QuantLinear as QLinearExllamaV2,
14101411
)
14111412
from gptqmodel.nn_modules.qlinear.exllamav2 import ext_gemm_half_q_half
1412-
from exllama_kernels import prepare_buffers, set_tuning_params
14131413
from transformers.pytorch_utils import Conv1D
14141414

14151415
class QLinearExv1WI4AF16(QLinearExllamaV1):

fms_mo/run_quant.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def quantize(
8989
raise ImportError(
9090
"Quantization method has been selected as gptq but unable to use external library, "
9191
"gptqmodel module not found. For more instructions on installing the appropriate "
92-
"package, see https://github.com/ModelCloud/GPTQModel/tree/main?tab=readme-ov-file#install"
92+
"package, see https://github.com/ModelCloud/GPTQModel"
9393
)
9494
run_gptq(model_args, data_args, opt_args, gptq_args)
9595
elif opt_args.quant_method == "fp8":
@@ -98,7 +98,7 @@ def quantize(
9898
"Quantization method has been selected as fp8 but unable to use external library, "
9999
"llmcompressor module not found. \n"
100100
"For more instructions on installing the appropriate package, see "
101-
"https://github.com/vllm-project/llm-compressor/tree/"
101+
"https://github.com/vllm-project/llm-compressor"
102102
"main?tab=readme-ov-file#installation"
103103
)
104104
run_fp8(model_args, data_args, opt_args, fp8_args)

0 commit comments

Comments
 (0)