Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fill prompt for sampler analysis with real tokens in VLM pipeline #1247

Merged
merged 2 commits into from
Dec 19, 2024

Conversation

sbalandi
Copy link
Contributor

@sbalandi sbalandi commented Nov 22, 2024

  • add missed token, if prev generation was finished because max length was reached

src/cpp/src/visual_language/pipeline.cpp Outdated Show resolved Hide resolved
std::fill_n(prompt_ids.data<int64_t>(), prompt_ids.get_size(), 0);

auto chat_history = m_inputs_embedder->get_tokenized_chat_history();
size_t chat_history_size = std::max(chat_history.get_shape().at(1), history_size + inputs_embeds_size);
Copy link
Contributor

Choose a reason for hiding this comment

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

looks like we have the same case as for LLMs, when decode ( encode ( X ) ) provides smaller value than X ?
in this case we need to partially re-compute the history.

Copy link
Contributor

Choose a reason for hiding this comment

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

in general, I would consider merging VLM and LLM pipelines generate functions to keep all this magic with history in one place.
Or at least to create helper function similar to get_lm_encoded_results

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll try to merge some part here after #1215

@ilya-lavrenov ilya-lavrenov added this to the 2025.0 milestone Nov 27, 2024
@github-actions github-actions bot added category: LLM LLM pipeline (stateful, static) no-match-files labels Dec 12, 2024
@sbalandi
Copy link
Contributor Author

rebased on #1254

@sbalandi sbalandi marked this pull request as ready for review December 12, 2024 15:36
@sbalandi sbalandi force-pushed the vlm_mask_vs_hist branch 6 times, most recently from c6b1907 to 53cd2f7 Compare December 16, 2024 17:33
@github-actions github-actions bot removed the category: LLM LLM pipeline (stateful, static) label Dec 16, 2024
@sbalandi sbalandi force-pushed the vlm_mask_vs_hist branch 2 times, most recently from 22101ad to a8b866c Compare December 17, 2024 21:01
src/cpp/src/visual_language/inputs_embedder.cpp Outdated Show resolved Hide resolved
src/cpp/src/utils.hpp Outdated Show resolved Hide resolved
@ilya-lavrenov ilya-lavrenov added this pull request to the merge queue Dec 18, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 18, 2024
@sbalandi sbalandi enabled auto-merge December 19, 2024 00:03
@sbalandi sbalandi added this pull request to the merge queue Dec 19, 2024
@ilya-lavrenov ilya-lavrenov removed this pull request from the merge queue due to a manual request Dec 19, 2024
@ilya-lavrenov ilya-lavrenov merged commit 17f4eb3 into openvinotoolkit:master Dec 19, 2024
59 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants