-
-
Notifications
You must be signed in to change notification settings - Fork 26.1k
CI Enable parallel build on CI via an env variable #18826
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes loky
an optional build time dependency, which makes it a little strange to put into the pyproject.toml
as "required".
But I think this is very nice to have and would be worth putting in advanced_installation.rst
.
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Actually the azure builds now last 30 min instead of 25 min on master. I suspect that this is because it's worth using So maybe I will remove the auto mode and just allow to pass an integer as an environment variable. This will be simpler to maintain. |
You did not finish your sentence :) What's the issue with this ? |
Ooops. I edited the description. |
Setting parallelism to 3 instead of 2 on a 2 core machine is not necessarily that beneficial in retrospect. But it does not seem to hurt either. Anyways, I don't plan to tweak this PR any further. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks! |
On the wheel build, it's not easy to do the usual
python setup.py build_ext -j 3
because cibuildwheel does not allow to customize the build command and it uses pip wheel that does the build in an isolated environment (which is otherwise nice to make sure we respect the pinned versions of the build dependencies from pyproject.toml).Furthermore, I expect that on some future ARM builds we will get many more cores than on x86 hosts but we need to be able to automatically defect the number of usable cores for optimal performance and avoiding over-subscription caused by docker CPU quotas for instance.
So here is a tentative update of our custom
build_ext
commandto automatically use as many core as possible by settingto use 3 parallel tasks by settingSKLEARN_BUILD_PARALLEL=auto
SKLEARN_BUILD_PARALLEL=3
in the various CI environments.Edit: use a static level of parallel build task to allow for overlapping IO and CPU bound tasks.