-
Notifications
You must be signed in to change notification settings - Fork 28.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
[GroundingDino] Adding ms_deform_attn kernels #30768
[GroundingDino] Adding ms_deform_attn kernels #30768
Conversation
@@ -0,0 +1,40 @@ | |||
/*! | |||
************************************************************************************************** |
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.
Do we need new kernels for Grounding DINO? Can't we reuse the ones from Deformable DETR? https://github.com/huggingface/transformers/tree/main/src/transformers/kernels/deformable_detr
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.
We could, but then the same would be true to Deta
https://github.com/huggingface/transformers/tree/main/src/transformers/kernels/deta as it's just a copy and paste
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.
Ok, tbh I have no idea why they were duplicated for Deta if they're exactly the same as Deformable DETR.
So I'd advocate to just share the kernel among these 3 models in case they're the same (pinging @amyeroberts here).
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.
They were probably duplicated because the kernels used to live at the model level i.e. src/transformers/models/model_name/
- and there shouldn't be imports from one modeling file to another.
Happy to have them shared i.e. grounding DINO just points to deformable DETR kernels in the modeling file.
There's a possible issue where changes might be made to the kernels to e.g. update deformable DETR which isn't compatible with other dependant models. This would effectively be hidden as it's not obvious from the kernel paths here. The likelihood of this happening is so low, I think we can just ignore it for the moment.
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.
GroundingDino
pointing to DeformableDetr
kernels here bc1f8cb
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!
What does this PR do?
This PR fixes #30765 (comment) by adding the missing
ms_deformable_attn
kernels toGroundingDino
Who can review it?
@NielsRogge