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

Move kernel compilation to init rather than at import stage #29130

Closed
NielsRogge opened this issue Feb 20, 2024 · 0 comments · Fixed by #29133
Closed

Move kernel compilation to init rather than at import stage #29130

NielsRogge opened this issue Feb 20, 2024 · 0 comments · Fixed by #29133
Labels
bug Should Fix This has been identified as a bug and should be fixed.

Comments

@NielsRogge
Copy link
Contributor

Feature request

Some models like Deformable DETR rely on custom CUDA kernels to be compiled as seen here.

Currently these are compiled when importing the Transformers library, but this needs to happen later, when initializing the models.

All custom CUDA kernels are defined here: https://github.com/huggingface/transformers/tree/main/src/transformers/kernels

Motivation

This is pretty important to fix actually as currently running make fixup on machines that have ninja installed will compile all these kernels before running the quality checks, making it super slow.. thanks @younesbelkada for the info

Your contribution

Not sure I can help with this, the current workaround is simply removing ninja from the environment

@ArthurZucker ArthurZucker added Should Fix This has been identified as a bug and should be fixed. bug labels Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Should Fix This has been identified as a bug and should be fixed.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants