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

quantize: be able to explicitly specify quantization type of output and token embedding tensors #6239

Merged
merged 2 commits into from Mar 22, 2024

Conversation

ikawrakow
Copy link
Contributor

Two new command line options for the quantize tool:

  • --output-tensor-type ggml_type specifies the type of the output tensor
  • --token-embedding-type ggml_type specifies the type of the token embedding tensor

The ggml_type argument is the string that ggml uses to identify the various possible types (q4_0, q4_1, ..., f16, etc., see type_traits in ggml.c.

Can be useful e.g. when comparing with quantization papers (where researchers tend to not worry about these tensors and just leave them at f16), or, if one wants to fine-tune the size vs quality tradeoff (particularly relevant for very low-bit quantization and/or small models). I guess, it could be useful for Gemma as well.

@ggerganov ggerganov merged commit 1d0331c into master Mar 22, 2024
58 checks passed
hodlen pushed a commit to hodlen/llama.cpp that referenced this pull request Apr 1, 2024
…anov#6239)

* quantize: be able to specify the output tensor type

* quantize: be able to specify the token embedding tensor type

---------

Co-authored-by: Iwan Kawrakow <iwan.kawrakow@gmail.com>
hodlen pushed a commit to hodlen/llama.cpp that referenced this pull request Apr 3, 2024
…anov#6239)

* quantize: be able to specify the output tensor type

* quantize: be able to specify the token embedding tensor type

---------

Co-authored-by: Iwan Kawrakow <iwan.kawrakow@gmail.com>
tybalex pushed a commit to tybalex/function.cpp that referenced this pull request Apr 17, 2024
…anov#6239)

* quantize: be able to specify the output tensor type

* quantize: be able to specify the token embedding tensor type

---------

Co-authored-by: Iwan Kawrakow <iwan.kawrakow@gmail.com>
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.

None yet

4 participants