Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Q8 Weight Quantization #24

Merged
merged 9 commits into from
Feb 26, 2024
Merged

Q8 Weight Quantization #24

merged 9 commits into from
Feb 26, 2024

Conversation

jafioti
Copy link
Owner

@jafioti jafioti commented Feb 26, 2024

This PR adds support for 8 bit quantization in the ggml q8_0 format. The main changes are MetalQuantizedCompiler which takes a set of weights and converts downstream matmuls and gathers to QuantizedMatmuls and QuantizedGathers. Each op takes in weights in q8, and does dequantization internally.

In the mistral example, there is a MetalQ8Loader which demonstrates how to load from q q8 gguf file, and returns the set of weight nodes.

Mistral Decode Speed on M1 Pro: Average token generated in 56.18ms - (17.80 tok/s)

@jafioti jafioti merged commit 5ede551 into main Feb 26, 2024
1 check passed
@jafioti jafioti deleted the q8 branch February 26, 2024 20:33
@jafioti jafioti mentioned this pull request Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant