Skip to content
Open
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
3 changes: 2 additions & 1 deletion lmdeploy/pytorch/strategies/dllm/sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ def set_step(self, step: int):
start = min(step, self.num_history_ids)
end = self.num_history_ids
if end > start:
self.history_dllm_mask[start:end] = DLLM_MASKED
to_change_mask = self.history_dllm_mask[start:]
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

The slice should use start:end instead of start:. The variable end is calculated on line 201 but is not used in the new code. This causes the mask update to incorrectly affect elements beyond num_history_ids, potentially modifying mask values that should remain unchanged.

Suggested change
to_change_mask = self.history_dllm_mask[start:]
to_change_mask = self.history_dllm_mask[start:end]

Copilot uses AI. Check for mistakes.
to_change_mask[to_change_mask == DLLM_CACHED] = DLLM_UNMASKED
super().set_step(step)


Expand Down
Loading