Parallelize markdown generation with ProcessPoolExecutor#243
Merged
svekars merged 2 commits intopytorch_sphinx_theme2from Apr 8, 2026
Merged
Parallelize markdown generation with ProcessPoolExecutor#243svekars merged 2 commits intopytorch_sphinx_theme2from
svekars merged 2 commits intopytorch_sphinx_theme2from
Conversation
✅ Deploy Preview for pytorchsphinxtheme ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
LGTM! |
AlannaBurke
approved these changes
Apr 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
faster on 2,563 PyTorch Python doc pages)
_generate_md_filesto return a dict of {docname: md_content} instead of a count, passing in-memory contentto
_generate_llms_full_txtto avoid redundant disk readspytorch_sphinx_theme2/llm_generation.py:
_convert_single_doc()as a top-level function (required for ProcessPoolExecutor pickling)_generate_md_files()now uses ProcessPoolExecutor to convert docs in parallel; returns dict[docname, md_content]instead of int
_generate_llms_full_txt()takes the in-memory md_contents dict instead of re-reading .md files from disktests/test_llm_markdown.py:
TestGenerateMdFiles,TestGenerateLlmsFullTxt) to match new return types and signaturesBenchmarks
All parallel results match sequential output byte-for-byte.
Test plan
tests/test_llm_markdown.py)Tested against pytorch docs pytorch/pytorch#179268