Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/cache_manager/kvcache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ __C struct KVCache *createKVCache(
auto kcache = std::vector<std::shared_ptr<Tensor>>();
auto vcache = std::vector<std::shared_ptr<Tensor>>();
for (unsigned int layer = 0; layer < nlayers; layer++) {
kcache.push_back(std::move(Tensor::buffer(dtype, shape_k)));
vcache.push_back(std::move(Tensor::buffer(dtype, shape_v)));
kcache.push_back(Tensor::buffer(dtype, shape_k));
vcache.push_back(Tensor::buffer(dtype, shape_v));
}
cache->k.push_back(kcache);
cache->v.push_back(vcache);
Expand All @@ -47,8 +47,8 @@ __C struct KVCache *duplicateKVCache(const KVCache *kv_cache, size_t seq_len) {
auto kcache = std::vector<std::shared_ptr<Tensor>>();
auto vcache = std::vector<std::shared_ptr<Tensor>>();
for (unsigned int layer = 0; layer < nlayers; layer++) {
kcache.push_back(std::move(Tensor::buffer(dtype, shape_k)));
vcache.push_back(std::move(Tensor::buffer(dtype, shape_v)));
kcache.push_back(Tensor::buffer(dtype, shape_k));
vcache.push_back(Tensor::buffer(dtype, shape_v));
}
new_kv_cache->k.push_back(kcache);
new_kv_cache->v.push_back(vcache);
Expand Down
4 changes: 2 additions & 2 deletions src/models/deepseek_v3/deepseek_v3_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ createDeepSeekV3Cache(const struct DeepSeekV3Model *model) {
auto kv_pass_cache = std::vector<std::shared_ptr<Tensor>>();
auto k_rot_cache = std::vector<std::shared_ptr<Tensor>>();
for (size_t layer = 0; layer < nlayer; layer++) {
kv_pass_cache.push_back(std::move(Tensor::buffer(model->meta.dt_logits, kv_pass_shape)));
k_rot_cache.push_back(std::move(Tensor::buffer(model->meta.dt_logits, k_rot_shape)));
kv_pass_cache.push_back(Tensor::buffer(model->meta.dt_logits, kv_pass_shape));
k_rot_cache.push_back(Tensor::buffer(model->meta.dt_logits, k_rot_shape));
}
cache->kv_pass.push_back(kv_pass_cache);
cache->k_rot.push_back(k_rot_cache);
Expand Down