@@ -15344,15 +15344,15 @@ static ggml_type llama_tensor_get_type(quantize_state_internal & qs, ggml_type n
15344
15344
} else if (name.find("attn_v.weight") != std::string::npos) {
15345
15345
if (ftype == LLAMA_FTYPE_MOSTLY_IQ2_XXS || ftype == LLAMA_FTYPE_MOSTLY_IQ2_XS || ftype == LLAMA_FTYPE_MOSTLY_IQ1_S ||
15346
15346
ftype == LLAMA_FTYPE_MOSTLY_IQ2_S || ftype == LLAMA_FTYPE_MOSTLY_IQ2_M || ftype == LLAMA_FTYPE_MOSTLY_IQ1_M) {
15347
- if (qs.model.hparams.n_expert >= 8 ) new_type = GGML_TYPE_Q6_K;
15347
+ if (qs.model.hparams.n_expert >= 4 ) new_type = GGML_TYPE_Q6_K;
15348
15348
else {
15349
15349
if (qs.model.hparams.n_gqa() >= 2 || qs.model.hparams.n_expert >= 2) new_type = GGML_TYPE_Q4_K;
15350
15350
else if (ftype == LLAMA_FTYPE_MOSTLY_IQ2_XXS || ftype == LLAMA_FTYPE_MOSTLY_IQ2_XS) new_type = GGML_TYPE_IQ3_XXS;
15351
15351
else if (ftype == LLAMA_FTYPE_MOSTLY_IQ2_S || ftype == LLAMA_FTYPE_MOSTLY_IQ2_M) new_type = GGML_TYPE_IQ3_S;
15352
15352
}
15353
15353
++qs.i_attention_wv;
15354
15354
}
15355
- else if (qs.model.hparams.n_expert >= 8 ) {
15355
+ else if (qs.model.hparams.n_expert >= 4 ) {
15356
15356
// for the 8-expert model, bumping this to Q8_0 trades just ~128MB
15357
15357
// TODO: explore better strategies
15358
15358
new_type = GGML_TYPE_Q8_0;
@@ -15391,7 +15391,7 @@ static ggml_type llama_tensor_get_type(quantize_state_internal & qs, ggml_type n
15391
15391
else if (ftype == LLAMA_FTYPE_MOSTLY_Q4_K_S && qs.i_attention_wv < 4) new_type = GGML_TYPE_Q5_K;
15392
15392
++qs.i_attention_wv;
15393
15393
} else if (name.find("attn_k.weight") != std::string::npos) {
15394
- if (qs.model.hparams.n_expert >= 8 ) {
15394
+ if (qs.model.hparams.n_expert >= 4 ) {
15395
15395
// for the 8-expert model, bumping this to Q8_0 trades just ~128MB
15396
15396
// TODO: explore better strategies
15397
15397
if (ftype == LLAMA_FTYPE_MOSTLY_IQ2_XXS || ftype == LLAMA_FTYPE_MOSTLY_IQ2_XS || ftype == LLAMA_FTYPE_MOSTLY_IQ1_S ||
@@ -15436,7 +15436,7 @@ static ggml_type llama_tensor_get_type(quantize_state_internal & qs, ggml_type n
15436
15436
else if (ftype == LLAMA_FTYPE_MOSTLY_IQ3_XXS) new_type = GGML_TYPE_IQ2_S;
15437
15437
else if (ftype == LLAMA_FTYPE_MOSTLY_IQ2_XXS || ftype == LLAMA_FTYPE_MOSTLY_IQ2_XS || ftype == LLAMA_FTYPE_MOSTLY_IQ1_S ||
15438
15438
ftype == LLAMA_FTYPE_MOSTLY_IQ2_S || ftype == LLAMA_FTYPE_MOSTLY_IQ2_M || ftype == LLAMA_FTYPE_MOSTLY_IQ1_M) {
15439
- if (qs.model.hparams.n_expert >= 8 ) new_type = GGML_TYPE_Q3_K;
15439
+ if (qs.model.hparams.n_expert >= 4 ) new_type = GGML_TYPE_Q3_K;
15440
15440
}
15441
15441
} else if (name.find("ffn_down") != std::string::npos) {
15442
15442
auto info = layer_info(qs.i_ffn_down, qs.n_ffn_down, name.c_str());
@@ -15461,7 +15461,7 @@ static ggml_type llama_tensor_get_type(quantize_state_internal & qs, ggml_type n
15461
15461
: GGML_TYPE_Q3_K;
15462
15462
}
15463
15463
else if (ftype == LLAMA_FTYPE_MOSTLY_IQ3_M && (i_layer < n_layer/8 ||
15464
- (qs.model.hparams.n_expert >= 8 && use_more_bits(i_layer, n_layer)))) {
15464
+ (qs.model.hparams.n_expert >= 4 && use_more_bits(i_layer, n_layer)))) {
15465
15465
new_type = GGML_TYPE_Q4_K;
15466
15466
}
15467
15467
else if (ftype == LLAMA_FTYPE_MOSTLY_Q3_K_L) {
@@ -15492,15 +15492,15 @@ static ggml_type llama_tensor_get_type(quantize_state_internal & qs, ggml_type n
15492
15492
++qs.i_ffn_down;
15493
15493
} else if (name.find("attn_output.weight") != std::string::npos) {
15494
15494
if (arch != LLM_ARCH_FALCON) {
15495
- if (qs.model.hparams.n_expert >= 8 ) {
15495
+ if (qs.model.hparams.n_expert >= 4 ) {
15496
15496
if (ftype == LLAMA_FTYPE_MOSTLY_Q2_K || ftype == LLAMA_FTYPE_MOSTLY_IQ3_XS || ftype == LLAMA_FTYPE_MOSTLY_IQ3_XXS ||
15497
15497
ftype == LLAMA_FTYPE_MOSTLY_Q3_K_S || ftype == LLAMA_FTYPE_MOSTLY_Q3_K_M || ftype == LLAMA_FTYPE_MOSTLY_IQ4_NL ||
15498
15498
ftype == LLAMA_FTYPE_MOSTLY_Q4_K_S || ftype == LLAMA_FTYPE_MOSTLY_Q4_K_M || ftype == LLAMA_FTYPE_MOSTLY_IQ3_S ||
15499
15499
ftype == LLAMA_FTYPE_MOSTLY_IQ3_M || ftype == LLAMA_FTYPE_MOSTLY_IQ4_XS) new_type = GGML_TYPE_Q5_K;
15500
15500
}
15501
15501
else if (ftype == LLAMA_FTYPE_MOSTLY_IQ2_XXS || ftype == LLAMA_FTYPE_MOSTLY_IQ2_XS || ftype == LLAMA_FTYPE_MOSTLY_IQ1_S ||
15502
15502
ftype == LLAMA_FTYPE_MOSTLY_IQ2_S || ftype == LLAMA_FTYPE_MOSTLY_IQ2_M || ftype == LLAMA_FTYPE_MOSTLY_IQ1_M) {
15503
- if (qs.model.hparams.n_expert >= 8 ) new_type = GGML_TYPE_Q4_K;
15503
+ if (qs.model.hparams.n_expert >= 4 ) new_type = GGML_TYPE_Q4_K;
15504
15504
else {
15505
15505
if (ftype == LLAMA_FTYPE_MOSTLY_IQ1_S || ftype == LLAMA_FTYPE_MOSTLY_IQ1_M) new_type = GGML_TYPE_IQ2_XXS;
15506
15506
else if (ftype == LLAMA_FTYPE_MOSTLY_IQ2_S || ftype == LLAMA_FTYPE_MOSTLY_IQ2_M) new_type = GGML_TYPE_IQ3_XXS;
0 commit comments