Skip to content

Conversation

ebr
Copy link
Member

@ebr ebr commented May 1, 2023

On hyperthreaded CPUs we get two threads operating on the queue by default on each core. This cases two threads to process queue items. This results in pytorch errors and sometimes generates garbage.

Locking this to single thread makes sense because we are bound by the number of GPUs in the system, not by CPU cores. And to parallelize across GPUs we should just start multiple processors (and use async instead of threading)

Fixes #3289

On hyperthreaded CPUs we get two threads operating on the queue by
default on each core. This cases two threads to process queue items.
This results in pytorch errors and sometimes generates garbage.

Locking this to single thread makes sense because we are bound by the
number of GPUs in the system, not by CPU cores. And to parallelize
across GPUs we should just start multiple processors (and use async
instead of threading)

Fixes #3289
@ebr ebr requested a review from psychedelicious May 1, 2023 15:19
Copy link
Contributor

@Kyle0654 Kyle0654 left a comment

Choose a reason for hiding this comment

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

Might this work on some systems that could support it? E.g. multi-GPU systems?

@ebr
Copy link
Member Author

ebr commented May 1, 2023

Might this work on some systems that could support it? E.g. multi-GPU systems?

It might, but we would still need a mechanism for selecting the GPU, which would be separate from this
Thanks for the quick approval!

@ebr ebr merged commit d39de0a into main May 1, 2023
@ebr ebr deleted the processor-single-thread branch May 1, 2023 22:24
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.

[bug]: single nodes instance generates multiple images at the same time

2 participants