Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DOC: Enable parallel builds #28617

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

Merged
merged 1 commit into from
Jul 28, 2024
Merged

DOC: Enable parallel builds #28617

merged 1 commit into from
Jul 28, 2024

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Jul 26, 2024

PR summary

The latest sphinx-gallery 0.17.0 adds support for parallel building of examples, and the issue in pydata-sphinx-theme was fixed in 0.15.4, so we can try enabling it again.

We're on a large docker instance, with 4 cores and 8GB RAM; the RAM tracking shows we use max 43% / average 37%, so I've set parallelism to 2, which hopefully won't OOM.

cf #28244 for the last attempt that was stalled by the pydata-sphinx-theme issue.

PR checklist

@QuLogic QuLogic added Documentation: build building the docs CI: testing CI configuration and testing labels Jul 26, 2024
@QuLogic
Copy link
Member Author

QuLogic commented Jul 26, 2024

It looks like we are hitting joblib/joblib#883 (comment) which we could patch as in the link, but the deadlock is actually because we set warnings to be errors, so I've set joblib to be ignored.

The latest sphinx-gallery 0.17.0 adds support for parallel building of
examples, and the issue in pydata-sphinx-theme was fixed in 0.15.4, so
we can try enabling it again.
@QuLogic
Copy link
Member Author

QuLogic commented Jul 26, 2024

It also looks like we didn't really use any more RAM (and the peak is before we even start building docs), so I'm going to try bumping up to 4 processes.

@QuLogic
Copy link
Member Author

QuLogic commented Jul 26, 2024

Even at 4 jobs, we didn't really use much more RAM (max 53%), and didn't really get better times (15m16s for 2 vs 14m17s for 4).

I think also I should check what happens in release mode just to be sure that that won't OOM. I'll set to draft just so that this doesn't get merged while that is in progress.

@QuLogic QuLogic marked this pull request as draft July 26, 2024 06:06
@QuLogic
Copy link
Member Author

QuLogic commented Jul 26, 2024

Results:

Job Time Max CPU Max RAM
Serial PR (aka non-release mode) 22m19s 26% 36%
Serial main branch (release mode) 45m34s 57% 37%
Parallel 2x non-release mode 15m11s 51% 41%
Parallel 4x non-release mode 14m14s 100% 53%
Parallel 4x release mode 20m52s 100% 66%

(Note that the maximums are from the Resources tab after the first 2 minutes; I believe the spike at 2min is from earlier job steps, not the build step.)

So for non-release (PR) builds, 2x is ~7min quicker or ~68% of the previous time, 4x is ~8min quicker or ~64% of the previous time. For release (main) builds, 4x is ~25min quicker or ~45% of the previous time. I didn't bother checking release builds with 2x, since we didn't get anywhere close to OOMing.

I'm going to remove the release-job commit, and mark as ready again.

@timhoffm timhoffm merged commit 6a302e3 into matplotlib:main Jul 28, 2024
60 of 62 checks passed
@QuLogic QuLogic deleted the parallel-docs branch July 29, 2024 21:30
@QuLogic QuLogic added this to the v3.10.0 milestone Jul 29, 2024
timhoffm added a commit that referenced this pull request Sep 26, 2024
#28617 introduced parallel gallery builds. This needs joblib as a
dependency for sphinx-gallery. `requirements.txt` solves this via
`sphinx-gallery[parallel]>=0.12.0`. Unfortunately, conda does not
support variants, therefore we have to add the dependency
explicitly to `environment.yml`.
tacaswell pushed a commit that referenced this pull request Oct 17, 2024
#28617 introduced parallel gallery builds. This needs joblib as a
dependency for sphinx-gallery. `requirements.txt` solves this via
`sphinx-gallery[parallel]>=0.12.0`. Unfortunately, conda does not
support variants, therefore we have to add the dependency
explicitly to `environment.yml`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: testing CI configuration and testing Documentation: build building the docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants