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

[ASK] Multithreading in BiVAE #410

Closed
ip-iulia opened this issue Jun 2, 2021 · 4 comments
Closed

[ASK] Multithreading in BiVAE #410

ip-iulia opened this issue Jun 2, 2021 · 4 comments

Comments

@ip-iulia
Copy link

ip-iulia commented Jun 2, 2021

Description

I have recently started to experiment with the BiVAE model. I noticed that the training of this model appears to be multithreaded when it is trained on CPU only. Could you please advise if there is a way to control or know the number of threads used by the model? Is there a default number of threads or a parameter that controls this? Thank you.

@saghiles
Copy link
Member

saghiles commented Jun 2, 2021

Hi @ip-iulia, the current implementation of BiVAE is itself not Multithreaded, we can therefore not specify the number of threads. However, it is possible that some predefined functions used in BiVAE code are multithreaded, but still currently we do not have control over the number of threads for those functions.

@tqtg
Copy link
Member

tqtg commented Jun 2, 2021

@ip-iulia the implementation of BiVAE uses PyTorch as backend so it's up to PyTorch to obtain best efficiency based on your available resources. Any particular reason why you want to set a specific number of threads?

@ip-iulia
Copy link
Author

ip-iulia commented Jun 2, 2021

Hi @saghiles, @tqtg, thank you for your replies. I was curious to see if the number of threads could be configured rather than allowing PyTorch to determine it based on the available resources.

@tqtg
Copy link
Member

tqtg commented Jun 3, 2021

@ip-iulia you can use torch.set_num_threads(int) API. However, it also depends on what parallelization library being used on your machine and needed to be configured properly. More details can be found here.

@tqtg tqtg closed this as completed Jun 9, 2021
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

3 participants