ggml : fix MUL_MAT_ID repack with Q8_K#12544
Merged
Merged
Conversation
Member
Author
|
@Djip007 Could you take a look at these fixes? |
Djip007
reviewed
Mar 24, 2025
| INTER_SIZE); | ||
| } | ||
| } else { | ||
| GGML_ASSERT(PARAM_TYPE == GGML_TYPE_Q8_0); |
Contributor
There was a problem hiding this comment.
For C++ I'll use in this case
if constexpr (PARAM_TYPE == GGML_TYPE_Q8_0) { ... }
if constexpr (PARAM_TYPE == GGML_TYPE_Q8_K) { ... }and if this is the only to possible may may be some
static_assert( (PARAM_TYPE == GGML_TYPE_Q8_K) || (PARAM_TYPE == GGML_TYPE_Q8_0), "comment");but it may be trap by adding gem[v/m] PARAM_TYPE as template param
Contributor
There was a problem hiding this comment.
may be remove the if and change (transforme) the quantize_mat_q8_K/quantize_mat_q8_0 to template quantize_mat<PARAM_TYPE>
template <ggml_type PARAM_TYPE>
void quantize_mat(...);
tempate<> quantize_mat<GGML_TYPE_Q8_0>(...) {
quantize_mat_q8_0(...); // or "inline" it.
}
tempate<> quantize_mat<GGML_TYPE_Q8_0>(...) {
quantize_mat_q8_K(...);
}
|
|
||
| // instance for IQ4 | ||
| static const tensor_traits<block_iq4_nl, 4, 4, GGML_TYPE_IQ4_NL> iq4_nl_4x4_q8_0; | ||
| static const tensor_traits<block_iq4_nl, 4, 4, GGML_TYPE_Q8_0> iq4_nl_4x4_q8_0; |
Contributor
There was a problem hiding this comment.
with the static_assert it will be catch a build time.
|
|
||
| template <> | ||
| void gemv<block_iq4_nl, 4, 4>(int n, float * s, size_t bs, const void * vx, const void * vy, int nr, int nc) { | ||
| template <> void gemv<block_iq4_nl, 4, 4>(int n, float * s, size_t bs, const void * vx, const void * vy, int nr, int nc) { |
Contributor
There was a problem hiding this comment.
may be add the PARAM_TYPE on this template to
template <typename BLOC_TYPE, int64_t INTER_SIZE, int64_t NB_COLS, ggml_type PARAM_TYPE>
void gem[m,v]....
Member
Author
|
@Djip007 Thanks. Let me know if you have any other suggestions. |
Member
Author
|
Merging this for now and happy to hear if you have any additional suggestions. |
Seunghhon
pushed a commit
to Seunghhon/llama.cpp
that referenced
this pull request
Apr 26, 2026
* ggml : fix MUL_MAT_ID repack with Q8_K ggml-ci * ggml : improve repack templates ggml-ci
ljubomirj
pushed a commit
to ljubomirj/llama.cpp
that referenced
this pull request
May 6, 2026
* ggml : fix MUL_MAT_ID repack with Q8_K ggml-ci * ggml : improve repack templates ggml-ci
my-other-github-account
pushed a commit
to my-other-github-account/llama.cpp
that referenced
this pull request
May 15, 2026
* ggml : fix MUL_MAT_ID repack with Q8_K ggml-ci * ggml : improve repack templates ggml-ci
my-other-github-account
pushed a commit
to my-other-github-account/llama.cpp
that referenced
this pull request
May 15, 2026
* ggml : fix MUL_MAT_ID repack with Q8_K ggml-ci * ggml : improve repack templates ggml-ci
phibya
pushed a commit
to ziee-ai/llama.cpp
that referenced
this pull request
May 29, 2026
* ggml : fix MUL_MAT_ID repack with Q8_K ggml-ci * ggml : improve repack templates ggml-ci
AlexiAlp
pushed a commit
to minghaop/llama.cpp
that referenced
this pull request
Jun 2, 2026
* ggml : fix MUL_MAT_ID repack with Q8_K ggml-ci * ggml : improve repack templates ggml-ci
AlexiAlp
pushed a commit
to minghaop/llama.cpp
that referenced
this pull request
Jun 2, 2026
* ggml : fix MUL_MAT_ID repack with Q8_K ggml-ci * ggml : improve repack templates ggml-ci
fukuro-kun
pushed a commit
to fukuro-kun/fukuro-llama-cpp-turboquant
that referenced
this pull request
Jul 5, 2026
* ggml : fix MUL_MAT_ID repack with Q8_K ggml-ci * ggml : improve repack templates ggml-ci
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix #12528
mul_mat_idassumedQ8_0type for thesrc1IQ4_NLparam type to byQ8_0instead ofIQ4_NL