Skip to content

Commit a9a4e41

Browse files
olpipiWovchena
andauthored
Fix overflow. Fix coverity. (openvinotoolkit#2179)
Fix overflow. Fix coverity. CVS-165982 Co-authored-by: Vladimir Zlobin <vladimir.zlobin@intel.com>
1 parent 8387956 commit a9a4e41

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/cpp/src/continuous_batching/scheduler.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ class Scheduler {
191191
if (tokens_in_last_block == 0) {
192192
tokens_in_last_block = block_size;
193193
}
194-
preempted_tokens = tokens_in_last_block + std::max<size_t>((int)logical_blocks_released - 1, 0) * block_size;
194+
preempted_tokens = tokens_in_last_block + (logical_blocks_released == 0 ? 0 : logical_blocks_released - 1) * block_size;
195195

196196
// case when preemption requires preempt prompt tokens
197197
if (!m_config.dynamic_split_fuse && processed_tokens - preempted_tokens < sequence_group->get_prompt_len()) {

0 commit comments

Comments
 (0)