Skip to content

Commit 261b785

Browse files
authored
Merge pull request #461 from Michael20070814/Fix_Lint_Error
Fix the lint error
2 parents 50e9a4b + c71a2d0 commit 261b785

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ save*
2323
*.pid
2424
*.ipynb*
2525
.venv/
26-
*.sh
26+
*.sh

configs/quantization/methods/KVQuant/rtn_w_a_pertensor_static_naive_quant_kv.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ save:
4444
save_lightllm_kv_calib: True
4545
lightllm_kv_cache_name: kv_cache_calib.json
4646
save_fake: False
47-
save_path: /path/to/save/
47+
save_path: /path/to/save/

llmc/__main__.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
from llmc.data import BaseDataset
1919
from llmc.eval.utils import eval_model, get_eval_list
2020
from llmc.models import *
21-
from llmc.utils import (check_config, deploy_all_modality, get_modality,
22-
mkdirs, print_important_package_version, seed_all,
23-
collect_lightllm_kv_calib_json,
21+
from llmc.utils import (check_config, collect_lightllm_kv_calib_json,
22+
deploy_all_modality, get_modality, mkdirs,
23+
print_important_package_version, seed_all,
2424
update_autoawq_quant_config,
2525
update_lightx2v_quant_config, update_vllm_quant_config)
2626
from llmc.utils.registry_factory import ALGO_REGISTRY, MODEL_REGISTRY
@@ -290,4 +290,3 @@ def main(config):
290290
llmc_duration_time = llmc_end_time - llmc_start_time
291291
logger.info(f'llmc_duration_time: {llmc_duration_time} s')
292292
logger.info('--- llmc finished ---')
293-

llmc/compression/quantization/kvquant.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import copy
2+
23
import torch
34
from loguru import logger
45
from transformers import DynamicCache
@@ -13,7 +14,8 @@ class NaiveQuantKVCache(DynamicCache):
1314
def __init__(self, quant_type, kvquant_cfg, num_hidden_layers, num_samples=128, bsz=1):
1415
super().__init__()
1516

16-
# Copy the config to avoid mutating the original quantization config in static KV calibration.
17+
# Copy the config to avoid mutating the original quantization
18+
# config in static KV calibration.
1719
kvquant_cfg = copy.deepcopy(kvquant_cfg)
1820
assert kvquant_cfg.granularity in ['per_token', 'per_tensor', 'per_group', 'per_head']
1921
self.num_hidden_layers, self.num_samples, self.bsz = (

0 commit comments

Comments
 (0)