train : fix KQ_pos allocation (#3392)
* train : fix KQ_pos allocation * make sure KQ_pos is not reallocated in finetune --------- Co-authored-by: xaedes <xaedes@gmail.com>
This commit is contained in:
parent
2777a84be4
commit
bc34dd4f5b
2 changed files with 6 additions and 2 deletions
|
@ -334,7 +334,8 @@ static struct ggml_tensor * llama_build_train_graphs(
|
|||
|
||||
// KQ_pos - contains the positions
|
||||
struct ggml_tensor * KQ_pos = ggml_new_tensor_1d(ctx, GGML_TYPE_I32, N);
|
||||
{
|
||||
ggml_allocr_alloc(alloc, KQ_pos);
|
||||
if (!ggml_allocr_is_measure(alloc)) {
|
||||
int * data = (int *) KQ_pos->data;
|
||||
for (int i = 0; i < N; ++i) {
|
||||
data[i] = n_past + i;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue