Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ def __init__(self) -> None:
else:
self.prefill = self.prefill_normal
self.decode = self.decode_normal

self.classed_req_strict_prefill = False
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While this change is correct, the reason for overriding the base class's classed_req_strict_prefill from True to False is not immediately obvious. Adding a comment to explain this logic would significantly improve code clarity and maintainability for future developers.

Suggested change
self.classed_req_strict_prefill = False
# Override base class setting. For chunked prefill, a request that has
# finished prefilling the prompt and is ready for the first token generation
# should be classified as a decode request, not a prefill one.
self.classed_req_strict_prefill = False

return

def infer_loop(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ def __init__(self) -> None:
self.decode = self.decode_overlap
else:
self.decode = self.decode_normal

self.classed_req_strict_prefill = False
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This override is also correct for the DPChunkedPrefillBackend. To maintain consistency and improve readability, please consider adding a comment here as well, explaining why this backend requires classed_req_strict_prefill to be False.

Suggested change
self.classed_req_strict_prefill = False
# Override base class setting. For this backend, a request that has
# finished prefilling the prompt and is ready for the first token generation
# should be classified as a decode request, not a prefill one.
self.classed_req_strict_prefill = False

return

def infer_loop(self):
Expand Down