Skip to content

Use myst_nb in docs #148105

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
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Use myst_nb in docs #148105

wants to merge 1 commit into from

Conversation

zou3519
Copy link
Contributor

@zou3519 zou3519 commented Feb 27, 2025

myst_nb is a plugin that:

  1. allows rendering of jupyter notebooks in documentation 2) allows execution of code blocks in markdown docs

Execution of code blocks in markdown docs may slow down build time. In order to limit the impact:

  • by default, we do not execute code blocks when run locally. To run them locally, set the PYTORCH_NB_EXECUTE=1 envvar
  • code blocks will be executed in CI. We could tweak this more, but right now the biggest problem with doc iteration time in CI isn't the docs build, it's needing to wait for the pytorch build.
  • there is a 30 second timeout per md file. We want to emphasize that notebook execution should not be abused for long-running things.

Test Plan:

  • I switched over torch.cond's documentation to markdown.
  • The new torch.cond doc has some executable code blocks. They are not all executable.
  • The rendering might look goofy, but I'm confident that everything will render correctly with the pydata-sphinx-theme, so I don't want to spend time trying to figure out the CSS right now.

myst_nb is a plugin that:
1) allows rendering of jupyter notebooks in documentation
2) allows execution of code blocks in markdown docs

Execution of code blocks in markdown docs may slow down build time. In
order to limit the impact:
- by default, we do not execute code blocks when run locally. To run
  them locally, set the PYTORCH_NB_EXECUTE=1 envvar
- code blocks will be executed in CI. We could tweak this more, but
  right now the biggest problem with doc iteration time in CI isn't the
  docs build, it's needing to wait for the pytorch build.
- there is a 30 second timeout per md file. We want to emphasize that
  notebook execution should not be abused for long-running things.

Test Plan:
- I switched over torch.cond's documentation to markdown.
- The new torch.cond doc has some executable code blocks. They are not
  all executable.
- The rendering might look goofy, but I'm confident that everything will
  render correctly with the pydata-sphinx-theme, so I don't want to
  spend time trying to figure out the CSS right now.
Copy link

pytorch-bot bot commented Feb 27, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/148105

Note: Links to docs will display an error until the docs builds have been completed.

❌ 4 New Failures

As of commit 903dcab with merge base 7ae0e0b (image):

NEW FAILURES - The following jobs have failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

Copy link
Contributor

This PR needs a release notes: label

If your changes are user facing and intended to be a part of release notes, please use a label starting with release notes:.

If not, please add the topic: not user facing label.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "topic: not user facing"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

Copy link
Contributor

Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as Stale.
Feel free to remove the Stale label if you feel this was a mistake.
If you are unable to remove the Stale label please contact a maintainer in order to do so.
If you want the bot to never mark this PR stale again, add the no-stale label.
Stale pull requests will automatically be closed after 30 days of inactivity.

@github-actions github-actions bot added the Stale label Apr 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant