Skip to main content

量化

sglang v0.5.1 版本上quantation gptq 不再依赖 vllm 模块 https://github.com/sgl-project/sglang/pull/9191

import sys
from transformers import AutoConfig

model=sys.argv[1]
print(model)
config = AutoConfig.from_pretrained(model)

print(config)

config中可以看到:

"quantization_config": {
"batch_size": 1,
"bits": 4,
"block_name_to_quantize": null,
"cache_block_outputs": true,
"damp_percent": 0.1,
"dataset": null,
"desc_act": false,
"exllama_config": {
"version": 1
},
"group_size": 128,
"max_input_length": null,
"model_seqlen": null,
"module_name_preceding_first_block": null,
"modules_in_block_to_quantize": null,
"pad_token_id": null,
"quant_method": "gptq",
"sym": true,
"tokenizer": null,
"true_sequential": true,
"use_cuda_fp16": false,
"use_exllama": true
},