BELLE icon indicating copy to clipboard operation
BELLE copied to clipboard

为什么belle-7B显存占用这么大

Open bulubulu-Li opened this issue 1 year ago • 1 comments

我注意到BELLE-7B-2M需要占用24G显存

然而chatglm-6B(fp16精度)只需要14G

两者只相差1B参数,为什么呢?

求解答

bulubulu-Li avatar May 22 '23 08:05 bulubulu-Li

应该是belle的用的模型是全精度fp32的llama,你可以看这个代码llama权重是fp32的: https://github.com/huggingface/transformers/blob/main/src/transformers/models/llama/modeling_llama.py,同样一个浮点数全精度的存储消耗肯定是半精度的两倍。

nadcy avatar May 25 '23 02:05 nadcy