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

Draft: ToCTree env collector: disable read-parallelism #12885

Conversation

jayaddison
Copy link
Contributor

Feature or Bugfix

  • Bugfix

Purpose

Bugreports #6714 and #12409 indicate that the table-of-contents collection process is not currently implemented in a way that guarantees deterministic resolution in the presence of parallelism.

Until such time as we can implement that, disable parallel reads for the TocTreeCollector so that the tree is resolved serially.

Detail

  • Disable parallel reads for the TocTreeCollector by setting parallel_read_safe: False for it.

Relates

Bugreports #6714 and #12409 indicate that the table-of-contents
collection process is not currently implemented in a way that
guarantees deterministic resolution in the presence of parallelism.

Until such time as we can implement that, disable parallel reads
for the `TocTreeCollector` so that the tree is resolved serially.
@bmwiedemann
Copy link
Contributor

I tested that this fully helps with linux kernel-docs reproducibilty.

@kartben
Copy link
Contributor

kartben commented Sep 12, 2024

Would be great to get a rough idea of the potential impact on build speed (if any). Thanks!

@chrisjsewell
Copy link
Member

@jayaddison you realise that this would literally mean it would be impossible to run sphinx in parallel 😅
This is a non-starter, you need to actually fix the problem

@jayaddison
Copy link
Contributor Author

@jayaddison you realise that this would literally mean it would be impossible to run sphinx in parallel 😅 This is a non-starter, you need to actually fix the problem

Agreed; I didn't realize that disabling read-parallelism for a single extension also causes read-parallelism to be disabled for all other extensions within the same build.

Fortunately there is at least one testroot (test-toctree-glob) that exhibits the toctree parallel-build-non-determinism, so it may be possible to narrow in on the problem more easily now.

@jayaddison jayaddison closed this Sep 12, 2024
@jayaddison jayaddison deleted the issue-6714/disable-toctree-collection-parallelism branch September 12, 2024 11:19
@jayaddison
Copy link
Contributor Author

I tested that this fully helps with linux kernel-docs reproducibilty.

Thank you, @bmwiedemann 👍

@bmwiedemann
Copy link
Contributor

A quick benchmark run with our kernel-docs package showed that build time on a 4-core-VM went from 626 to 733 seconds. A 8-core-VM went from 552 to 788 s.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
internals:toctree python Pull requests that update Python code type:performance
Projects
None yet
4 participants