Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ instance/
docs/_build
docs/apidocs

# Fern autodoc (generated by fern docs md generate)
fern/product-docs/

# PyBuilder
target/

Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/Megatron-LM
Submodule Megatron-LM updated 1542 files
100 changes: 100 additions & 0 deletions fern/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# Megatron Bridge Fern Documentation

This folder contains the Fern Docs configuration for Megatron Bridge.

## Installation

```bash
npm install -g fern-api
# Or: npx fern-api --version
```

## Local Preview

```bash
cd fern/
fern docs dev
# Or from project root: fern docs dev --project ./fern
```

Docs available at `http://localhost:3000`.

## Folder Structure

```
fern/
├── docs.yml # Global config (title, colors, versions)
├── fern.config.json # Fern CLI config
├── versions/
│ └── v0.2.0.yml # Navigation for v0.2.0
├── v0.2.0/
│ └── pages/ # MDX content for v0.2.0
├── scripts/ # Migration and conversion scripts
└── assets/ # Favicon, images
```

## Migration Workflow

To migrate or update docs from `docs/` to Fern:

```bash
# 1. Copy docs to fern (run from repo root)
python3 fern/scripts/copy_docs_to_fern.py v0.2.0

# 2. Expand {include} directives (index, changelog)
python3 fern/scripts/expand_includes.py fern/v0.2.0/pages

# 3. Convert MB-specific syntax (py:class, py:meth)
python3 fern/scripts/convert_mb_specific.py fern/v0.2.0/pages

# 4. Convert MyST to Fern MDX
python3 fern/scripts/convert_myst_to_fern.py fern/v0.2.0/pages

# 5. Add frontmatter
python3 fern/scripts/add_frontmatter.py fern/v0.2.0/pages

# 6. Update internal links
python3 fern/scripts/update_links.py fern/v0.2.0/pages

# 7. Remove duplicate H1s (when title matches frontmatter)
python3 fern/scripts/remove_duplicate_h1.py fern/v0.2.0/pages

# 8. Validate
./fern/scripts/check_unconverted.sh fern/v0.2.0/pages
```

## MDX Components

```mdx
<Note>Informational note</Note>
<Tip>Helpful tip</Tip>
<Warning>Warning message</Warning>
<Info>Info callout</Info>

<Cards>
<Card title="Title" href="/path">Description</Card>
</Cards>

<Tabs>
<Tab title="Python">```python\ncode\n```</Tab>
</Tabs>

<Accordion title="Details">Collapsible content</Accordion>
```

## API Reference

API docs are built by Sphinx (autodoc2) and hosted at docs.nvidia.com. The "API Reference" link in the navbar points to `https://docs.nvidia.com/nemo/megatron-bridge/latest/apidocs/`.

## Deploying

```bash
fern generate --docs
fern docs deploy
```

## Useful Links

- [Fern Docs](https://buildwithfern.com/learn/docs)
- [MDX Components](https://buildwithfern.com/learn/docs/components)
- [Versioning Guide](https://buildwithfern.com/learn/docs/configuration/versions)
35 changes: 35 additions & 0 deletions fern/assets/NVIDIA_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions fern/assets/NVIDIA_light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions fern/assets/NVIDIA_symbol.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions fern/assets/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Fern Assets

Add `favicon.png` here for the docs site logo and favicon.
See NeMo Curator or DataDesigner fern/assets for reference.
Binary file added fern/assets/Repo-Mbridge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fern/assets/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fern/assets/training/images/canonical_lora.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fern/assets/training/images/ddp.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fern/assets/training/images/ep.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fern/assets/training/images/mtp_loss.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fern/assets/training/images/performant_lora.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fern/assets/training/images/pnom.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fern/assets/training/images/pp.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fern/assets/training/images/pp_comm_overlap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fern/assets/training/images/sp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fern/assets/training/images/tp1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fern/assets/training/images/tp2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fern/assets/training/images/tp_comm_overlap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading