-
Notifications
You must be signed in to change notification settings - Fork 29.5k
[blip-2] Fix dtype mismatch when keep in fp32 #37068
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
[blip-2] Fix dtype mismatch when keep in fp32 #37068
Conversation
Hi 👋, thank you for opening this pull request! The pull request is converted to draft by default. The CI will be paused while the PR is in draft mode. When it is ready for review, please click the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
I have confirmed that the vLLM test now passes on the latest commit of this PR 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a test please! 🤗
Test is already added, slow tests were failing on |
Let's merge then! |
* fix fp32 BLIP2 * no need to reorder that * check for `Noneness` as well before casting dtype
* fix fp32 BLIP2 * no need to reorder that * check for `Noneness` as well before casting dtype
What does this PR do?
Seems that BLIP2
keep_in_fp32_modules
was not picking up correctly until 36722 (thus no errors up to today). Now that thequery_tokens
are actually kept in 32, we are getting dtype mismatch error in inference. (reported by @hmellor)This PR fixes by casting inputs to correct dtypes, and keeping
qformer
infp32
as well. The fix was tested with slow BLIP-2 tests and vLLM tests