Skip to content

Conversation

popovaan
Copy link
Contributor

Run finish_chat() before start_chat() in VLM pipeline and CB pipeline to prevent accumulating of history images when multiple start_chat() are used.
Ticket: CVS-170106

@popovaan popovaan requested a review from Wovchena July 22, 2025 07:14
@github-actions github-actions bot added category: visual language Visual language pipeline category: continuous batching Continuous batching labels Jul 22, 2025
@Wovchena Wovchena requested a review from Copilot July 22, 2025 13:23
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR ensures that finish_chat() is called before start_chat() in both VLM and Continuous Batching pipelines to prevent accumulation of history images when multiple start_chat() calls are made. This addresses ticket CVS-170106.

  • Adds finish_chat() calls before start_chat() in both pipeline implementations
  • Removes direct state reset code from VLM pipeline implementation, delegating cleanup to finish_chat()
  • Removes m_image_id reset from continuous batching base class

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/cpp/src/visual_language/pipeline.cpp Adds finish_chat() call before start_chat() and removes inline state reset logic
src/cpp/src/continuous_batching/pipeline_base.cpp Removes m_image_id reset from base implementation
src/cpp/src/continuous_batching/pipeline.cpp Adds finish_chat() call before start_chat()

if (!m_inputs_embedder->get_kv_cache_state().get_state().empty()) {
m_history.clear();
}
m_inputs_embedder->start_chat(system_message);
Copy link
Preview

Copilot AI Jul 22, 2025

Choose a reason for hiding this comment

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

With the removal of state reset logic, ensure that finish_chat() properly handles all the cleanup that was previously done here, including m_image_id reset, state reset, attention_mask reshaping, and history clearing.

Copilot uses AI. Check for mistakes.

@github-actions github-actions bot added the category: Python API Python API for GenAI label Jul 23, 2025
@popovaan popovaan requested a review from rkazants July 23, 2025 09:18
@Wovchena Wovchena enabled auto-merge July 24, 2025 16:47
@Wovchena Wovchena added this pull request to the merge queue Jul 25, 2025
Merged via the queue into openvinotoolkit:master with commit c7d56b4 Jul 25, 2025
98 of 101 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: continuous batching Continuous batching category: Python API Python API for GenAI category: visual language Visual language pipeline
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants