You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constuint32_t n_embd_k_gqa = 4096;
constuint32_t n_embd_v_gqa = 4096;
constuint32_t kv_size = 4096;
std::vector<structggml_context *> ctxs;
int n_layers = 32;
for (int i = 0; i < n_layers; i ++ ) {
structggml_init_params params = {
// /*.mem_size =*/ 2u*n_layers*ggml_tensor_overhead() + 4096 * 4096 * GGML_TYPE_F16,/*.mem_size =*/10 * ((size_t)4096 * 4096 * 2 + ggml_tensor_overhead()),
/*.mem_buffer =*/NULL,
/*.no_alloc =*/false,
};
ggml_context * ctx = ggml_init(params);
ctxs.push_back(ctx);
}
for (int i = 0; i < layer_num; ++ i) {
structggml_tensor * k = ggml_new_tensor_1d(ctxs[i], GGML_TYPE_F16, n_embd_k_gqa * kv_size);
structggml_tensor * v = ggml_new_tensor_1d(ctxs[i], GGML_TYPE_F16, n_embd_k_gqa * kv_size);
k_buffer.push_back(k);
v_buffer.push_back(v);
}
When I execute code above, I have encountered a nullptr error like this, it's so weird. If I alloc too little memory space, it should alert me to an out of memory error in stead of this :(
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Beta Was this translation helpful? Give feedback.
All reactions