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

Add Qwen2-VL #1542

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Add Qwen2-VL #1542

wants to merge 6 commits into from

Conversation

nngokhale
Copy link
Contributor

@nngokhale nngokhale commented Dec 2, 2024

What does this PR do?

Adds optimized Qwen2-VL to Optimum habana.
Uses HF static cache.
Adds OH static shapes.
Fixes graph recompilations.
Adds FusedSDPA with use_flash_attention kwarg
Removed "Adds mark_step in eos stopping criterion for reduced graph recompilation time"
Removed "Accuracy WA"
Add Qwen2-VL to examples/image-to-text/run_pipeline.py and Readme
Add Qwen2-VL to tests/test_image_to_text_example

Fixes # (issue)

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

@@ -67,6 +68,7 @@ def gaudi_MaxTimeCriteria_call(
def gaudi_EosTokenCriteria_call(
self, input_ids: torch.LongTensor, scores: torch.FloatTensor, **kwargs
) -> Union[torch.BoolTensor, bool]:
htcore.mark_step()
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is a general change, and may affect performance in other models.

Can you add some numbers for the compile times u have with and without this change?

Copy link
Collaborator

Choose a reason for hiding this comment

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

is it possible to add teh markstep at teh end of the qwen model or something like that so the effect of this is isolated or qwen only?

otherwise we'd have to do a larger study to make sure it doesnt have any bad effect on any other model/usecase

Copy link
Contributor Author

Choose a reason for hiding this comment

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

mark_step at the end of the model doesn't have the same effect.
There is 2x improvement in warmup time.
I agree this should be independent PR with more tests.
I will remove this particular change.

@nngokhale nngokhale requested a review from ssarkar2 December 13, 2024 04:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants