Skip to content

Commit 4beb6fa

Browse files
Add model support Multilingual-Multimodal-NLP/IndustrialCoder-32B in huggingface (#455)
* support model Multilingual-Multimodal-NLP/IndustrialCoder-32B with vllm * Add IndustrialCoder configs and run script * all * all * quantize Industral-Coder-Thinging * Delete thinkingmodel * Update .gitignore * style: satisfy pre-commit after main merge --------- Co-authored-by: Yang Yong (雍洋) <yongyang1030@163.com>
1 parent 350c47b commit 4beb6fa

16 files changed

Lines changed: 190 additions & 35 deletions

File tree

‎configs/quantization/video_gen/wan_i2v/awq_w_a.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ quant:
4646
clip_sym: True
4747
save:
4848
save_lightx2v: True
49-
save_path: /path/to/x2v/
49+
save_path: /path/to/x2v/

‎configs/quantization/video_gen/wan_t2v/awq_w_a.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ quant:
4646
clip_sym: True
4747
save:
4848
save_lightx2v: True
49-
save_path: /path/to/x2v/
49+
save_path: /path/to/x2v/

‎configs/quantization/video_gen/wan_t2v/rtn_w_a.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ quant:
2929
granularity: per_token
3030
save:
3131
save_lightx2v: True
32-
save_path: /path/to/x2v/
32+
save_path: /path/to/x2v/

‎configs/quantization/video_gen/wan_t2v/smoothquant_w_a.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ quant:
4242
alpha: 0.7
4343
save:
4444
save_lightx2v: True
45-
save_path: /path/to/x2v/
45+
save_path: /path/to/x2v/

‎llmc/compression/quantization/base_blockwise_quantization.py‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,7 @@
3535
_TRANSFORMERS_LN_TYPES_, EffcientFakeQuantLinear,
3636
FakeQuantLinear, LlmcActFn, OriginFloatLinear,
3737
RotateLinear)
38-
from .quant import (
39-
FloatQuantizer,
40-
IntegerQuantizer,
41-
Weight48IntegerQuantizer,
42-
)
38+
from .quant import FloatQuantizer, IntegerQuantizer, Weight48IntegerQuantizer
4339

4440

4541
class BaseBlockwiseQuantization(BlockwiseOpt):

‎llmc/compression/quantization/module_utils.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,14 @@ def __repr__(self):
446446
return 'LlmcQwen2RMSNorm()'
447447

448448

449+
class LlmcIndustrialCoderRMSNorm(LlmcLlamaRMSNorm):
450+
def __init__(self, weight, eps=1e-6):
451+
super().__init__(weight, eps)
452+
453+
def __repr__(self):
454+
return 'LlmcIndustrialCoderRMSNorm()'
455+
456+
449457
class LlmcMixtralRMSNorm(LlmcLlamaRMSNorm):
450458
def __init__(self, weight, eps=1e-6):
451459
super().__init__(weight, eps)
@@ -1187,6 +1195,7 @@ def __repr__(self):
11871195
'Mixtral': LlmcMixtralRMSNorm,
11881196
'Interlm2': LlmcInternLM2RMSNorm,
11891197
'Qwen2': LlmcQwen2RMSNorm,
1198+
'IndustrialCoder': LlmcIndustrialCoderRMSNorm,
11901199
'Gemma2': LlmcGemma2RMSNorm,
11911200
'MiniCPM': LlmcMiniCPMRMSNorm,
11921201
'Starcoder': LlmcLayerNorm,

‎llmc/data/dataset/base_dataset.py‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
from abc import ABCMeta
44

55
import torch
6-
from datasets import load_dataset, load_from_disk
76
from loguru import logger
87
from PIL import Image
98
from torch.nn import functional as F
109

10+
from datasets import load_dataset, load_from_disk
11+
1112
from .specified_preproc import PREPROC_REGISTRY
1213

1314

@@ -172,9 +173,10 @@ def get_batch_process(self, samples):
172173
return calib_model_inputs
173174

174175
def get_calib_dataset(self):
175-
samples = self.calib_dataset[
176-
int(os.environ['RANK'])::int(os.environ['WORLD_SIZE'])
177-
]
176+
samples = self.calib_dataset.shard(
177+
num_shards=int(os.environ['WORLD_SIZE']),
178+
index=int(os.environ['RANK'])
179+
)
178180
logger.info(f'len(samples) rank : {len(samples)}')
179181

180182
calib_model_inputs = self.get_calib_model_inputs(samples)

‎llmc/eval/eval_base.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55

66
import torch
77
import torch.nn as nn
8-
from datasets import load_dataset, load_from_disk
98
from human_eval.data import read_problems
109
from loguru import logger
1110

11+
from datasets import load_dataset, load_from_disk
12+
1213

1314
class BaseEval:
1415
def __init__(self, model, config):

‎llmc/eval/eval_ppl.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33

44
import torch
55
import torch.nn as nn
6-
from datasets import load_dataset, load_from_disk
76
from loguru import logger
87
from tqdm import tqdm
98

9+
from datasets import load_dataset, load_from_disk
10+
1011
from .eval_base import BaseEval
1112

1213

‎llmc/models/__init__.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from .falcon import Falcon
66
from .gemma2 import Gemma2
77
from .glm4v import GLM4V
8+
from .industrialcoder import IndustrialCoder
89
from .internlm2 import InternLM2
910
from .internomni import InternOmni
1011
from .internvl2 import InternVL2
@@ -35,6 +36,6 @@
3536
from .videollava import VideoLLaVA
3637
from .vila import Vila
3738
from .vit import Vit
39+
from .wan2_2_t2v import Wan2T2V
3840
from .wan_i2v import WanI2V
3941
from .wan_t2v import WanT2V
40-
from .wan2_2_t2v import Wan2T2V

0 commit comments

Comments
 (0)