Open
Conversation
This was
linked to
issues
Apr 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Surface Cause
Both issues #37 and #62 mentioned this issue. The surface cause of the bug is that the
stepmethod in the llm_engine.py file did not exit the outerwhileloop after processing all the sequences. Thestepmethod returns two values:return [], is_prefill. However, the external function expects three values:outputs, num_processed_tokens, is_prefill = self.step(). However, this is not the root cause.In-depth Analysis
Upon deeper investigation, with a sequence count of 90 (3 prompts * 30), it was found that the number of items in the waiting queue did not decrease when it reached the maximum allocable space (the 3070ti 8G's block allocation limit is 65). After investigation, it was discovered that the issue was due to a logical error in the
ref_countcounter, which prevented the block from being correctly released. This issue can be fixed by adding code in the block_manager.py file.Another Scenario
After setting
block_size=8, the program does not throw an error. The root cause is that the prompts themselves are too small. The original default setting ofblock_size=256meant that a single sequence could not fully use up the block. Moreover, due to an initialization issue with theref_countat the lower level, only 65 running sequences will be executed (the number of running sequences corresponds to the known block count). Once the running sequence queue finishes, the waiting sequence queue will not continue running, which leads to the block release issue caused by theref_count.