Skip to content

feat: add complete optimizer docs#3017

Merged
winglian merged 2 commits into
mainfrom
feat/doc-optim
Aug 6, 2025
Merged

feat: add complete optimizer docs#3017
winglian merged 2 commits into
mainfrom
feat/doc-optim

Conversation

@NanoCode012
Copy link
Copy Markdown
Collaborator

@NanoCode012 NanoCode012 commented Aug 5, 2025

Description

The API docs only listed possible optimizers as OptimizerNames, so I thought it'd be best to make a separate doc to clarify this info and also the extra kwargs for certain optims.

Motivation and Context

How has this been tested?

Screenshots (if appropriate)

Types of changes

Social Handles (Optional)

Summary by CodeRabbit

  • Documentation
    • Expanded and reorganized the documentation for optimizers, providing a comprehensive overview of all supported and custom optimizers, including references and example configurations.
    • Updated the sidebar to move the optimizers documentation to the "Core Concepts" section for improved navigation.
  • Bug Fixes
    • Removed support for deprecated custom optimizers to streamline configuration and usage.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Aug 5, 2025

📝 Walkthrough

Walkthrough

The documentation was updated to extensively expand and restructure the optimizers section, providing a comprehensive overview of supported and custom optimizers, their references, and usage examples. Additionally, the sidebar configuration was adjusted to move the optimizers documentation to the "Core Concepts" section. Deprecated custom optimizers ao_adamw_4bit and ao_adamw_8bit were removed from the codebase.

Changes

Cohort / File(s) Change Summary
Sidebar Configuration
_quarto.yml
Moved docs/optimizers.qmd from the "Advanced Features" section to the "Core Concepts" section in the documentation sidebar configuration.
Optimizer Documentation
docs/optimizers.qmd
Expanded and restructured the optimizers documentation: added an overview of all Huggingface-supported optimizers, introduced a section for custom optimizers with references and configuration details, moved and enhanced the Dion optimizer section, and provided updated usage examples and references. No changes to code or public entities; documentation only.
Optimizer Configuration Code
src/axolotl/core/builders/base.py
Removed imports and handling of deprecated custom optimizers "ao_adamw_4bit" and "ao_adamw_8bit" from the optimizer configuration logic, including associated classes and deprecation warnings. No other changes to optimizer configuration logic.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • Dion optimizer support #3014: Implements the actual code support and integration of the Dion optimizer, which is directly related to the expanded and reorganized documentation in this PR.

Suggested labels

documentation

Suggested reviewers

  • winglian
  • SalmanMohammadi

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2993906 and 6ae853d.

📒 Files selected for processing (2)
  • docs/optimizers.qmd (1 hunks)
  • src/axolotl/core/builders/base.py (0 hunks)
💤 Files with no reviewable changes (1)
  • src/axolotl/core/builders/base.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/optimizers.qmd
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
  • GitHub Check: PyTest (3.11, 2.7.0)
  • GitHub Check: PyTest (3.11, 2.6.0)
  • GitHub Check: PyTest (3.11, 2.7.1)
  • GitHub Check: PyTest from Source Dist (3.11, 2.7.1)
  • GitHub Check: PyTest from Source Dist (3.11, 2.7.0)
  • GitHub Check: PyTest from Source Dist (3.11, 2.6.0)
  • GitHub Check: pre-commit
  • GitHub Check: pre-commit
  • GitHub Check: preview
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/doc-optim

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Aug 5, 2025

📖 Documentation Preview: https://6892e347a1dafd12f836642c--resonant-treacle-0fd729.netlify.app

Deployed on Netlify from commit 6ae853d

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
docs/optimizers.qmd (1)

10-54: Hard-coded optimizer list is brittle – generate it during doc build

Manually copying 40+ names will drift as soon as HF adds/renames an entry (and typos slip in – see the next comment).
Recommend replacing the static list with a Quarto/Python code-chunk that imports transformers and prints OptimizerNames.list(), so the page always reflects the library version used in CI.

-Here is a list of optimizers supported by transformers as of `v4.54.0`:
-
-<long manual list>
+```{python}
+from transformers.training_args import OptimizerNames
+for name in OptimizerNames.list():
+    print(f"- `{name}`")
+``` 
+
+*(Rendered automatically from the installed `transformers` package.)*
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ab49d16 and 2993906.

📒 Files selected for processing (2)
  • _quarto.yml (1 hunks)
  • docs/optimizers.qmd (1 hunks)
🔇 Additional comments (3)
_quarto.yml (1)

271-278: Relocation looks good – verify sidebar de-duplication elsewhere

docs/optimizers.qmd is now under “Core Concepts” and no longer appears in “Advanced Features”, which keeps the sidebar coherent.
Just double-check that no other sidebar subsection (e.g. “How To Guides”) still references the same file to avoid duplicate nav entries.

docs/optimizers.qmd (2)

21-33: Potential typos in optimizer names – please cross-check

ademamix, ademamix_8bit, paged_ademamix_* do not exist in HF 4.54.
The actual name is adamix (and derivatives). Incorrect spelling will confuse readers when they copy/paste config snippets.
Run a quick verification against OptimizerNames.list() and fix any mismatches.


124-127: PyTorch 2.7 reference may be premature

The note says “Implementation written for PyTorch 2.7+”. At the time of writing, 2.7 has not been released.
Confirm the minimum version required (likely 2.2+ with DTensor) and update the doc to avoid scaring users away unnecessarily.

Comment thread docs/optimizers.qmd Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@winglian winglian merged commit e3177c3 into main Aug 6, 2025
17 checks passed
@winglian winglian deleted the feat/doc-optim branch August 6, 2025 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants