-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
importing of transformers 4.29.2 slows down PyToch DataLoader's multi-processing significantly #23870
Comments
Both take the same time on my side, so it's not just Transformers but some external library causing the problem. Could you share your full env? |
Thanks for your reply! Here is the env generated by Pytorch env script:
Here is my conda environment:
|
This is really puzzling as |
@sgugger Yeah, it's really puzzling. I think ZailiWang said it may be because "that transformers have another openmp dependency and the new openmp lib flushed llvm-openmp invoked by torch" in anohter issue. |
We do not have an openmp dependency. And if you look at the transformers init you will see that nothing is done there. |
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread. Please note that issues that do not follow the contributing guidelines are likely to be ignored. |
System Info
transformers
version: 4.29.2Who can help?
No response
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
The issue is firstly report to
PyTorch
, then I found it's caused bytransformers
Original IssueThe codes below take 23.6 seconds with only 2 CPU cores fully used, even though I didn't really use the transformers.
And by importing
torch
beforetransformers
, the CPU is fully used and only takes 5.4 seconds.Expected behavior
The aforementioned issue happens to
transformers 4.29.2
. I tested 4.26.1 as well and it works fine.I expect the multi-processing DataLoader can fully use my CPU so the data processing could be faster.
The text was updated successfully, but these errors were encountered: