@@ -627,10 +627,10 @@ llama_batch_allocr::llama_batch_allocr() {
627627 const char * LLAMA_BATCH_DEBUG = getenv (" LLAMA_BATCH_DEBUG" );
628628 debug = LLAMA_BATCH_DEBUG ? atoi (LLAMA_BATCH_DEBUG) : 0 ;
629629
630- seq_pos.resize (LLAMA_MAX_PARALLEL_SEQUENCES );
631- seq_cpl.resize (LLAMA_MAX_PARALLEL_SEQUENCES );
630+ seq_pos.resize (LLAMA_MAX_SEQ );
631+ seq_cpl.resize (LLAMA_MAX_SEQ );
632632 for (auto & cur : seq_cpl) {
633- cur.resize (LLAMA_MAX_PARALLEL_SEQUENCES );
633+ cur.resize (LLAMA_MAX_SEQ );
634634 }
635635}
636636
@@ -660,8 +660,8 @@ bool llama_batch_allocr::init(
660660 if (batch.seq_id ) {
661661 for (int32_t i = 0 ; i < batch.n_tokens ; ++i) {
662662 for (int32_t s = 0 ; s < batch.n_seq_id [i]; ++s) {
663- if (batch.seq_id && (batch.seq_id [i][s] < 0 || batch.seq_id [i][s] >= LLAMA_MAX_PARALLEL_SEQUENCES )) {
664- LLAMA_LOG_ERROR (" %s: invalid seq_id[%d][%d] = %d > %d\n " , __func__, i, s, batch.seq_id [i][s], LLAMA_MAX_PARALLEL_SEQUENCES );
663+ if (batch.seq_id && (batch.seq_id [i][s] < 0 || batch.seq_id [i][s] >= LLAMA_MAX_SEQ )) {
664+ LLAMA_LOG_ERROR (" %s: invalid seq_id[%d][%d] = %d > %d\n " , __func__, i, s, batch.seq_id [i][s], LLAMA_MAX_SEQ );
665665 return false ;
666666 }
667667 }
@@ -693,8 +693,8 @@ bool llama_batch_allocr::init(
693693 pos.resize (batch.n_tokens );
694694
695695 // initialize the starting position for each sequence based on the positions in the memory
696- llama_pos p0[LLAMA_MAX_PARALLEL_SEQUENCES ];
697- for (int32_t s = 0 ; s < LLAMA_MAX_PARALLEL_SEQUENCES ; ++s) {
696+ llama_pos p0[LLAMA_MAX_SEQ ];
697+ for (int32_t s = 0 ; s < LLAMA_MAX_SEQ ; ++s) {
698698 if (!memory) {
699699 p0[s] = 0 ;
700700 } else {
@@ -818,7 +818,7 @@ bool llama_batch_allocr::init(
818818 // consistency checks
819819 //
820820
821- for (int32_t s = 0 ; s < LLAMA_MAX_PARALLEL_SEQUENCES ; ++s) {
821+ for (int32_t s = 0 ; s < LLAMA_MAX_SEQ ; ++s) {
822822 if (seq_pos[s].empty ()) {
823823 continue ;
824824 }
@@ -835,8 +835,8 @@ bool llama_batch_allocr::init(
835835 }
836836
837837 if (memory) {
838- for (int32_t s0 = 0 ; s0 < LLAMA_MAX_PARALLEL_SEQUENCES ; ++s0) {
839- for (int32_t s1 = 0 ; s1 < LLAMA_MAX_PARALLEL_SEQUENCES ; ++s1) {
838+ for (int32_t s0 = 0 ; s0 < LLAMA_MAX_SEQ ; ++s0) {
839+ for (int32_t s1 = 0 ; s1 < LLAMA_MAX_SEQ ; ++s1) {
840840 if (seq_cpl[s0][s1]) {
841841 if (memory->seq_pos_min (s0) != memory->seq_pos_min (s1) ||
842842 memory->seq_pos_max (s0) != memory->seq_pos_max (s1)) {
0 commit comments