feat(docs): add Megatron parameter tuning guide#1652
Conversation
Document practical HBM, host-memory, and token-capacity estimates for Megatron training, and expose the guide through the Advanced documentation navigation.
There was a problem hiding this comment.
Code Review
This pull request adds a new documentation guide, "Megatron Parameter Tuning" (docs/advanced/megatron_param_tuning.md), which provides formulas and guidelines to estimate model-state memory, host memory, and token capacity for Megatron training. It also updates the advanced features index and the docs.json configuration to integrate the new page. The review feedback suggests clarifying the MoE formula in the guide by explicitly defining the trainable dense and expert parameter elements and their respective optimizer sharding degrees.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| | `N_t` | Trainable parameter elements on the rank; equal to `N` for full-parameter training | | ||
| | `Q` | Trainable parameter elements owned by the rank's distributed optimizer shard | | ||
|
|
||
| For full-parameter training with one optimizer shard group of size `S`, use `N_t = N` and `Q = N / S`. MoE models can have different dense and expert shard groups; in that case use `Q = N_dense / S_dense + N_expert / S_expert`. |
There was a problem hiding this comment.
To make the MoE formula more precise and actionable, we should clarify that markdown\nFor full-parameter training with one optimizer shard group of size `S`, use `N_t = N` and `Q = N / S`. MoE models can have different dense and expert shard groups; in that case use `Q = N_dense_t / S_dense + N_expert_t / S_expert`, where `N_dense_t` and `N_expert_t` are the trainable dense and expert parameter elements on the rank, and `S_dense` and `S_expert` are their respective optimizer sharding degrees (typically the data-parallel sizes of those groups).\n
Summary
Add a concise Megatron capacity-planning guide to the Advanced documentation.
Motivation
Document practical HBM, host-memory, and token-capacity estimates for Megatron training, and expose the guide through the Advanced documentation navigation.
Usage
Take
N,N_t, andQfrom the most heavily loaded Megatron rank, apply the documented HBM or CPU-offload formula, then calibrate--max-tokens-per-gpuwith two measured training runs.Design Notes
Verification
npx --yes mintlify@latest validatepassed.npx --yes mintlify@latest broken-linksfound no broken links.Review Focus
docs/advanced/megatron_param_tuning.mdagainst the current Megatron defaults.docs/advanced/index.mdanddocs/docs.jsonexpose the new page consistently.