Skip to content

Commit 49a0651

Browse files
committed
Test passing
1 parent a523479 commit 49a0651

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/llama-kv-cache-fp8.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,12 @@ size_t llama_kv_cache_fp8::size_k_bytes() const {
664664
size_t llama_kv_cache_fp8::size_v_bytes() const {
665665
size_t size_v_bytes = 0;
666666
for (const auto & layer : layers) {
667-
size_v_bytes += ggml_nbytes(layer.v_fp8) + ggml_nbytes(layer.v_scale);
667+
if (layer.v_fp8 != nullptr) {
668+
size_v_bytes += ggml_nbytes(layer.v_fp8);
669+
}
670+
if (layer.v_scale != nullptr) {
671+
size_v_bytes += ggml_nbytes(layer.v_scale);
672+
}
668673
}
669674
return size_v_bytes;
670675
}

0 commit comments

Comments
 (0)