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

efficient 2-stage parallel builder? #7891

Open
dimpase opened this issue Jun 29, 2020 · 11 comments
Open

efficient 2-stage parallel builder? #7891

dimpase opened this issue Jun 29, 2020 · 11 comments
Labels
internals:parallel type:enhancement enhance or introduce a new feature

Comments

@dimpase
Copy link

dimpase commented Jun 29, 2020

Due to slowness of Sphinx in buidling of the reference manual of SageMath several years ago we implemented a paralell 2-stage customised Sphinx builder, details may be found in https://trac.sagemath.org/ticket/20080

In a nutshell, it runs Sphinx once to generate intersphinx "object.inv" inventory files and pickle files; these are used in a parallelised 2nd run, where independent builders process subcollections of documents independently, using intersphinx extension to make sure cross-references are maintained; finally, the global index is built.

This gives a many-fold speedup on multi-core CPUs (to know by how much exactly, one would need to create a "standard" Sphinx setup for SageMath, and time it against our builder - but certainly if you have, say, 8 CPUs cores available, the speedup is about 5 to 6-fold, if compared with just using 1 CPU).


As Sphinx evolves, our setup gets harder to maintain (it does not help that several people who originally implemented it drifted away from the project), so we would like to streamline and upgrade our setup, using as much as is available from Sphinx upstream.
Perhaps upstream might be interested in having a similar parallel builder based on this idea, then we could just use it, and do not maintain our builder.

@dimpase dimpase added the type:enhancement enhance or introduce a new feature label Jun 29, 2020
@tk0miya
Copy link
Member

tk0miya commented Jul 11, 2020

A while ago, I tried to build the document of sagemath via the original sphinx-build. But I can't find the way to build it. I need to know the structure of the document. It seems https://github.com/sagemath/sage/tree/develop/src/doc contains many sphinx project. @dimpase Is there any document or article for the structure of docs? I'd like to measure how slow the standard build at first.

@dimpase
Copy link
Author

dimpase commented Jul 11, 2020

By far the biggest document there is reference. The build time of it dominates the rest.
Thus I think it would be the interesting enough to measure on this document alone.

Most of it consists of docstrings in Sagemath Python/Cython library, i.e. in https://github.com/sagemath/sage/tree/develop/src/sage/

@dimpase
Copy link
Author

dimpase commented Jul 11, 2020

more precisely, the document I mean is here: https://github.com/sagemath/sage/tree/develop/src/doc/en/reference

@tk0miya
Copy link
Member

tk0miya commented Jul 14, 2020

Now I'm trying to create an environment to build the document... it seems I need to install many dependencies to build the docs...

@dimpase
Copy link
Author

dimpase commented Jul 14, 2020

This is correct - you basically might need a working copy of Sagemath. Do tell me if you have a problem with it; basically,
building Sage is well-supported on stable versions of Linux, such as Debian, Ubuntu, Fedora. It's OK on macOS, too. Windows is very painful though.

One way or another, it might be quicker to get Sagemath on conda.

@tk0miya
Copy link
Member

tk0miya commented Jul 14, 2020

It would be very helpful to me if there are well-prepared docker image (or Dockefile) to build the environment. I don't have experience of conda. So this is very tough for me.

@dimpase
Copy link
Author

dimpase commented Jul 14, 2020

Please try https://hub.docker.com/r/sagemath/sagemath/

Hopefully @mkoeppe and @saraedum can tell you more about Sagemath on docker, if needed.

@tk0miya
Copy link
Member

tk0miya commented Jul 14, 2020

Thank you for the info. I'll try it this weekend.

@dimpase
Copy link
Author

dimpase commented Jun 10, 2021

I wonder if you had a chance to try this out. Our doc builder keeps getting us troubles.

@tk0miya
Copy link
Member

tk0miya commented Jun 13, 2021

Sorry for the late response. I just tried the docker image now. But I still don't find the way to build the doc of sagemath yet. It's very helpful if somebody let me know the way to build the document of sagemath on my local.

@dimpase
Copy link
Author

dimpase commented Jun 13, 2021

@mkoeppe is there a way to quickly set up a docbuilding environment for Sage in docker?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internals:parallel type:enhancement enhance or introduce a new feature
Projects
None yet
Development

No branches or pull requests

3 participants