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 custom kernel for DeformableDetr, RT-Detr, GroindingDINO, OmDet-Turbo in Pytorch 2.6.0 #35979

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

qubvel
Copy link
Member

@qubvel qubvel commented Jan 31, 2025

What does this PR do?

Updates

  • tesnor.type().is_cuda() -> tesnor.is_cuda();
  • tensor.data<...> -> tensor.data_ptr<...>

The following message appears in logs:

Tensor.type() is deprecated. Instead use Tensor.options(), which in many cases (e.g. in a constructor) 
is a drop-in replacement. If you were using data from type(), that is now available from Tensor 
itself, so instead of tensor.type().scalar_type(), use tensor.scalar_type() instead and instead of 
tensor.type().backend() use tensor.device().

Fixes #35976

Might be relevant:

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@HuggingFaceDocBuilderDev

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.

@qubvel
Copy link
Member Author

qubvel commented Jan 31, 2025

run-slow: rt-detr, deformable_detr, omdet-turbo

Copy link

This comment contains run-slow, running the specified jobs: ['models/deformable_detr'] ...

@qubvel qubvel added the Vision label Jan 31, 2025
@qubvel qubvel changed the title Updates deprecated code in DeformableDetr custom kernel FIx custom kernel for DeformableDetr, RT-Detr, GroindingDINO, OmDet-Turbo Jan 31, 2025
@qubvel qubvel changed the title FIx custom kernel for DeformableDetr, RT-Detr, GroindingDINO, OmDet-Turbo Fix custom kernel for DeformableDetr, RT-Detr, GroindingDINO, OmDet-Turbo in Pytorch 2.6.0 Jan 31, 2025
@qubvel qubvel marked this pull request as ready for review January 31, 2025 13:08
@qubvel
Copy link
Member Author

qubvel commented Jan 31, 2025

cc @molbap @ArthurZucker for review

@qubvel qubvel requested review from molbap and ArthurZucker January 31, 2025 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deformable DETR custom kernel fails to compile with PyTorch 2.6
2 participants