You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hmm thanks for flagging this @charlesbluca. I've not seen this on other PRs recently. We did make some changes to how we generate our API docs, but that was several weeks ago (cc @jsignell). Are you seeing this error consistently?
tl;dr: Looks like there were no changes in Dask that produced this slowdown, but somehow the newer dask-sphinx-theme seems to make a huge difference. The solution for now is to set dask-sphinx-theme>=1.3.5,<2 in docs/requirements-docs.txt.
I launched two builds on astrojuanlu#1, one for 049d803 (which passed 3 days ago) and another one for ba29ba3, which failed 2 days ago. They got built on our large builders so they passed - but they took ~1400 seconds, whereas main used to take ~400 seconds.
@jsignell and I have been doing a bunch of work on the docs lately.
In version 2 of the dask sphinx theme we now use the executable book theme instead of the read the docs theme as a base. Most of the other Dask projects have already rebuilt docs with the new theme.
I'm not surprised that it takes longer to build, the new theme is more complex and has more features. It's disappointing that this is long enough to hit a timeout though. Pinning to the old theme, for now, is a fine bandaid but we should get this resolved properly.
@choldgraf do you have any suggestions on improving performance here?
Hmmm it is strange to see such a big change in performance. I wonder - does Dask have any really big API docs pages? I wonder if this is pydata/pydata-sphinx-theme#381 as well (the book theme inherits the pydata theme as they reuse much of the same style and components).
Just a note that we recently got a little numfocus grant to work on the pydata theme, so I suspect improving performance will be something that happens once that gets rolling
We can increase build limits on a per-project basis. Send an email to [email protected] providing a good reason why your documentation needs more resources.
I looked into this today and it was more complicated than I was hoping haha. I think that there are still improvements we could make, but there seems to be some fundamental reality that include a ton of API docs on every single page will slow things down considerably.
However, there was a new feature we implemented in the pydata theme to try and help with this, which is to optionally limit the depth of the navigation bar so that items N levels deep aren't included at all. If your API documentation is nested enough levels deep, then this should be a way that you can prevent them from slowing down your builds. I've got a PR to document and add support for this in the book theme, wanna try it out from there and see if this could fix things?
This means that a toctree entry is being generated for every single API entry. If you remove :toctree: from the directive, I believe that the stub pages are still generated, and you can click through to them from the main API landing page, but they just aren't inserted into the left toctree anymore.
Can somebody try this and see if this works?
EDIT: argh I tried this on the pydata docs and it doesn't generate the stub pages properly unless you use :toctree:
Activity
jrbourbeau commentedon Oct 6, 2021
Hmm thanks for flagging this @charlesbluca. I've not seen this on other PRs recently. We did make some changes to how we generate our API docs, but that was several weeks ago (cc @jsignell). Are you seeing this error consistently?
charlesbluca commentedon Oct 6, 2021
Not sure if it's a consistent failure, just noticed it on the past handful of PRs:
memory_usagetoTrueifverboseisTruein info #8222jsignell commentedon Oct 6, 2021
I think it takes longer to build with the new theme @jacobtomlinson do you have any ideas about how to handle this?
jakirkham commentedon Oct 6, 2021
It also fails on
mainjakirkham commentedon Oct 6, 2021
cc @astrojuanlu (in case you have any advice for us so we can debug this further)
astrojuanlu commentedon Oct 7, 2021
Most importantly, the "excessive memory consumption" is misleading: the builds are failing because of timeout.
The last passing build of
mainappears to be https://readthedocs.org/projects/dask/builds/14901502/, which took half the time it's taking now. Suspicious.I'll inspect this more closely in the coming hours.
jakirkham commentedon Oct 7, 2021
Thanks Juan! 😄
astrojuanlu commentedon Oct 7, 2021
tl;dr: Looks like there were no changes in Dask that produced this slowdown, but somehow the newer dask-sphinx-theme seems to make a huge difference. The solution for now is to set
dask-sphinx-theme>=1.3.5,<2indocs/requirements-docs.txt.I launched two builds on astrojuanlu#1, one for 049d803 (which passed 3 days ago) and another one for ba29ba3, which failed 2 days ago. They got built on our large builders so they passed - but they took ~1400 seconds, whereas
mainused to take ~400 seconds.This step:
took 200 seconds on the good build, and
took 1140 s on the bad build. Therefore, there were no code changes in Dask that produced this slowdown.
The only relevant difference in dependencies I saw was dask-sphinx-theme-1.3.6 vs dask-sphinx-theme-2.0.0. So I went ahead and pinned it, and that seemed to do the trick. https://readthedocs.org/projects/dask-astrojuanlu/builds/14928907/ took less than 400 seconds. Therefore, for now the solution is
jacobtomlinson commentedon Oct 7, 2021
@jsignell and I have been doing a bunch of work on the docs lately.
In version 2 of the dask sphinx theme we now use the executable book theme instead of the read the docs theme as a base. Most of the other Dask projects have already rebuilt docs with the new theme.
I'm not surprised that it takes longer to build, the new theme is more complex and has more features. It's disappointing that this is long enough to hit a timeout though. Pinning to the old theme, for now, is a fine bandaid but we should get this resolved properly.
@choldgraf do you have any suggestions on improving performance here?
jsignell commentedon Oct 7, 2021
Seems like readthedocs/readthedocs.org#8545 would be a good start :)
choldgraf commentedon Oct 7, 2021
Hmmm it is strange to see such a big change in performance. I wonder - does Dask have any really big API docs pages? I wonder if this is pydata/pydata-sphinx-theme#381 as well (the book theme inherits the pydata theme as they reuse much of the same style and components).
jacobtomlinson commentedon Oct 7, 2021
Yeah it does.
jsignell commentedon Oct 7, 2021
Yeah that seems like it. In the short-term, I think there are a couple possible solutions:
choldgraf commentedon Oct 7, 2021
Just a note that we recently got a little numfocus grant to work on the pydata theme, so I suspect improving performance will be something that happens once that gets rolling
jsignell commentedon Oct 7, 2021
In that case my vote would be to either ask or pay for our build times to be increased :)
jsignell commentedon Oct 7, 2021
Who's in charge of money things? @mrocklin or maybe @TomAugspurger?
choldgraf commentedon Oct 7, 2021
I also think it might be easy to get a quick speed up in the pydata theme, will see if my hunch is correct today
astrojuanlu commentedon Oct 7, 2021
No need to throw money at it :)
choldgraf commentedon Oct 7, 2021
I looked into this today and it was more complicated than I was hoping haha. I think that there are still improvements we could make, but there seems to be some fundamental reality that include a ton of API docs on every single page will slow things down considerably.
However, there was a new feature we implemented in the pydata theme to try and help with this, which is to optionally limit the depth of the navigation bar so that items N levels deep aren't included at all. If your API documentation is nested enough levels deep, then this should be a way that you can prevent them from slowing down your builds. I've got a PR to document and add support for this in the book theme, wanna try it out from there and see if this could fix things?
executablebooks/sphinx-book-theme#409
choldgraf commentedon Oct 8, 2021
Ah one more idea which I think would make a much bigger difference. The
autosummarydirectives currently are being used with atoctreeargument:dask/docs/source/array-api.rst
Lines 6 to 14 in 843c375
This means that a toctree entry is being generated for every single API entry. If you remove
:toctree:from the directive, I believe that the stub pages are still generated, and you can click through to them from the main API landing page, but they just aren't inserted into the lefttoctreeanymore.Can somebody try this and see if this works?
EDIT: argh I tried this on the pydata docs and it doesn't generate the stub pages properly unless you use
:toctree:choldgraf commentedon Oct 8, 2021
Ok i think i figured out a way to selectively remove navigation entries so that you can still autogenerate API docs with stub pages, but not have them show up in the navigation bar. Can you try adding the function here to your docs build and see if that fixes the speed issues? https://github.com/pydata/pydata-sphinx-theme/pull/492/files#diff-381cb883eeefc0f20f80b41392b657f8a6f8c12dc106954c84ed0c7402e37c64R475
jakirkham commentedon Oct 8, 2021
For reference, investigation into these improvements is happening in PR ( #8238 )
jsignell commentedon Oct 11, 2021
Thanks for looking into this @choldgraf!
Remove individual API doc pages from sphinx toctree (#8238)
jrbourbeau commentedon Jan 7, 2022
Closing as this issue has been resolved -- thanks all!
choldgraf commentedon Jan 7, 2022
I saw this pop up in my notifications and was like oh god what have we broken now?! 😆