llama.cpp icon indicating copy to clipboard operation
llama.cpp copied to clipboard

Double Quantization for exisiting models (.37 bits per parameter)

Open shenron0101 opened this issue 2 years ago • 3 comments

Motivation and Feature Description

There are currently means of quantizing models to a much lower precision. Some libraries already have this functionality but in a training context. Would it be possible to port this feature to this repository? Currently the maximum quantization that we have access to is 2 bits. But with Double quantization this can increase. Someone can correct me if im going off the rails here.

Enabled with bitsandbytes. Check out the paper to learn more about how it works.

"dq" stands for "Double Quantization" which reduces the average memory footprint by quantizing the quantization constants. In average, this amounts to about 0.37 bits per parameter (approximately 3 GB for a 65B model).

Quote from link

Possible Implementation

The Code from bitsandbytes shows that the code they have written only works on GPU but is able to perform double quantization. I have found the code here for it.

shenron0101 avatar Apr 09 '24 09:04 shenron0101

What application for a .37 bit quant? I cannot think off one

sorasoras avatar Apr 09 '24 12:04 sorasoras

Lower model size. Allowing users to run even larger models on smaller machines...

shenron0101 avatar Apr 10 '24 01:04 shenron0101

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar May 25 '24 01:05 github-actions[bot]