Skip to content

Commit debae5f

Browse files
committed
missed a few refs
1 parent 4998a45 commit debae5f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/llama-kv-cache-unified.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,7 +1204,7 @@ void llama_kv_cache_unified::set_input_k_idxs(ggml_tensor * dst, const llama_uba
12041204
GGML_ASSERT(n_tokens == (int64_t) sinfo.size()*sinfo.n_stream());
12051205

12061206
GGML_ASSERT(ggml_backend_buffer_is_host(dst->buffer));
1207-
int64_t * data = (int64_t *) dst->data;
1207+
int64_t * data = (int64_t *) tensor_data(dst);
12081208

12091209
for (uint32_t s = 0; s < sinfo.n_stream(); ++s) {
12101210
const int64_t offs = sinfo.strm[s]*get_size();
@@ -1224,7 +1224,7 @@ void llama_kv_cache_unified::set_input_v_idxs(ggml_tensor * dst, const llama_uba
12241224
GGML_ASSERT(n_tokens == (int64_t) sinfo.size()*sinfo.n_stream());
12251225

12261226
GGML_ASSERT(ggml_backend_buffer_is_host(dst->buffer));
1227-
int64_t * data = (int64_t *) dst->data;
1227+
int64_t * data = (int64_t *) tensor_data(dst);
12281228

12291229
if (!v_trans) {
12301230
for (uint32_t s = 0; s < sinfo.n_stream(); ++s) {
@@ -1255,7 +1255,7 @@ void llama_kv_cache_unified::set_input_v_idxs(ggml_tensor * dst, const llama_uba
12551255
void llama_kv_cache_unified::set_input_k_shift(ggml_tensor * dst) const {
12561256
GGML_ASSERT(ggml_backend_buffer_is_host(dst->buffer));
12571257

1258-
int32_t * data = (int32_t *) dst->data;
1258+
int32_t * data = (int32_t *) tensor_data(dst);
12591259

12601260
for (uint32_t s = 0; s < n_stream; ++s) {
12611261
const auto & cells = v_cells[s];
@@ -1270,7 +1270,7 @@ void llama_kv_cache_unified::set_input_kq_mask(ggml_tensor * dst, const llama_ub
12701270
const uint32_t n_tokens = ubatch->n_tokens;
12711271

12721272
GGML_ASSERT(ggml_backend_buffer_is_host(dst->buffer));
1273-
float * data = (float *) dst->data;
1273+
float * data = (float *) tensor_data(dst);
12741274

12751275
const int64_t n_kv = dst->ne[0];
12761276
const int64_t n_stream = dst->ne[3]; // num streams in the current ubatch
@@ -1347,7 +1347,7 @@ void llama_kv_cache_unified::set_input_pos_bucket(ggml_tensor * dst, const llama
13471347
GGML_ASSERT(ggml_backend_buffer_is_host(dst->buffer));
13481348
GGML_ASSERT(!ubatch->equal_seqs()); // TODO: use ubatch->n_seqs instead of failing
13491349

1350-
int32_t * data = (int32_t *) dst->data;
1350+
int32_t * data = (int32_t *) tensor_data(dst);
13511351

13521352
const int32_t n_kv = dst->ne[0];
13531353

0 commit comments

Comments
 (0)