-
Notifications
You must be signed in to change notification settings - Fork 26.3k
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
Siglip: add _no_split_module
#31566
Siglip: add _no_split_module
#31566
Conversation
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
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.
Thanks for fixing!
General comment / question about the best approach
_no_split_modules = [ | ||
"SiglipTextEmbeddings", | ||
"SiglipEncoderLayer", | ||
"SiglipVisionEmbeddings", | ||
"SiglipEncoderLayer", | ||
"SiglipMultiheadAttentionPoolingHead", | ||
] |
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.
What happens if we have modules defined in _no_split_modules
which aren't in the model? It probably makes more sense to move this into the PretrainedModel
definition than repeat e.g. "SiglipVisionEmbeddings"
for all models which use the vision components
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.
Great idea! Didn't think that extra split_modules
will not affect anything. Moved to SiglipPretrained model and ran tests. Had to skip offloading, same way it's skipped in SigLipVision
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.
Thanks for adding!
What does this PR do?
Fixes #31400. Adds a '_no_split_module' in SigLipModel by combining those specified in Text and Vision components.
Otherwise, when we call SiglipModel with
device_map
an error will be thrown because Text/Vision components are not children of SiglipModel and we need to add_no_split_module