Skip to content

[cuda kernels] only compile them when initializing#29133

Merged
ArthurZucker merged 12 commits intomainfrom
fix-make-fixup
Feb 20, 2024
Merged

[cuda kernels] only compile them when initializing#29133
ArthurZucker merged 12 commits intomainfrom
fix-make-fixup

Conversation

@ArthurZucker
Copy link
Copy Markdown
Collaborator

@ArthurZucker ArthurZucker commented Feb 20, 2024

What does this PR do?

Fixes #29130, from 1min to 6seconds

@ArthurZucker ArthurZucker changed the title only compile when needed [cuda kernels] only compile them when initializing Feb 20, 2024
Comment thread src/transformers/models/deformable_detr/modeling_deformable_detr.py Outdated
Comment thread src/transformers/models/deformable_detr/modeling_deformable_detr.py Outdated
@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

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.

@ArthurZucker ArthurZucker marked this pull request as ready for review February 20, 2024 10:59
Comment thread src/transformers/models/deta/modeling_deta.py Outdated
Copy link
Copy Markdown
Contributor

@amyeroberts amyeroberts left a comment

Choose a reason for hiding this comment

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

Great - thanks for fixing!

As long as the model tests pass in an env with ninja installed I think it's good to go!

@ArthurZucker
Copy link
Copy Markdown
Collaborator Author

I'll make sure of that before merging! Testing now!

@ArthurZucker
Copy link
Copy Markdown
Collaborator Author

ArthurZucker commented Feb 20, 2024

FAILED tests/models/deformable_detr/test_modeling_deformable_detr.py::DeformableDetrModelIntegrationTests::test_inference_object_detection_head - AssertionError: False is not true
FAILED tests/models/deformable_detr/test_modeling_deformable_detr.py::DeformableDetrModelIntegrationTests::test_inference_object_detection_head_equivalence_cpu_gpu - AssertionError: assert False
FAILED tests/models/deformable_detr/test_modeling_deformable_detr.py::DeformableDetrModelIntegrationTests::test_inference_object_detection_head_with_box_refine_two_stage - AssertionError: False is not true

failing. Logits do no match, failing on main as well

FAILED tests/models/deta/test_modeling_deta.py::DetaModelIntegrationTests::test_inference_object_detection_head - AssertionError: False is not true
FAILED tests/models/deta/test_modeling_deta.py::DetaModelIntegrationTests::test_inference_object_detection_head_swin_backbone - AssertionError: False is not true

failing as well on main. Merging

Yoso is alright

@ArthurZucker ArthurZucker merged commit 5e95dca into main Feb 20, 2024
@ArthurZucker ArthurZucker deleted the fix-make-fixup branch February 20, 2024 11:39
@NielsRogge NielsRogge mentioned this pull request Feb 23, 2024
8 tasks

global MultiScaleDeformableAttention

root = Path(__file__).resolve().parent.parent.parent / "kernels" / "deta"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey @ArthurZucker, was it intended for the root to be deta related?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@EduardoPach I think this is a copy-pasta. Would you like to open a PR to fix?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@amyeroberts, sure!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

thanks

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.

Move kernel compilation to init rather than at import stage

4 participants