vllm.v1.core.sched.utils ¶
Functions:
-
check_sequence_repetition–Check if a sequence of token IDs has a repetition pattern.
-
remove_all–Remove all items from a list that are in the items_to_remove set.
_has_repeating_pattern(token_ids, pattern_len, repetition_min_count) ¶
Check if the tail of token_ids contains a repeating pattern.
Compares the last pattern_len tokens against the preceding (repetition_min_count - 1) repetitions of the same length.
Source code in vllm/v1/core/sched/utils.py
check_sequence_repetition(token_ids, params) ¶
Check if a sequence of token IDs has a repetition pattern. Args: token_ids: List of token IDs params: Repetition detection parameters. Returns: True if a repetition pattern is found, False otherwise.
Source code in vllm/v1/core/sched/utils.py
remove_all(lst, items_to_remove) ¶
Remove all items from a list that are in the items_to_remove set.
This method optimizes for the common case of removing a single item, falling back to list comprehension for multiple items.
Parameters:
Returns:
-
list–Either the modified original list (for single item removal) or
-
list–a new list (for multiple item removal). Callers should use the
-
list–returned value.
Note
For single item removal, this modifies the original list in-place and returns it. For multiple items, it creates and returns a new list.