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

Support multi processes for predictor #272

Merged
merged 2 commits into from
Feb 1, 2023

Conversation

Cathy0908
Copy link
Collaborator

Support multi processes for predictor.

env:torch1.8.0, cuda102, v100, cpu 96 core

需要在子进程中设置torch.set_num_threads(1)解决pytorch多进程卡死的问题。
问题描述参考:[ToTensor deadlock in subprocess · Issue #7068 · pytorch/vision · GitHub](pytorch/vision#7068)
torch dataloder多进程时也设置了num_threads=1,参考:torch.utilss.data._utils.worker._worker_loop

image

image

@Cathy0908 Cathy0908 changed the title Optimize predictor Support multi processes for predictor Jan 30, 2023
@Cathy0908 Cathy0908 merged commit 74ecd3d into alibaba:master Feb 1, 2023
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.

2 participants