AnacletoLAB / grape

🍇 GRAPE is a Rust/Python Graph Representation Learning library for Predictions and Evaluations
MIT License
527 stars 38 forks source link

How to control number of threads? #63

Open SmilingYogi opened 4 days ago

SmilingYogi commented 4 days ago

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?

LucaCappelletti94 commented 4 days ago

Try setting the RAYON_NUM_THREADS system variable.

SmilingYogi commented 4 days ago

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

LucaCappelletti94 commented 4 days ago

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.

SmilingYogi commented 4 days ago

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

Thanks!