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

Fix support of "inputs_embeds" input of VLMs in SDPAToPA transformation #28674

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

CuriousPanCake
Copy link
Contributor

@CuriousPanCake CuriousPanCake commented Jan 24, 2025

VLMs have tokens and their generation already served as the "inputs_embeds" input, so there's no need to transform the input in the way this is done for "input_ids".

Tickets:

Signed-off-by: Andrii Staikov andrii.staikov@intel.com

@CuriousPanCake CuriousPanCake requested a review from a team as a code owner January 24, 2025 17:22
@CuriousPanCake CuriousPanCake requested review from itikhono and removed request for a team January 24, 2025 17:22
@github-actions github-actions bot added the category: Core OpenVINO Core (aka ngraph) label Jan 24, 2025
@ilya-lavrenov ilya-lavrenov added this to the 2025.1 milestone Jan 24, 2025
@CuriousPanCake CuriousPanCake changed the title Fix support of "inputs_embeds" input of VLM in SDPAToPA transformation Fix support of "inputs_embeds" input of VLMs in SDPAToPA transformation Jan 24, 2025
@github-actions github-actions bot added the category: transformations OpenVINO Runtime library - Transformations label Jan 24, 2025
// for "input_ids"
processed_input_ids = input_ids_node;
} else {
OPENVINO_ASSERT(processed_input_ids, "Counln't process neither input_ids, nor inputs_embeds.");
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
OPENVINO_ASSERT(processed_input_ids, "Counln't process neither input_ids, nor inputs_embeds.");
OPENVINO_ASSERT(processed_input_ids, "Couldn't process neither input_ids, nor inputs_embeds.");

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

for (const auto& target : input_ids_target_inputs) {
target.replace_source_output(processed_input_ids);
}
} else if (input_ids_node->get_friendly_name() == "inputs_embeds") {
Copy link
Contributor

Choose a reason for hiding this comment

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

could you add a new unit test for this scenario?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, of course, I'm working on it rn

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Created a test for the "inputs_embeds" input based on the nanoLLaVA pattern

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: Core OpenVINO Core (aka ngraph) category: transformations OpenVINO Runtime library - Transformations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants