Fix KV cache size calculation error

This commit is contained in:
RangerUFO 2024-06-21 13:06:26 +08:00
parent 0570972d43
commit d7787c8f6c
1 changed files with 1 additions and 1 deletions

View File

@ -114,7 +114,7 @@ struct CreateKVCache {
KVCache operator()() const {
KVCache kv_cache = {};
const size_t size_cache_pos = CacheLayerSize<TConfig>()();
const size_t size_cache_pos = CachePosSize<TConfig>()();
if (size_cache_pos != 0) {
const size_t seq_len = TConfig::kSeqLen + kPrefillBatchSize;
kv_cache.kv_cache = hwy::AllocateAligned<float>(seq_len * size_cache_pos);