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

glum with ray #806

Open
cfkstat opened this issue Jun 12, 2024 · 3 comments
Open

glum with ray #806

cfkstat opened this issue Jun 12, 2024 · 3 comments

Comments

@cfkstat
Copy link

cfkstat commented Jun 12, 2024

Using glum and joblib with ray, I ran multiple models and found that threads could use 1 core, and if I set n_jobs=1, I could only use 50% of all the cpu。

@MarcAntoineSchmidtQC
Copy link
Member

Can you share more of your setup and infrastructure? Maybe a minimal working example would also help to see how ray and glum interact. Unfortunately, I never used ray before, so I'm not sure what the intended behavior is.

@cfkstat
Copy link
Author

cfkstat commented Jun 18, 2024

When using ray, the value of the environment variable OMP_NUM_THREADS is set to 1 by default, and I changed it to 10, which worked fine in parallel. Is there any parameter in glum's package that can control the number of parallel cpus? If so, please tell me.

@MarcAntoineSchmidtQC
Copy link
Member

OMP_NUM_THREADS is not specific to ray. It controls the number of cores used by openmp, which both ray and glum use. Setting the environment variable to 10 will provide 10 cores to glum. If you use the cross-validated version of GeneralizedLinearRegressor, you can also set n_jobs=X so that the cross-validation will be split across X cores.

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

2 participants