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

Problem with finetuning speed #9

Open
insundaycathy opened this issue Aug 15, 2023 · 1 comment
Open

Problem with finetuning speed #9

insundaycathy opened this issue Aug 15, 2023 · 1 comment

Comments

@insundaycathy
Copy link

Hi, thanking for the great work.
But when I tried to finetune the network on my own data, I encounter problems with efficiency.

  1. If I set the num_workers in the Dataloader to >0, the data loading process becomes extremely slow and the loading time increases with each worker.
  2. The time to backpropagate tho the graph (the time to execute this line of code) increases in proportion to the batch size.
    scaler.scale(loss).backward()

I want to ask if this is normal in finetuning or have I somehow introduced a bug. Also, is there anyway to speed up?

@klauscc
Copy link
Owner

klauscc commented Aug 16, 2023

Hi, Thanks for your interests.
I encountered a similar issue on another project on other servers.
The issue may be caused by the video reader we used decord. decord seems have some issue with pytorch's multiprocess in dataloader.

My solution is to add "spawn" when creating dataloader:

dataloader = Dataloader(multiprocessing_context="spawn", 
                                          ....)

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

No branches or pull requests

2 participants