Skip to content

Docs: highlight key optimization code lines with :emphasize-lines:#21568

Open
tsubasakong wants to merge 4 commits intoLightning-AI:masterfrom
tsubasakong:docs/12119_emphasize-lines
Open

Docs: highlight key optimization code lines with :emphasize-lines:#21568
tsubasakong wants to merge 4 commits intoLightning-AI:masterfrom
tsubasakong:docs/12119_emphasize-lines

Conversation

@tsubasakong
Copy link

@tsubasakong tsubasakong commented Mar 6, 2026

What does this PR do?

Fixes #12119.

This PR adds Sphinx :emphasize-lines: directives to key Python examples in the optimization docs so readers can quickly spot the important lines:

  • Automatic optimization loop internals (closure / step points)
  • Accessing the wrapped optimizer vs. raw optimizer
  • Custom LR scheduler integration
  • Gradient clipping customization
  • estimated_stepping_batches usage with OneCycleLR

These are docs-only changes (no behavior changes).

Before submitting
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing?
  • Did you verify relevant checks locally for this docs-only change?

📚 Documentation preview 📚: https://pytorch-lightning--21568.org.readthedocs.build/en/21568/

PR review

Anyone in the community is welcome to review the PR. Before you start reviewing, make sure you have read the review guidelines.

Reviewer checklist
  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified

Checklist

  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you verify new and existing tests pass locally with your changes?

@github-actions github-actions bot added docs Documentation related pl Generic label for PyTorch Lightning package labels Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation related pl Generic label for PyTorch Lightning package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use :emphasize-lines: in sphinx docs to highlight code.

1 participant