grape icon indicating copy to clipboard operation
grape copied to clipboard

How to control number of threads?

Open SmilingYogi opened this issue 1 year ago • 4 comments

I am using grape.embedders.Node2VecGloVeEnsmallen in an environment where there is a strict limit on number of threads being spawned. I could not find any argument that sets the number of threads.

Is there a recommended way to work around this?

SmilingYogi avatar Oct 10 '24 08:10 SmilingYogi

Try setting the RAYON_NUM_THREADS system variable.

LucaCappelletti94 avatar Oct 10 '24 08:10 LucaCappelletti94

Thanks for the reply! Is there any way to do it within the grape functions only?

SmilingYogi avatar Oct 10 '24 08:10 SmilingYogi

Not for those using Rayon for parallelism such as Node2VecGloVeEnsmallen. The ones that were straightforwardly possible to set it via a parameter are already available as kwargs.

LucaCappelletti94 avatar Oct 10 '24 08:10 LucaCappelletti94

Okay. Can you point me to any Node2Vec or similar embedding methods where I can set it via a parameter?

Thanks!

SmilingYogi avatar Oct 10 '24 08:10 SmilingYogi