mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2026-07-06 11:10:21 +00:00
Fix stale tensor-split params for draft models (#24814)
* meta: fix tensor split metadata for GQA attention
* Tidied the code a bit to match existing style
* Revert "Tidied the code a bit to match existing style"
This reverts commit b90c6c6300.
* Reverted the ggml-backend-meta asset hack.
This commit is contained in:
@@ -1012,9 +1012,17 @@ struct llama_model::impl {
|
||||
std::vector<layer_dev> dev_layer;
|
||||
|
||||
bool has_tensor_overrides;
|
||||
|
||||
std::vector<float> tensor_split_owned;
|
||||
};
|
||||
|
||||
llama_model::llama_model(const llama_model_params & params) : params(params), pimpl(std::make_unique<impl>()) {
|
||||
if (params.tensor_split != nullptr) {
|
||||
// llama_model_params stores tensor_split as a borrowed pointer, but the model
|
||||
// may need it later for tensor-parallel KV-cache split metadata.
|
||||
pimpl->tensor_split_owned.assign(params.tensor_split, params.tensor_split + llama_max_devices());
|
||||
this->params.tensor_split = pimpl->tensor_split_owned.data();
|
||||
}
|
||||
pimpl->has_tensor_overrides = params.tensor_buft_overrides && params.tensor_buft_overrides[0].pattern;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user