@@ -156,6 +156,9 @@ llama_kv_cache_unified::llama_kv_cache_unified(
156156
157157 const char * LLAMA_KV_CACHE_DEBUG = getenv (" LLAMA_KV_CACHE_DEBUG" );
158158 debug = LLAMA_KV_CACHE_DEBUG ? atoi (LLAMA_KV_CACHE_DEBUG) : 0 ;
159+
160+ const char * LLAMA_KV_CACHE_DEBUG = getenv (" LLAMA_KV_CACHE_DEBUG" );
161+ debug = LLAMA_KV_CACHE_DEBUG ? atoi (LLAMA_KV_CACHE_DEBUG) : 0 ;
159162}
160163
161164void llama_kv_cache_unified::clear (bool data) {
@@ -556,8 +559,11 @@ int32_t llama_kv_cache_unified::find_slot(const llama_ubatch & ubatch) const {
556559 }
557560
558561 if (debug > 0 ) {
562+ LLAMA_LOG_CONT (" \n " );
559563 LLAMA_LOG_DEBUG (" %s: n = %5d, used = %5d, head = %5d, size = %5d, n_swa = %5d\n " , __func__, cells.used_max_p1 (), cells.get_used (), head, get_size (), n_swa);
560564
565+ if ((debug == 2 && n_swa > 0 ) || debug > 2 ) {
566+ std::string ss;
561567 if ((debug == 2 && n_swa > 0 ) || debug > 2 ) {
562568 std::string ss;
563569 for (uint32_t i = 0 ; i < cells.size (); ++i) {
@@ -604,14 +610,17 @@ int32_t llama_kv_cache_unified::find_slot(const llama_ubatch & ubatch) const {
604610 LLAMA_LOG_DEBUG (" \n %s\n " , ss.c_str ());
605611 }
606612
607- for (int s = 0 ; s < LLAMA_MAX_SEQ ; ++s) {
613+ for (int s = 0 ; s < LLAMA_MAX_PARALLEL_SEQUENCES ; ++s) {
608614 if (cells.seq_pos_min (s) < 0 ) {
609615 continue ;
610616 }
611617
612618 LLAMA_LOG_DEBUG (" %s: min[%d] = %5d, max[%d] = %5d\n " , __func__, s, cells.seq_pos_min (s), s, cells.seq_pos_max (s));
613619 }
614620 }
621+ LLAMA_LOG_DEBUG (" %s: min[%d] = %5d, max[%d] = %5d\n " , __func__, s, cells.seq_pos_min (s), s, cells.seq_pos_max (s));
622+ }
623+ }
615624
616625 uint32_t n_tested = 0 ;
617626
0 commit comments