Allow using -rtr and -muge together (#1444)
This commit is contained in:
parent
e3f5f3d823
commit
54bcafee16
|
|
@ -1,6 +1,7 @@
|
|||
#include "llama-impl.h"
|
||||
#include "llama-model.h"
|
||||
#include "llama-model-loader.h"
|
||||
#include "llama-quantize.h"
|
||||
|
||||
#include "ggml.h"
|
||||
#include "ggml-common.h"
|
||||
|
|
@ -79,7 +80,7 @@ struct quantize_state_internal {
|
|||
{}
|
||||
};
|
||||
|
||||
static std::pair<ggml_type, int> interleaved_properties(ggml_type type) {
|
||||
std::pair<ggml_type, int> interleaved_properties(ggml_type type) {
|
||||
static std::unordered_map<ggml_type, std::pair<ggml_type, int>> k_map = {
|
||||
{ GGML_TYPE_Q4_0_4_4, { GGML_TYPE_Q4_0, 4} },
|
||||
{ GGML_TYPE_Q4_0_4_8, { GGML_TYPE_Q4_0, 4} },
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "ggml.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
std::pair<ggml_type, int> interleaved_properties(ggml_type type);
|
||||
|
|
@ -17,6 +17,7 @@
|
|||
#include "llama-cparams.h"
|
||||
#include "llama-hparams.h"
|
||||
#include "llama-context.h"
|
||||
#include "llama-quantize.h"
|
||||
|
||||
#include "unicode.h"
|
||||
|
||||
|
|
@ -4696,7 +4697,11 @@ static void llama_repack_up_gate_exps(llama_context & lctx) {
|
|||
auto & l = model.layers[il];
|
||||
if (l.ffn_up_gate_exps && l.ffn_up_exps && l.ffn_gate_exps &&
|
||||
!l.ffn_up_gate_exps->extra) {
|
||||
GGML_ASSERT(l.ffn_up_gate_exps->type == l.ffn_up_exps->type && l.ffn_up_gate_exps->type == l.ffn_gate_exps->type);
|
||||
GGML_ASSERT(l.ffn_up_exps->type == l.ffn_gate_exps->type);
|
||||
if (l.ffn_up_gate_exps->type != l.ffn_up_exps->type) {
|
||||
auto [other_type, _] = interleaved_properties(l.ffn_up_gate_exps->type);
|
||||
GGML_ASSERT(other_type == l.ffn_up_exps->type);
|
||||
}
|
||||
GGML_ASSERT(l.ffn_up_gate_exps->ne[0] == l.ffn_up_exps->ne[0] && l.ffn_up_gate_exps->ne[0] == l.ffn_gate_exps->ne[0]);
|
||||
GGML_ASSERT(l.ffn_up_gate_exps->ne[2] == l.ffn_up_exps->ne[2] && l.ffn_up_gate_exps->ne[2] == l.ffn_gate_exps->ne[2]);
|
||||
GGML_ASSERT(l.ffn_up_gate_exps->ne[1] == l.ffn_up_exps->ne[1] + l.ffn_gate_exps->ne[1]);
|
||||
|
|
|
|||
Loading…
Reference in New Issue