Baichuan-13B
Baichuan-13B copied to clipboard
8bit量化加载后推理速度变慢
使用如下方式加载模型,但是推理速度变慢约1.5倍,且模型性能下降明显,是真么原因呢? tokenizer = AutoTokenizer.from_pretrained(model_path, use_fast=False, trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained( model_path, load_in_4bit=False, load_in_8bit=True, device_map='auto', max_memory={i: '24000MB' for i in range(torch.cuda.device_count())}, torch_dtype=torch.float32, trust_remote_code=True ).eval() model.generation_config = GenerationConfig.from_pretrained(model_path) # print(model.generation_config)
return tokenizer, model
显卡配置:V100 32G显存
遇到同样的问题,求答案。
量化后,除了显存占用降低,GPU使用率不会下降,基本都在100%,而推理速度有2倍以上的降低。
不符合预期。
一样的问题,推理速度很慢。另外试图使用多线程跑点数据,显存飙升太厉害
显卡配置:V100 32G显存
可以用nsight分析一些具体是哪里慢了
同样的问题,输入3K,大概是1.5分钟,有没有大佬有法子?
请问大家解决了吗?