[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-nvidia-nemo-mbridge-perf-activation-recompute":3,"mdc--2uh6cg-key":34,"related-repo-nvidia-nemo-mbridge-perf-activation-recompute":1896,"related-org-nvidia-nemo-mbridge-perf-activation-recompute":2000},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":23,"repoUrl":24,"updatedAt":25,"license":26,"forks":27,"topics":28,"repo":29,"sourceUrl":32,"mdContent":33},"nemo-mbridge-perf-activation-recompute","optimize GPU memory with activation recompute","Validate and use selective and full activation recompute in Megatron Bridge to reduce GPU memory usage at the cost of extra compute.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},"nvidia","NVIDIA","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fnvidia.png",[12,16,19,20],{"name":13,"slug":14,"type":15},"Performance","performance","tag",{"name":17,"slug":18,"type":15},"Deep Learning","deep-learning",{"name":9,"slug":8,"type":15},{"name":21,"slug":22,"type":15},"Engineering","engineering",2473,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002Fskills","2026-07-14T05:29:31.983534","Apache-2.0",281,[],{"repoUrl":24,"stars":23,"forks":27,"topics":30,"description":31},[],"AI agent skills published by NVIDIA","https:\u002F\u002Fgithub.com\u002FNVIDIA\u002Fskills\u002Ftree\u002FHEAD\u002Fskills\u002Fnemo-mbridge-perf-activation-recompute","---\nname: nemo-mbridge-perf-activation-recompute\ndescription: Validate and use selective and full activation recompute in Megatron Bridge to reduce GPU memory usage at the cost of extra compute.\nlicense: Apache-2.0\nwhen_to_use: Reducing GPU memory via activation recompute, or investigating a commit that changed recompute settings and caused OOM or a regression; 'recompute_granularity', 'recompute_num_layers', 'recompute_modules', 'recompute_method', 'selective recompute', 'full recompute', 'activation memory OOM'.\n---\n\n# Activation Recompute\n\nStable docs: @docs\u002Ftraining\u002Factivation-recomputation.md\nCard: @skills\u002Fnemo-mbridge-perf-activation-recompute\u002Fcard.yaml\n\n\u003C!-- NVSkills CI refresh: 2026-06-15. No instruction changes. -->\n\n## What It Is\n\nActivation recompute trades GPU compute for memory by discarding intermediate\nactivations during the forward pass and recomputing them during backward.\nMegatron Bridge supports two granularities:\n\n| Granularity | What you specify | What gets recomputed | Memory savings | Compute cost |\n|---|---|---|---|---|\n| `selective` | `recompute_modules` list (e.g. `core_attn`, `mlp`) | specific submodules within each layer | moderate (module-dependent) | low to high |\n| `full` | `recompute_num_layers` + `recompute_method` | entire transformer layers (N layers) | strongest | highest |\n\nNote: MCore names these \"selective\" (submodule-level) vs \"full\" (layer-level).\n\"Full\" means recomputing full layers, not the full model — you still choose\nhow many layers via `recompute_num_layers`.\n\n## Quick Decision\n\n1. Rule out allocator fragmentation first with\n   `PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True`; see\n   @skills\u002Fnemo-mbridge-perf-memory-tuning\u002FSKILL.md.\n2. For activation pressure, start with selective recompute:\n   `recompute_granularity=\"selective\"` and `recompute_modules=[\"core_attn\"]`.\n3. Add modules by cost: `\"layernorm\"` is cheap but saves little, while `\"mlp\"`\n   saves much more memory at a clear throughput cost.\n4. Use full-layer recompute only when selective recompute does not fit, and set\n   all required fields: `recompute_granularity=\"full\"`, `recompute_method`, and\n   `recompute_num_layers`.\n5. With FP8 or TE-scoped CUDA graphs, avoid full-layer recompute unless graph\n   scope is `full_iteration`; otherwise use selective recompute or disable TE\n   graph capture.\n\nCPU offloading (`cpu_offloading=True`) is an alternative that avoids recompute\ncost entirely, but it is **incompatible with PP > 1**.\n\n## Enablement\n\n### Selective recompute\n\n```python\ncfg.model.recompute_granularity = \"selective\"\ncfg.model.recompute_modules = [\"core_attn\"]  # add \"layernorm\", \"mlp\", or other valid modules as needed\n```\n\n### Full-layer recompute\n\n```python\ncfg.model.recompute_granularity = \"full\"\ncfg.model.recompute_method = \"uniform\"\ncfg.model.recompute_num_layers = 4\n```\n\n### Available recompute_modules\n\n| Module | What it recomputes | Compute cost | Memory savings |\n|---|---|---|---|\n| `core_attn` | attention softmax\u002Fdropout\u002FQKV dot product | low (Flash Attention already recomputes internally) | moderate |\n| `layernorm` | layer normalization | negligible (~0%) | negligible |\n| `mlp` | full FFN block | high (~16% on Llama3 70B, hidden=28672) | ~3 GB |\n| `moe` | MoE expert dispatch | varies | varies |\n| `moe_act` | MoE activation functions | low | small |\n| `shared_experts` | shared expert layers | moderate | moderate |\n| `mla_up_proj` | Multi-Latent Attention up projection | moderate | moderate |\n\n### Performance harness CLI\n\n```bash\nuv run python scripts\u002Fperformance\u002Frun_script.py \\\n  -m llama \\\n  -mr llama3_8b \\\n  --task pretrain \\\n  -g h100 \\\n  -c bf16 \\\n  -ng 8 \\\n  --recompute_modules core_attn,layernorm \\\n  ...\n```\n\n## Compatibility and Constraints\n\n- `recompute_granularity=selective` requires a non-empty `recompute_modules` list\n- `recompute_granularity=full` requires `recompute_method` and `recompute_num_layers`\n- **Layer-level recompute (`recompute_granularity=\"full\"` +\n  `recompute_num_layers`) is incompatible with TE-scoped CUDA graphs.**\n  MCore calls this \"full\" granularity — the name refers to recomputing\n  full transformer layers, not the full model. Even though you're selecting\n  how many layers to recompute, MCore treats it differently from submodule\n  recompute. Any TE-scoped scope (`attn`, `mlp`, `moe_router`, etc.) will\n  assert. This commonly hits FP8 configs that enable TE-scoped graphs by\n  default (e.g. `LLAMA3_70B_SFT_CONFIG_H100_FP8_CS_V1` sets\n  `cuda_graph_impl=\"transformer_engine\"`, `cuda_graph_scope=\"mlp\"`). Options:\n  - use submodule recompute (`recompute_granularity=\"selective\"` +\n    `recompute_modules`) — compatible with TE-scoped graphs\n  - disable CUDA graphs (`cuda_graph_impl=\"none\"`) and use layer-level recompute\n  - switch to `cuda_graph_impl=\"local\"`, `cuda_graph_scope=\"full_iteration\"`\n- `distribute_saved_activations=True` cannot be combined with `sequence_parallel=True`\n- Combining `mlp` + `core_attn` recompute is slightly worse than `mlp` alone\n  due to double recompute overhead\n\n## Measured Results\n\nLlama3 70B SFT on 32x H100 80GB, FP8 (Current Scaling):\n- Baseline: TP=4, PP=4, VPP=5, DP=2, MBS=1, GBS=32, seq_len=4096\n- Golden GPU utilization: 709.93 TFLOP\u002Fs\u002FGPU\n- Regression threshold: 5%\n\n| Experiment | recompute_modules | TFLOP\u002Fs\u002FGPU | vs Golden | Peak Mem (GB) | Result |\n|---|---|---|---|---|---|\n| Baseline | [core_attn] | ~704 | -0.8% | 58.8 (OOM rank0) | OOM |\n| Exp 1 | [mlp] | 593.6 | -16.4% | 55.6 | Perf regression |\n| Exp 2 | [mlp, core_attn] | 586.8 | -17.3% | 55.6 | Perf regression |\n| Exp 3 | [core_attn, layernorm] | ~702 | -1.1% | 59.6 (OOM rank0) | OOM |\n\nKey takeaways:\n\n- `layernorm` recompute is nearly free compute-wise but saves negligible memory\n- `mlp` recompute saves ~3 GB peak but costs ~16% because the Llama3 70B FFN\n  (hidden=28672) is expensive to recompute\n- Combining `mlp` + `core_attn` is slightly worse than `mlp` alone\n- For this workload, the actual OOM fix was `PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True`\n  (memory fragmentation, not capacity). See @skills\u002Fnemo-mbridge-perf-memory-tuning\u002FSKILL.md.\n\n## Code Anchors\n\n### Recompute modules enum and selective checkpoint logic\n\n```python\n# 3rdparty\u002FMegatron-LM\u002Fmegatron\u002Fcore\u002Ftransformer\u002Ftransformer_block.py\n# _checkpointed_forward() applies selective recompute based on recompute_modules\n```\n\n### Recompute config validation\n\n```python\n# 3rdparty\u002FMegatron-LM\u002Fmegatron\u002Fcore\u002Ftransformer\u002Ftransformer_config.py\n# Validates recompute_granularity, recompute_method, recompute_num_layers\n```\n\n### Llama3 recipe defaults\n\n```99:103:src\u002Fmegatron\u002Fbridge\u002Frecipes\u002Fllama\u002Fllama3.py\n    # Memory saving (recompute & offloading)\n    cfg.model.recompute_granularity = None\n    cfg.model.recompute_modules = None\n    cfg.model.fine_grained_activation_offloading = False\n    cfg.model.offload_modules = None\n```\n\n### Full recompute + CUDA graph assertion (MCore)\n\n```2001:2005:3rdparty\u002FMegatron-LM\u002Fmegatron\u002Fcore\u002Ftransformer\u002Ftransformer_config.py\n            if self.recompute_granularity:\n                if self.recompute_granularity != \"selective\":\n                    assert self.cuda_graph_scope == [\n                        CudaGraphScope.full_iteration\n                    ], \"full recompute is only supported with full iteration CUDA graph.\"\n```\n\n### CPU offloading PP incompatibility (MCore)\n\n```1303:1306:3rdparty\u002FMegatron-LM\u002Fmegatron\u002Fcore\u002Ftransformer\u002Ftransformer_config.py\n        if self.cpu_offloading and self.pipeline_model_parallel_size > 1:\n            raise ValueError(\n                \"Currently there is no support for Pipeline parallelism with CPU offloading\"\n            )\n```\n\n## Failure Diagnosis\n\n| Symptom | Cause | Confirm | Fix |\n|---|---|---|---|\n| >15% GPU utilization drop | `mlp` recompute on a large FFN | check whether `recompute_modules` includes `mlp` | remove `mlp`, lower micro batch size, or use CPU offload if PP=1 |\n| Still OOM after adding layernorm | layernorm activations are too small to move the peak materially | compare peak memory before\u002Fafter | switch to a higher-impact module or full-layer recompute |\n| `AssertionError: full recompute is only supported with full iteration CUDA graph` | layer-level recompute with TE-scoped graph capture | check `cuda_graph_impl` and `cuda_graph_scope` | use `selective`, set `cuda_graph_impl=none`, or use `local` + `full_iteration` |\n| ValueError: PP + CPU offloading | `cpu_offloading=True` with `pipeline_model_parallel_size > 1` | check PP config | disable CPU offloading or set PP=1 |\n| mlp+core_attn worse than mlp alone | double recompute overhead | compare Exp 1 vs Exp 2 | use mlp alone |\n\n## Known Limitations\n\n- Per-module memory savings vary significantly by model architecture and hidden\n  dimension\n- No automatic module selection — users must choose which modules to recompute\n- `layernorm` recompute is almost never worth it as a standalone fix\n- CPU offloading (the zero-compute-cost alternative) is blocked when PP > 1\n\n## Verification\n\n```bash\nuv run python -m pytest \\\n  tests\u002Funit_tests\u002Ftraining\u002Ftest_config.py -k \"recompute\" -q\n```\n\nSuccess criteria:\n- Unit tests pass for recompute config validation\n- No assertion errors from config validation\n",{"data":35,"body":37},{"name":4,"description":6,"license":26,"when_to_use":36},"Reducing GPU memory via activation recompute, or investigating a commit that changed recompute settings and caused OOM or a regression; 'recompute_granularity', 'recompute_num_layers', 'recompute_modules', 'recompute_method', 'selective recompute', 'full recompute', 'activation memory OOM'.",{"type":38,"children":39},"root",[40,49,55,62,67,209,221,227,324,344,350,357,388,394,426,432,644,650,824,830,1036,1042,1047,1065,1245,1250,1309,1315,1321,1344,1350,1373,1379,1428,1434,1483,1489,1530,1536,1762,1768,1796,1802,1872,1877,1890],{"type":41,"tag":42,"props":43,"children":45},"element","h1",{"id":44},"activation-recompute",[46],{"type":47,"value":48},"text","Activation Recompute",{"type":41,"tag":50,"props":51,"children":52},"p",{},[53],{"type":47,"value":54},"Stable docs: @docs\u002Ftraining\u002Factivation-recomputation.md\nCard: @skills\u002Fnemo-mbridge-perf-activation-recompute\u002Fcard.yaml",{"type":41,"tag":56,"props":57,"children":59},"h2",{"id":58},"what-it-is",[60],{"type":47,"value":61},"What It Is",{"type":41,"tag":50,"props":63,"children":64},{},[65],{"type":47,"value":66},"Activation recompute trades GPU compute for memory by discarding intermediate\nactivations during the forward pass and recomputing them during backward.\nMegatron Bridge supports two granularities:",{"type":41,"tag":68,"props":69,"children":70},"table",{},[71,105],{"type":41,"tag":72,"props":73,"children":74},"thead",{},[75],{"type":41,"tag":76,"props":77,"children":78},"tr",{},[79,85,90,95,100],{"type":41,"tag":80,"props":81,"children":82},"th",{},[83],{"type":47,"value":84},"Granularity",{"type":41,"tag":80,"props":86,"children":87},{},[88],{"type":47,"value":89},"What you specify",{"type":41,"tag":80,"props":91,"children":92},{},[93],{"type":47,"value":94},"What gets recomputed",{"type":41,"tag":80,"props":96,"children":97},{},[98],{"type":47,"value":99},"Memory savings",{"type":41,"tag":80,"props":101,"children":102},{},[103],{"type":47,"value":104},"Compute cost",{"type":41,"tag":106,"props":107,"children":108},"tbody",{},[109,165],{"type":41,"tag":76,"props":110,"children":111},{},[112,123,150,155,160],{"type":41,"tag":113,"props":114,"children":115},"td",{},[116],{"type":41,"tag":117,"props":118,"children":120},"code",{"className":119},[],[121],{"type":47,"value":122},"selective",{"type":41,"tag":113,"props":124,"children":125},{},[126,132,134,140,142,148],{"type":41,"tag":117,"props":127,"children":129},{"className":128},[],[130],{"type":47,"value":131},"recompute_modules",{"type":47,"value":133}," list (e.g. ",{"type":41,"tag":117,"props":135,"children":137},{"className":136},[],[138],{"type":47,"value":139},"core_attn",{"type":47,"value":141},", ",{"type":41,"tag":117,"props":143,"children":145},{"className":144},[],[146],{"type":47,"value":147},"mlp",{"type":47,"value":149},")",{"type":41,"tag":113,"props":151,"children":152},{},[153],{"type":47,"value":154},"specific submodules within each layer",{"type":41,"tag":113,"props":156,"children":157},{},[158],{"type":47,"value":159},"moderate (module-dependent)",{"type":41,"tag":113,"props":161,"children":162},{},[163],{"type":47,"value":164},"low to high",{"type":41,"tag":76,"props":166,"children":167},{},[168,177,194,199,204],{"type":41,"tag":113,"props":169,"children":170},{},[171],{"type":41,"tag":117,"props":172,"children":174},{"className":173},[],[175],{"type":47,"value":176},"full",{"type":41,"tag":113,"props":178,"children":179},{},[180,186,188],{"type":41,"tag":117,"props":181,"children":183},{"className":182},[],[184],{"type":47,"value":185},"recompute_num_layers",{"type":47,"value":187}," + ",{"type":41,"tag":117,"props":189,"children":191},{"className":190},[],[192],{"type":47,"value":193},"recompute_method",{"type":41,"tag":113,"props":195,"children":196},{},[197],{"type":47,"value":198},"entire transformer layers (N layers)",{"type":41,"tag":113,"props":200,"children":201},{},[202],{"type":47,"value":203},"strongest",{"type":41,"tag":113,"props":205,"children":206},{},[207],{"type":47,"value":208},"highest",{"type":41,"tag":50,"props":210,"children":211},{},[212,214,219],{"type":47,"value":213},"Note: MCore names these \"selective\" (submodule-level) vs \"full\" (layer-level).\n\"Full\" means recomputing full layers, not the full model — you still choose\nhow many layers via ",{"type":41,"tag":117,"props":215,"children":217},{"className":216},[],[218],{"type":47,"value":185},{"type":47,"value":220},".",{"type":41,"tag":56,"props":222,"children":224},{"id":223},"quick-decision",[225],{"type":47,"value":226},"Quick Decision",{"type":41,"tag":228,"props":229,"children":230},"ol",{},[231,245,265,286,311],{"type":41,"tag":232,"props":233,"children":234},"li",{},[235,237,243],{"type":47,"value":236},"Rule out allocator fragmentation first with\n",{"type":41,"tag":117,"props":238,"children":240},{"className":239},[],[241],{"type":47,"value":242},"PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True",{"type":47,"value":244},"; see\n@skills\u002Fnemo-mbridge-perf-memory-tuning\u002FSKILL.md.",{"type":41,"tag":232,"props":246,"children":247},{},[248,250,256,258,264],{"type":47,"value":249},"For activation pressure, start with selective recompute:\n",{"type":41,"tag":117,"props":251,"children":253},{"className":252},[],[254],{"type":47,"value":255},"recompute_granularity=\"selective\"",{"type":47,"value":257}," and ",{"type":41,"tag":117,"props":259,"children":261},{"className":260},[],[262],{"type":47,"value":263},"recompute_modules=[\"core_attn\"]",{"type":47,"value":220},{"type":41,"tag":232,"props":266,"children":267},{},[268,270,276,278,284],{"type":47,"value":269},"Add modules by cost: ",{"type":41,"tag":117,"props":271,"children":273},{"className":272},[],[274],{"type":47,"value":275},"\"layernorm\"",{"type":47,"value":277}," is cheap but saves little, while ",{"type":41,"tag":117,"props":279,"children":281},{"className":280},[],[282],{"type":47,"value":283},"\"mlp\"",{"type":47,"value":285},"\nsaves much more memory at a clear throughput cost.",{"type":41,"tag":232,"props":287,"children":288},{},[289,291,297,298,303,305,310],{"type":47,"value":290},"Use full-layer recompute only when selective recompute does not fit, and set\nall required fields: ",{"type":41,"tag":117,"props":292,"children":294},{"className":293},[],[295],{"type":47,"value":296},"recompute_granularity=\"full\"",{"type":47,"value":141},{"type":41,"tag":117,"props":299,"children":301},{"className":300},[],[302],{"type":47,"value":193},{"type":47,"value":304},", and\n",{"type":41,"tag":117,"props":306,"children":308},{"className":307},[],[309],{"type":47,"value":185},{"type":47,"value":220},{"type":41,"tag":232,"props":312,"children":313},{},[314,316,322],{"type":47,"value":315},"With FP8 or TE-scoped CUDA graphs, avoid full-layer recompute unless graph\nscope is ",{"type":41,"tag":117,"props":317,"children":319},{"className":318},[],[320],{"type":47,"value":321},"full_iteration",{"type":47,"value":323},"; otherwise use selective recompute or disable TE\ngraph capture.",{"type":41,"tag":50,"props":325,"children":326},{},[327,329,335,337,343],{"type":47,"value":328},"CPU offloading (",{"type":41,"tag":117,"props":330,"children":332},{"className":331},[],[333],{"type":47,"value":334},"cpu_offloading=True",{"type":47,"value":336},") is an alternative that avoids recompute\ncost entirely, but it is ",{"type":41,"tag":338,"props":339,"children":340},"strong",{},[341],{"type":47,"value":342},"incompatible with PP > 1",{"type":47,"value":220},{"type":41,"tag":56,"props":345,"children":347},{"id":346},"enablement",[348],{"type":47,"value":349},"Enablement",{"type":41,"tag":351,"props":352,"children":354},"h3",{"id":353},"selective-recompute",[355],{"type":47,"value":356},"Selective recompute",{"type":41,"tag":358,"props":359,"children":364},"pre",{"className":360,"code":361,"language":362,"meta":363,"style":363},"language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","cfg.model.recompute_granularity = \"selective\"\ncfg.model.recompute_modules = [\"core_attn\"]  # add \"layernorm\", \"mlp\", or other valid modules as needed\n","python","",[365],{"type":41,"tag":117,"props":366,"children":367},{"__ignoreMap":363},[368,379],{"type":41,"tag":369,"props":370,"children":373},"span",{"class":371,"line":372},"line",1,[374],{"type":41,"tag":369,"props":375,"children":376},{},[377],{"type":47,"value":378},"cfg.model.recompute_granularity = \"selective\"\n",{"type":41,"tag":369,"props":380,"children":382},{"class":371,"line":381},2,[383],{"type":41,"tag":369,"props":384,"children":385},{},[386],{"type":47,"value":387},"cfg.model.recompute_modules = [\"core_attn\"]  # add \"layernorm\", \"mlp\", or other valid modules as needed\n",{"type":41,"tag":351,"props":389,"children":391},{"id":390},"full-layer-recompute",[392],{"type":47,"value":393},"Full-layer recompute",{"type":41,"tag":358,"props":395,"children":397},{"className":360,"code":396,"language":362,"meta":363,"style":363},"cfg.model.recompute_granularity = \"full\"\ncfg.model.recompute_method = \"uniform\"\ncfg.model.recompute_num_layers = 4\n",[398],{"type":41,"tag":117,"props":399,"children":400},{"__ignoreMap":363},[401,409,417],{"type":41,"tag":369,"props":402,"children":403},{"class":371,"line":372},[404],{"type":41,"tag":369,"props":405,"children":406},{},[407],{"type":47,"value":408},"cfg.model.recompute_granularity = \"full\"\n",{"type":41,"tag":369,"props":410,"children":411},{"class":371,"line":381},[412],{"type":41,"tag":369,"props":413,"children":414},{},[415],{"type":47,"value":416},"cfg.model.recompute_method = \"uniform\"\n",{"type":41,"tag":369,"props":418,"children":420},{"class":371,"line":419},3,[421],{"type":41,"tag":369,"props":422,"children":423},{},[424],{"type":47,"value":425},"cfg.model.recompute_num_layers = 4\n",{"type":41,"tag":351,"props":427,"children":429},{"id":428},"available-recompute_modules",[430],{"type":47,"value":431},"Available recompute_modules",{"type":41,"tag":68,"props":433,"children":434},{},[435,459],{"type":41,"tag":72,"props":436,"children":437},{},[438],{"type":41,"tag":76,"props":439,"children":440},{},[441,446,451,455],{"type":41,"tag":80,"props":442,"children":443},{},[444],{"type":47,"value":445},"Module",{"type":41,"tag":80,"props":447,"children":448},{},[449],{"type":47,"value":450},"What it recomputes",{"type":41,"tag":80,"props":452,"children":453},{},[454],{"type":47,"value":104},{"type":41,"tag":80,"props":456,"children":457},{},[458],{"type":47,"value":99},{"type":41,"tag":106,"props":460,"children":461},{},[462,488,515,541,567,594,619],{"type":41,"tag":76,"props":463,"children":464},{},[465,473,478,483],{"type":41,"tag":113,"props":466,"children":467},{},[468],{"type":41,"tag":117,"props":469,"children":471},{"className":470},[],[472],{"type":47,"value":139},{"type":41,"tag":113,"props":474,"children":475},{},[476],{"type":47,"value":477},"attention softmax\u002Fdropout\u002FQKV dot product",{"type":41,"tag":113,"props":479,"children":480},{},[481],{"type":47,"value":482},"low (Flash Attention already recomputes internally)",{"type":41,"tag":113,"props":484,"children":485},{},[486],{"type":47,"value":487},"moderate",{"type":41,"tag":76,"props":489,"children":490},{},[491,500,505,510],{"type":41,"tag":113,"props":492,"children":493},{},[494],{"type":41,"tag":117,"props":495,"children":497},{"className":496},[],[498],{"type":47,"value":499},"layernorm",{"type":41,"tag":113,"props":501,"children":502},{},[503],{"type":47,"value":504},"layer normalization",{"type":41,"tag":113,"props":506,"children":507},{},[508],{"type":47,"value":509},"negligible (~0%)",{"type":41,"tag":113,"props":511,"children":512},{},[513],{"type":47,"value":514},"negligible",{"type":41,"tag":76,"props":516,"children":517},{},[518,526,531,536],{"type":41,"tag":113,"props":519,"children":520},{},[521],{"type":41,"tag":117,"props":522,"children":524},{"className":523},[],[525],{"type":47,"value":147},{"type":41,"tag":113,"props":527,"children":528},{},[529],{"type":47,"value":530},"full FFN block",{"type":41,"tag":113,"props":532,"children":533},{},[534],{"type":47,"value":535},"high (~16% on Llama3 70B, hidden=28672)",{"type":41,"tag":113,"props":537,"children":538},{},[539],{"type":47,"value":540},"~3 GB",{"type":41,"tag":76,"props":542,"children":543},{},[544,553,558,563],{"type":41,"tag":113,"props":545,"children":546},{},[547],{"type":41,"tag":117,"props":548,"children":550},{"className":549},[],[551],{"type":47,"value":552},"moe",{"type":41,"tag":113,"props":554,"children":555},{},[556],{"type":47,"value":557},"MoE expert dispatch",{"type":41,"tag":113,"props":559,"children":560},{},[561],{"type":47,"value":562},"varies",{"type":41,"tag":113,"props":564,"children":565},{},[566],{"type":47,"value":562},{"type":41,"tag":76,"props":568,"children":569},{},[570,579,584,589],{"type":41,"tag":113,"props":571,"children":572},{},[573],{"type":41,"tag":117,"props":574,"children":576},{"className":575},[],[577],{"type":47,"value":578},"moe_act",{"type":41,"tag":113,"props":580,"children":581},{},[582],{"type":47,"value":583},"MoE activation functions",{"type":41,"tag":113,"props":585,"children":586},{},[587],{"type":47,"value":588},"low",{"type":41,"tag":113,"props":590,"children":591},{},[592],{"type":47,"value":593},"small",{"type":41,"tag":76,"props":595,"children":596},{},[597,606,611,615],{"type":41,"tag":113,"props":598,"children":599},{},[600],{"type":41,"tag":117,"props":601,"children":603},{"className":602},[],[604],{"type":47,"value":605},"shared_experts",{"type":41,"tag":113,"props":607,"children":608},{},[609],{"type":47,"value":610},"shared expert layers",{"type":41,"tag":113,"props":612,"children":613},{},[614],{"type":47,"value":487},{"type":41,"tag":113,"props":616,"children":617},{},[618],{"type":47,"value":487},{"type":41,"tag":76,"props":620,"children":621},{},[622,631,636,640],{"type":41,"tag":113,"props":623,"children":624},{},[625],{"type":41,"tag":117,"props":626,"children":628},{"className":627},[],[629],{"type":47,"value":630},"mla_up_proj",{"type":41,"tag":113,"props":632,"children":633},{},[634],{"type":47,"value":635},"Multi-Latent Attention up projection",{"type":41,"tag":113,"props":637,"children":638},{},[639],{"type":47,"value":487},{"type":41,"tag":113,"props":641,"children":642},{},[643],{"type":47,"value":487},{"type":41,"tag":351,"props":645,"children":647},{"id":646},"performance-harness-cli",[648],{"type":47,"value":649},"Performance harness CLI",{"type":41,"tag":358,"props":651,"children":655},{"className":652,"code":653,"language":654,"meta":363,"style":363},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","uv run python scripts\u002Fperformance\u002Frun_script.py \\\n  -m llama \\\n  -mr llama3_8b \\\n  --task pretrain \\\n  -g h100 \\\n  -c bf16 \\\n  -ng 8 \\\n  --recompute_modules core_attn,layernorm \\\n  ...\n","bash",[656],{"type":41,"tag":117,"props":657,"children":658},{"__ignoreMap":363},[659,690,707,724,742,760,778,797,815],{"type":41,"tag":369,"props":660,"children":661},{"class":371,"line":372},[662,668,674,679,684],{"type":41,"tag":369,"props":663,"children":665},{"style":664},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[666],{"type":47,"value":667},"uv",{"type":41,"tag":369,"props":669,"children":671},{"style":670},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[672],{"type":47,"value":673}," run",{"type":41,"tag":369,"props":675,"children":676},{"style":670},[677],{"type":47,"value":678}," python",{"type":41,"tag":369,"props":680,"children":681},{"style":670},[682],{"type":47,"value":683}," scripts\u002Fperformance\u002Frun_script.py",{"type":41,"tag":369,"props":685,"children":687},{"style":686},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[688],{"type":47,"value":689}," \\\n",{"type":41,"tag":369,"props":691,"children":692},{"class":371,"line":381},[693,698,703],{"type":41,"tag":369,"props":694,"children":695},{"style":670},[696],{"type":47,"value":697},"  -m",{"type":41,"tag":369,"props":699,"children":700},{"style":670},[701],{"type":47,"value":702}," llama",{"type":41,"tag":369,"props":704,"children":705},{"style":686},[706],{"type":47,"value":689},{"type":41,"tag":369,"props":708,"children":709},{"class":371,"line":419},[710,715,720],{"type":41,"tag":369,"props":711,"children":712},{"style":670},[713],{"type":47,"value":714},"  -mr",{"type":41,"tag":369,"props":716,"children":717},{"style":670},[718],{"type":47,"value":719}," llama3_8b",{"type":41,"tag":369,"props":721,"children":722},{"style":686},[723],{"type":47,"value":689},{"type":41,"tag":369,"props":725,"children":727},{"class":371,"line":726},4,[728,733,738],{"type":41,"tag":369,"props":729,"children":730},{"style":670},[731],{"type":47,"value":732},"  --task",{"type":41,"tag":369,"props":734,"children":735},{"style":670},[736],{"type":47,"value":737}," pretrain",{"type":41,"tag":369,"props":739,"children":740},{"style":686},[741],{"type":47,"value":689},{"type":41,"tag":369,"props":743,"children":745},{"class":371,"line":744},5,[746,751,756],{"type":41,"tag":369,"props":747,"children":748},{"style":670},[749],{"type":47,"value":750},"  -g",{"type":41,"tag":369,"props":752,"children":753},{"style":670},[754],{"type":47,"value":755}," h100",{"type":41,"tag":369,"props":757,"children":758},{"style":686},[759],{"type":47,"value":689},{"type":41,"tag":369,"props":761,"children":763},{"class":371,"line":762},6,[764,769,774],{"type":41,"tag":369,"props":765,"children":766},{"style":670},[767],{"type":47,"value":768},"  -c",{"type":41,"tag":369,"props":770,"children":771},{"style":670},[772],{"type":47,"value":773}," bf16",{"type":41,"tag":369,"props":775,"children":776},{"style":686},[777],{"type":47,"value":689},{"type":41,"tag":369,"props":779,"children":781},{"class":371,"line":780},7,[782,787,793],{"type":41,"tag":369,"props":783,"children":784},{"style":670},[785],{"type":47,"value":786},"  -ng",{"type":41,"tag":369,"props":788,"children":790},{"style":789},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[791],{"type":47,"value":792}," 8",{"type":41,"tag":369,"props":794,"children":795},{"style":686},[796],{"type":47,"value":689},{"type":41,"tag":369,"props":798,"children":800},{"class":371,"line":799},8,[801,806,811],{"type":41,"tag":369,"props":802,"children":803},{"style":670},[804],{"type":47,"value":805},"  --recompute_modules",{"type":41,"tag":369,"props":807,"children":808},{"style":670},[809],{"type":47,"value":810}," core_attn,layernorm",{"type":41,"tag":369,"props":812,"children":813},{"style":686},[814],{"type":47,"value":689},{"type":41,"tag":369,"props":816,"children":818},{"class":371,"line":817},9,[819],{"type":41,"tag":369,"props":820,"children":821},{"style":670},[822],{"type":47,"value":823},"  ...\n",{"type":41,"tag":56,"props":825,"children":827},{"id":826},"compatibility-and-constraints",[828],{"type":47,"value":829},"Compatibility and Constraints",{"type":41,"tag":831,"props":832,"children":833},"ul",{},[834,852,874,994,1011],{"type":41,"tag":232,"props":835,"children":836},{},[837,843,845,850],{"type":41,"tag":117,"props":838,"children":840},{"className":839},[],[841],{"type":47,"value":842},"recompute_granularity=selective",{"type":47,"value":844}," requires a non-empty ",{"type":41,"tag":117,"props":846,"children":848},{"className":847},[],[849],{"type":47,"value":131},{"type":47,"value":851}," list",{"type":41,"tag":232,"props":853,"children":854},{},[855,861,863,868,869],{"type":41,"tag":117,"props":856,"children":858},{"className":857},[],[859],{"type":47,"value":860},"recompute_granularity=full",{"type":47,"value":862}," requires ",{"type":41,"tag":117,"props":864,"children":866},{"className":865},[],[867],{"type":47,"value":193},{"type":47,"value":257},{"type":41,"tag":117,"props":870,"children":872},{"className":871},[],[873],{"type":47,"value":185},{"type":41,"tag":232,"props":875,"children":876},{},[877,896,898,904,905,910,911,917,919,925,927,933,934,940,942],{"type":41,"tag":338,"props":878,"children":879},{},[880,882,887,889,894],{"type":47,"value":881},"Layer-level recompute (",{"type":41,"tag":117,"props":883,"children":885},{"className":884},[],[886],{"type":47,"value":296},{"type":47,"value":888}," +\n",{"type":41,"tag":117,"props":890,"children":892},{"className":891},[],[893],{"type":47,"value":185},{"type":47,"value":895},") is incompatible with TE-scoped CUDA graphs.",{"type":47,"value":897},"\nMCore calls this \"full\" granularity — the name refers to recomputing\nfull transformer layers, not the full model. Even though you're selecting\nhow many layers to recompute, MCore treats it differently from submodule\nrecompute. Any TE-scoped scope (",{"type":41,"tag":117,"props":899,"children":901},{"className":900},[],[902],{"type":47,"value":903},"attn",{"type":47,"value":141},{"type":41,"tag":117,"props":906,"children":908},{"className":907},[],[909],{"type":47,"value":147},{"type":47,"value":141},{"type":41,"tag":117,"props":912,"children":914},{"className":913},[],[915],{"type":47,"value":916},"moe_router",{"type":47,"value":918},", etc.) will\nassert. This commonly hits FP8 configs that enable TE-scoped graphs by\ndefault (e.g. ",{"type":41,"tag":117,"props":920,"children":922},{"className":921},[],[923],{"type":47,"value":924},"LLAMA3_70B_SFT_CONFIG_H100_FP8_CS_V1",{"type":47,"value":926}," sets\n",{"type":41,"tag":117,"props":928,"children":930},{"className":929},[],[931],{"type":47,"value":932},"cuda_graph_impl=\"transformer_engine\"",{"type":47,"value":141},{"type":41,"tag":117,"props":935,"children":937},{"className":936},[],[938],{"type":47,"value":939},"cuda_graph_scope=\"mlp\"",{"type":47,"value":941},"). Options:\n",{"type":41,"tag":831,"props":943,"children":944},{},[945,963,976],{"type":41,"tag":232,"props":946,"children":947},{},[948,950,955,956,961],{"type":47,"value":949},"use submodule recompute (",{"type":41,"tag":117,"props":951,"children":953},{"className":952},[],[954],{"type":47,"value":255},{"type":47,"value":888},{"type":41,"tag":117,"props":957,"children":959},{"className":958},[],[960],{"type":47,"value":131},{"type":47,"value":962},") — compatible with TE-scoped graphs",{"type":41,"tag":232,"props":964,"children":965},{},[966,968,974],{"type":47,"value":967},"disable CUDA graphs (",{"type":41,"tag":117,"props":969,"children":971},{"className":970},[],[972],{"type":47,"value":973},"cuda_graph_impl=\"none\"",{"type":47,"value":975},") and use layer-level recompute",{"type":41,"tag":232,"props":977,"children":978},{},[979,981,987,988],{"type":47,"value":980},"switch to ",{"type":41,"tag":117,"props":982,"children":984},{"className":983},[],[985],{"type":47,"value":986},"cuda_graph_impl=\"local\"",{"type":47,"value":141},{"type":41,"tag":117,"props":989,"children":991},{"className":990},[],[992],{"type":47,"value":993},"cuda_graph_scope=\"full_iteration\"",{"type":41,"tag":232,"props":995,"children":996},{},[997,1003,1005],{"type":41,"tag":117,"props":998,"children":1000},{"className":999},[],[1001],{"type":47,"value":1002},"distribute_saved_activations=True",{"type":47,"value":1004}," cannot be combined with ",{"type":41,"tag":117,"props":1006,"children":1008},{"className":1007},[],[1009],{"type":47,"value":1010},"sequence_parallel=True",{"type":41,"tag":232,"props":1012,"children":1013},{},[1014,1016,1021,1022,1027,1029,1034],{"type":47,"value":1015},"Combining ",{"type":41,"tag":117,"props":1017,"children":1019},{"className":1018},[],[1020],{"type":47,"value":147},{"type":47,"value":187},{"type":41,"tag":117,"props":1023,"children":1025},{"className":1024},[],[1026],{"type":47,"value":139},{"type":47,"value":1028}," recompute is slightly worse than ",{"type":41,"tag":117,"props":1030,"children":1032},{"className":1031},[],[1033],{"type":47,"value":147},{"type":47,"value":1035}," alone\ndue to double recompute overhead",{"type":41,"tag":56,"props":1037,"children":1039},{"id":1038},"measured-results",[1040],{"type":47,"value":1041},"Measured Results",{"type":41,"tag":50,"props":1043,"children":1044},{},[1045],{"type":47,"value":1046},"Llama3 70B SFT on 32x H100 80GB, FP8 (Current Scaling):",{"type":41,"tag":831,"props":1048,"children":1049},{},[1050,1055,1060],{"type":41,"tag":232,"props":1051,"children":1052},{},[1053],{"type":47,"value":1054},"Baseline: TP=4, PP=4, VPP=5, DP=2, MBS=1, GBS=32, seq_len=4096",{"type":41,"tag":232,"props":1056,"children":1057},{},[1058],{"type":47,"value":1059},"Golden GPU utilization: 709.93 TFLOP\u002Fs\u002FGPU",{"type":41,"tag":232,"props":1061,"children":1062},{},[1063],{"type":47,"value":1064},"Regression threshold: 5%",{"type":41,"tag":68,"props":1066,"children":1067},{},[1068,1103],{"type":41,"tag":72,"props":1069,"children":1070},{},[1071],{"type":41,"tag":76,"props":1072,"children":1073},{},[1074,1079,1083,1088,1093,1098],{"type":41,"tag":80,"props":1075,"children":1076},{},[1077],{"type":47,"value":1078},"Experiment",{"type":41,"tag":80,"props":1080,"children":1081},{},[1082],{"type":47,"value":131},{"type":41,"tag":80,"props":1084,"children":1085},{},[1086],{"type":47,"value":1087},"TFLOP\u002Fs\u002FGPU",{"type":41,"tag":80,"props":1089,"children":1090},{},[1091],{"type":47,"value":1092},"vs Golden",{"type":41,"tag":80,"props":1094,"children":1095},{},[1096],{"type":47,"value":1097},"Peak Mem (GB)",{"type":41,"tag":80,"props":1099,"children":1100},{},[1101],{"type":47,"value":1102},"Result",{"type":41,"tag":106,"props":1104,"children":1105},{},[1106,1141,1176,1210],{"type":41,"tag":76,"props":1107,"children":1108},{},[1109,1114,1121,1126,1131,1136],{"type":41,"tag":113,"props":1110,"children":1111},{},[1112],{"type":47,"value":1113},"Baseline",{"type":41,"tag":113,"props":1115,"children":1116},{},[1117],{"type":41,"tag":369,"props":1118,"children":1119},{},[1120],{"type":47,"value":139},{"type":41,"tag":113,"props":1122,"children":1123},{},[1124],{"type":47,"value":1125},"~704",{"type":41,"tag":113,"props":1127,"children":1128},{},[1129],{"type":47,"value":1130},"-0.8%",{"type":41,"tag":113,"props":1132,"children":1133},{},[1134],{"type":47,"value":1135},"58.8 (OOM rank0)",{"type":41,"tag":113,"props":1137,"children":1138},{},[1139],{"type":47,"value":1140},"OOM",{"type":41,"tag":76,"props":1142,"children":1143},{},[1144,1149,1156,1161,1166,1171],{"type":41,"tag":113,"props":1145,"children":1146},{},[1147],{"type":47,"value":1148},"Exp 1",{"type":41,"tag":113,"props":1150,"children":1151},{},[1152],{"type":41,"tag":369,"props":1153,"children":1154},{},[1155],{"type":47,"value":147},{"type":41,"tag":113,"props":1157,"children":1158},{},[1159],{"type":47,"value":1160},"593.6",{"type":41,"tag":113,"props":1162,"children":1163},{},[1164],{"type":47,"value":1165},"-16.4%",{"type":41,"tag":113,"props":1167,"children":1168},{},[1169],{"type":47,"value":1170},"55.6",{"type":41,"tag":113,"props":1172,"children":1173},{},[1174],{"type":47,"value":1175},"Perf regression",{"type":41,"tag":76,"props":1177,"children":1178},{},[1179,1184,1192,1197,1202,1206],{"type":41,"tag":113,"props":1180,"children":1181},{},[1182],{"type":47,"value":1183},"Exp 2",{"type":41,"tag":113,"props":1185,"children":1186},{},[1187],{"type":41,"tag":369,"props":1188,"children":1189},{},[1190],{"type":47,"value":1191},"mlp, core_attn",{"type":41,"tag":113,"props":1193,"children":1194},{},[1195],{"type":47,"value":1196},"586.8",{"type":41,"tag":113,"props":1198,"children":1199},{},[1200],{"type":47,"value":1201},"-17.3%",{"type":41,"tag":113,"props":1203,"children":1204},{},[1205],{"type":47,"value":1170},{"type":41,"tag":113,"props":1207,"children":1208},{},[1209],{"type":47,"value":1175},{"type":41,"tag":76,"props":1211,"children":1212},{},[1213,1218,1226,1231,1236,1241],{"type":41,"tag":113,"props":1214,"children":1215},{},[1216],{"type":47,"value":1217},"Exp 3",{"type":41,"tag":113,"props":1219,"children":1220},{},[1221],{"type":41,"tag":369,"props":1222,"children":1223},{},[1224],{"type":47,"value":1225},"core_attn, layernorm",{"type":41,"tag":113,"props":1227,"children":1228},{},[1229],{"type":47,"value":1230},"~702",{"type":41,"tag":113,"props":1232,"children":1233},{},[1234],{"type":47,"value":1235},"-1.1%",{"type":41,"tag":113,"props":1237,"children":1238},{},[1239],{"type":47,"value":1240},"59.6 (OOM rank0)",{"type":41,"tag":113,"props":1242,"children":1243},{},[1244],{"type":47,"value":1140},{"type":41,"tag":50,"props":1246,"children":1247},{},[1248],{"type":47,"value":1249},"Key takeaways:",{"type":41,"tag":831,"props":1251,"children":1252},{},[1253,1263,1273,1297],{"type":41,"tag":232,"props":1254,"children":1255},{},[1256,1261],{"type":41,"tag":117,"props":1257,"children":1259},{"className":1258},[],[1260],{"type":47,"value":499},{"type":47,"value":1262}," recompute is nearly free compute-wise but saves negligible memory",{"type":41,"tag":232,"props":1264,"children":1265},{},[1266,1271],{"type":41,"tag":117,"props":1267,"children":1269},{"className":1268},[],[1270],{"type":47,"value":147},{"type":47,"value":1272}," recompute saves ~3 GB peak but costs ~16% because the Llama3 70B FFN\n(hidden=28672) is expensive to recompute",{"type":41,"tag":232,"props":1274,"children":1275},{},[1276,1277,1282,1283,1288,1290,1295],{"type":47,"value":1015},{"type":41,"tag":117,"props":1278,"children":1280},{"className":1279},[],[1281],{"type":47,"value":147},{"type":47,"value":187},{"type":41,"tag":117,"props":1284,"children":1286},{"className":1285},[],[1287],{"type":47,"value":139},{"type":47,"value":1289}," is slightly worse than ",{"type":41,"tag":117,"props":1291,"children":1293},{"className":1292},[],[1294],{"type":47,"value":147},{"type":47,"value":1296}," alone",{"type":41,"tag":232,"props":1298,"children":1299},{},[1300,1302,1307],{"type":47,"value":1301},"For this workload, the actual OOM fix was ",{"type":41,"tag":117,"props":1303,"children":1305},{"className":1304},[],[1306],{"type":47,"value":242},{"type":47,"value":1308},"\n(memory fragmentation, not capacity). See @skills\u002Fnemo-mbridge-perf-memory-tuning\u002FSKILL.md.",{"type":41,"tag":56,"props":1310,"children":1312},{"id":1311},"code-anchors",[1313],{"type":47,"value":1314},"Code Anchors",{"type":41,"tag":351,"props":1316,"children":1318},{"id":1317},"recompute-modules-enum-and-selective-checkpoint-logic",[1319],{"type":47,"value":1320},"Recompute modules enum and selective checkpoint logic",{"type":41,"tag":358,"props":1322,"children":1324},{"className":360,"code":1323,"language":362,"meta":363,"style":363},"# 3rdparty\u002FMegatron-LM\u002Fmegatron\u002Fcore\u002Ftransformer\u002Ftransformer_block.py\n# _checkpointed_forward() applies selective recompute based on recompute_modules\n",[1325],{"type":41,"tag":117,"props":1326,"children":1327},{"__ignoreMap":363},[1328,1336],{"type":41,"tag":369,"props":1329,"children":1330},{"class":371,"line":372},[1331],{"type":41,"tag":369,"props":1332,"children":1333},{},[1334],{"type":47,"value":1335},"# 3rdparty\u002FMegatron-LM\u002Fmegatron\u002Fcore\u002Ftransformer\u002Ftransformer_block.py\n",{"type":41,"tag":369,"props":1337,"children":1338},{"class":371,"line":381},[1339],{"type":41,"tag":369,"props":1340,"children":1341},{},[1342],{"type":47,"value":1343},"# _checkpointed_forward() applies selective recompute based on recompute_modules\n",{"type":41,"tag":351,"props":1345,"children":1347},{"id":1346},"recompute-config-validation",[1348],{"type":47,"value":1349},"Recompute config validation",{"type":41,"tag":358,"props":1351,"children":1353},{"className":360,"code":1352,"language":362,"meta":363,"style":363},"# 3rdparty\u002FMegatron-LM\u002Fmegatron\u002Fcore\u002Ftransformer\u002Ftransformer_config.py\n# Validates recompute_granularity, recompute_method, recompute_num_layers\n",[1354],{"type":41,"tag":117,"props":1355,"children":1356},{"__ignoreMap":363},[1357,1365],{"type":41,"tag":369,"props":1358,"children":1359},{"class":371,"line":372},[1360],{"type":41,"tag":369,"props":1361,"children":1362},{},[1363],{"type":47,"value":1364},"# 3rdparty\u002FMegatron-LM\u002Fmegatron\u002Fcore\u002Ftransformer\u002Ftransformer_config.py\n",{"type":41,"tag":369,"props":1366,"children":1367},{"class":371,"line":381},[1368],{"type":41,"tag":369,"props":1369,"children":1370},{},[1371],{"type":47,"value":1372},"# Validates recompute_granularity, recompute_method, recompute_num_layers\n",{"type":41,"tag":351,"props":1374,"children":1376},{"id":1375},"llama3-recipe-defaults",[1377],{"type":47,"value":1378},"Llama3 recipe defaults",{"type":41,"tag":358,"props":1380,"children":1384},{"className":1381,"code":1382,"language":1383,"meta":363,"style":363},"language-99:103:src\u002Fmegatron\u002Fbridge\u002Frecipes\u002Fllama\u002Fllama3.py shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","    # Memory saving (recompute & offloading)\n    cfg.model.recompute_granularity = None\n    cfg.model.recompute_modules = None\n    cfg.model.fine_grained_activation_offloading = False\n    cfg.model.offload_modules = None\n","99:103:src\u002Fmegatron\u002Fbridge\u002Frecipes\u002Fllama\u002Fllama3.py",[1385],{"type":41,"tag":117,"props":1386,"children":1387},{"__ignoreMap":363},[1388,1396,1404,1412,1420],{"type":41,"tag":369,"props":1389,"children":1390},{"class":371,"line":372},[1391],{"type":41,"tag":369,"props":1392,"children":1393},{},[1394],{"type":47,"value":1395},"    # Memory saving (recompute & offloading)\n",{"type":41,"tag":369,"props":1397,"children":1398},{"class":371,"line":381},[1399],{"type":41,"tag":369,"props":1400,"children":1401},{},[1402],{"type":47,"value":1403},"    cfg.model.recompute_granularity = None\n",{"type":41,"tag":369,"props":1405,"children":1406},{"class":371,"line":419},[1407],{"type":41,"tag":369,"props":1408,"children":1409},{},[1410],{"type":47,"value":1411},"    cfg.model.recompute_modules = None\n",{"type":41,"tag":369,"props":1413,"children":1414},{"class":371,"line":726},[1415],{"type":41,"tag":369,"props":1416,"children":1417},{},[1418],{"type":47,"value":1419},"    cfg.model.fine_grained_activation_offloading = False\n",{"type":41,"tag":369,"props":1421,"children":1422},{"class":371,"line":744},[1423],{"type":41,"tag":369,"props":1424,"children":1425},{},[1426],{"type":47,"value":1427},"    cfg.model.offload_modules = None\n",{"type":41,"tag":351,"props":1429,"children":1431},{"id":1430},"full-recompute-cuda-graph-assertion-mcore",[1432],{"type":47,"value":1433},"Full recompute + CUDA graph assertion (MCore)",{"type":41,"tag":358,"props":1435,"children":1439},{"className":1436,"code":1437,"language":1438,"meta":363,"style":363},"language-2001:2005:3rdparty\u002FMegatron-LM\u002Fmegatron\u002Fcore\u002Ftransformer\u002Ftransformer_config.py shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","            if self.recompute_granularity:\n                if self.recompute_granularity != \"selective\":\n                    assert self.cuda_graph_scope == [\n                        CudaGraphScope.full_iteration\n                    ], \"full recompute is only supported with full iteration CUDA graph.\"\n","2001:2005:3rdparty\u002FMegatron-LM\u002Fmegatron\u002Fcore\u002Ftransformer\u002Ftransformer_config.py",[1440],{"type":41,"tag":117,"props":1441,"children":1442},{"__ignoreMap":363},[1443,1451,1459,1467,1475],{"type":41,"tag":369,"props":1444,"children":1445},{"class":371,"line":372},[1446],{"type":41,"tag":369,"props":1447,"children":1448},{},[1449],{"type":47,"value":1450},"            if self.recompute_granularity:\n",{"type":41,"tag":369,"props":1452,"children":1453},{"class":371,"line":381},[1454],{"type":41,"tag":369,"props":1455,"children":1456},{},[1457],{"type":47,"value":1458},"                if self.recompute_granularity != \"selective\":\n",{"type":41,"tag":369,"props":1460,"children":1461},{"class":371,"line":419},[1462],{"type":41,"tag":369,"props":1463,"children":1464},{},[1465],{"type":47,"value":1466},"                    assert self.cuda_graph_scope == [\n",{"type":41,"tag":369,"props":1468,"children":1469},{"class":371,"line":726},[1470],{"type":41,"tag":369,"props":1471,"children":1472},{},[1473],{"type":47,"value":1474},"                        CudaGraphScope.full_iteration\n",{"type":41,"tag":369,"props":1476,"children":1477},{"class":371,"line":744},[1478],{"type":41,"tag":369,"props":1479,"children":1480},{},[1481],{"type":47,"value":1482},"                    ], \"full recompute is only supported with full iteration CUDA graph.\"\n",{"type":41,"tag":351,"props":1484,"children":1486},{"id":1485},"cpu-offloading-pp-incompatibility-mcore",[1487],{"type":47,"value":1488},"CPU offloading PP incompatibility (MCore)",{"type":41,"tag":358,"props":1490,"children":1494},{"className":1491,"code":1492,"language":1493,"meta":363,"style":363},"language-1303:1306:3rdparty\u002FMegatron-LM\u002Fmegatron\u002Fcore\u002Ftransformer\u002Ftransformer_config.py shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","        if self.cpu_offloading and self.pipeline_model_parallel_size > 1:\n            raise ValueError(\n                \"Currently there is no support for Pipeline parallelism with CPU offloading\"\n            )\n","1303:1306:3rdparty\u002FMegatron-LM\u002Fmegatron\u002Fcore\u002Ftransformer\u002Ftransformer_config.py",[1495],{"type":41,"tag":117,"props":1496,"children":1497},{"__ignoreMap":363},[1498,1506,1514,1522],{"type":41,"tag":369,"props":1499,"children":1500},{"class":371,"line":372},[1501],{"type":41,"tag":369,"props":1502,"children":1503},{},[1504],{"type":47,"value":1505},"        if self.cpu_offloading and self.pipeline_model_parallel_size > 1:\n",{"type":41,"tag":369,"props":1507,"children":1508},{"class":371,"line":381},[1509],{"type":41,"tag":369,"props":1510,"children":1511},{},[1512],{"type":47,"value":1513},"            raise ValueError(\n",{"type":41,"tag":369,"props":1515,"children":1516},{"class":371,"line":419},[1517],{"type":41,"tag":369,"props":1518,"children":1519},{},[1520],{"type":47,"value":1521},"                \"Currently there is no support for Pipeline parallelism with CPU offloading\"\n",{"type":41,"tag":369,"props":1523,"children":1524},{"class":371,"line":726},[1525],{"type":41,"tag":369,"props":1526,"children":1527},{},[1528],{"type":47,"value":1529},"            )\n",{"type":41,"tag":56,"props":1531,"children":1533},{"id":1532},"failure-diagnosis",[1534],{"type":47,"value":1535},"Failure Diagnosis",{"type":41,"tag":68,"props":1537,"children":1538},{},[1539,1565],{"type":41,"tag":72,"props":1540,"children":1541},{},[1542],{"type":41,"tag":76,"props":1543,"children":1544},{},[1545,1550,1555,1560],{"type":41,"tag":80,"props":1546,"children":1547},{},[1548],{"type":47,"value":1549},"Symptom",{"type":41,"tag":80,"props":1551,"children":1552},{},[1553],{"type":47,"value":1554},"Cause",{"type":41,"tag":80,"props":1556,"children":1557},{},[1558],{"type":47,"value":1559},"Confirm",{"type":41,"tag":80,"props":1561,"children":1562},{},[1563],{"type":47,"value":1564},"Fix",{"type":41,"tag":106,"props":1566,"children":1567},{},[1568,1615,1638,1705,1739],{"type":41,"tag":76,"props":1569,"children":1570},{},[1571,1576,1586,1603],{"type":41,"tag":113,"props":1572,"children":1573},{},[1574],{"type":47,"value":1575},">15% GPU utilization drop",{"type":41,"tag":113,"props":1577,"children":1578},{},[1579,1584],{"type":41,"tag":117,"props":1580,"children":1582},{"className":1581},[],[1583],{"type":47,"value":147},{"type":47,"value":1585}," recompute on a large FFN",{"type":41,"tag":113,"props":1587,"children":1588},{},[1589,1591,1596,1598],{"type":47,"value":1590},"check whether ",{"type":41,"tag":117,"props":1592,"children":1594},{"className":1593},[],[1595],{"type":47,"value":131},{"type":47,"value":1597}," includes ",{"type":41,"tag":117,"props":1599,"children":1601},{"className":1600},[],[1602],{"type":47,"value":147},{"type":41,"tag":113,"props":1604,"children":1605},{},[1606,1608,1613],{"type":47,"value":1607},"remove ",{"type":41,"tag":117,"props":1609,"children":1611},{"className":1610},[],[1612],{"type":47,"value":147},{"type":47,"value":1614},", lower micro batch size, or use CPU offload if PP=1",{"type":41,"tag":76,"props":1616,"children":1617},{},[1618,1623,1628,1633],{"type":41,"tag":113,"props":1619,"children":1620},{},[1621],{"type":47,"value":1622},"Still OOM after adding layernorm",{"type":41,"tag":113,"props":1624,"children":1625},{},[1626],{"type":47,"value":1627},"layernorm activations are too small to move the peak materially",{"type":41,"tag":113,"props":1629,"children":1630},{},[1631],{"type":47,"value":1632},"compare peak memory before\u002Fafter",{"type":41,"tag":113,"props":1634,"children":1635},{},[1636],{"type":47,"value":1637},"switch to a higher-impact module or full-layer recompute",{"type":41,"tag":76,"props":1639,"children":1640},{},[1641,1650,1655,1673],{"type":41,"tag":113,"props":1642,"children":1643},{},[1644],{"type":41,"tag":117,"props":1645,"children":1647},{"className":1646},[],[1648],{"type":47,"value":1649},"AssertionError: full recompute is only supported with full iteration CUDA graph",{"type":41,"tag":113,"props":1651,"children":1652},{},[1653],{"type":47,"value":1654},"layer-level recompute with TE-scoped graph capture",{"type":41,"tag":113,"props":1656,"children":1657},{},[1658,1660,1666,1667],{"type":47,"value":1659},"check ",{"type":41,"tag":117,"props":1661,"children":1663},{"className":1662},[],[1664],{"type":47,"value":1665},"cuda_graph_impl",{"type":47,"value":257},{"type":41,"tag":117,"props":1668,"children":1670},{"className":1669},[],[1671],{"type":47,"value":1672},"cuda_graph_scope",{"type":41,"tag":113,"props":1674,"children":1675},{},[1676,1678,1683,1685,1691,1693,1699,1700],{"type":47,"value":1677},"use ",{"type":41,"tag":117,"props":1679,"children":1681},{"className":1680},[],[1682],{"type":47,"value":122},{"type":47,"value":1684},", set ",{"type":41,"tag":117,"props":1686,"children":1688},{"className":1687},[],[1689],{"type":47,"value":1690},"cuda_graph_impl=none",{"type":47,"value":1692},", or use ",{"type":41,"tag":117,"props":1694,"children":1696},{"className":1695},[],[1697],{"type":47,"value":1698},"local",{"type":47,"value":187},{"type":41,"tag":117,"props":1701,"children":1703},{"className":1702},[],[1704],{"type":47,"value":321},{"type":41,"tag":76,"props":1706,"children":1707},{},[1708,1713,1729,1734],{"type":41,"tag":113,"props":1709,"children":1710},{},[1711],{"type":47,"value":1712},"ValueError: PP + CPU offloading",{"type":41,"tag":113,"props":1714,"children":1715},{},[1716,1721,1723],{"type":41,"tag":117,"props":1717,"children":1719},{"className":1718},[],[1720],{"type":47,"value":334},{"type":47,"value":1722}," with ",{"type":41,"tag":117,"props":1724,"children":1726},{"className":1725},[],[1727],{"type":47,"value":1728},"pipeline_model_parallel_size > 1",{"type":41,"tag":113,"props":1730,"children":1731},{},[1732],{"type":47,"value":1733},"check PP config",{"type":41,"tag":113,"props":1735,"children":1736},{},[1737],{"type":47,"value":1738},"disable CPU offloading or set PP=1",{"type":41,"tag":76,"props":1740,"children":1741},{},[1742,1747,1752,1757],{"type":41,"tag":113,"props":1743,"children":1744},{},[1745],{"type":47,"value":1746},"mlp+core_attn worse than mlp alone",{"type":41,"tag":113,"props":1748,"children":1749},{},[1750],{"type":47,"value":1751},"double recompute overhead",{"type":41,"tag":113,"props":1753,"children":1754},{},[1755],{"type":47,"value":1756},"compare Exp 1 vs Exp 2",{"type":41,"tag":113,"props":1758,"children":1759},{},[1760],{"type":47,"value":1761},"use mlp alone",{"type":41,"tag":56,"props":1763,"children":1765},{"id":1764},"known-limitations",[1766],{"type":47,"value":1767},"Known Limitations",{"type":41,"tag":831,"props":1769,"children":1770},{},[1771,1776,1781,1791],{"type":41,"tag":232,"props":1772,"children":1773},{},[1774],{"type":47,"value":1775},"Per-module memory savings vary significantly by model architecture and hidden\ndimension",{"type":41,"tag":232,"props":1777,"children":1778},{},[1779],{"type":47,"value":1780},"No automatic module selection — users must choose which modules to recompute",{"type":41,"tag":232,"props":1782,"children":1783},{},[1784,1789],{"type":41,"tag":117,"props":1785,"children":1787},{"className":1786},[],[1788],{"type":47,"value":499},{"type":47,"value":1790}," recompute is almost never worth it as a standalone fix",{"type":41,"tag":232,"props":1792,"children":1793},{},[1794],{"type":47,"value":1795},"CPU offloading (the zero-compute-cost alternative) is blocked when PP > 1",{"type":41,"tag":56,"props":1797,"children":1799},{"id":1798},"verification",[1800],{"type":47,"value":1801},"Verification",{"type":41,"tag":358,"props":1803,"children":1805},{"className":652,"code":1804,"language":654,"meta":363,"style":363},"uv run python -m pytest \\\n  tests\u002Funit_tests\u002Ftraining\u002Ftest_config.py -k \"recompute\" -q\n",[1806],{"type":41,"tag":117,"props":1807,"children":1808},{"__ignoreMap":363},[1809,1838],{"type":41,"tag":369,"props":1810,"children":1811},{"class":371,"line":372},[1812,1816,1820,1824,1829,1834],{"type":41,"tag":369,"props":1813,"children":1814},{"style":664},[1815],{"type":47,"value":667},{"type":41,"tag":369,"props":1817,"children":1818},{"style":670},[1819],{"type":47,"value":673},{"type":41,"tag":369,"props":1821,"children":1822},{"style":670},[1823],{"type":47,"value":678},{"type":41,"tag":369,"props":1825,"children":1826},{"style":670},[1827],{"type":47,"value":1828}," -m",{"type":41,"tag":369,"props":1830,"children":1831},{"style":670},[1832],{"type":47,"value":1833}," pytest",{"type":41,"tag":369,"props":1835,"children":1836},{"style":686},[1837],{"type":47,"value":689},{"type":41,"tag":369,"props":1839,"children":1840},{"class":371,"line":381},[1841,1846,1851,1857,1862,1867],{"type":41,"tag":369,"props":1842,"children":1843},{"style":670},[1844],{"type":47,"value":1845},"  tests\u002Funit_tests\u002Ftraining\u002Ftest_config.py",{"type":41,"tag":369,"props":1847,"children":1848},{"style":670},[1849],{"type":47,"value":1850}," -k",{"type":41,"tag":369,"props":1852,"children":1854},{"style":1853},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[1855],{"type":47,"value":1856}," \"",{"type":41,"tag":369,"props":1858,"children":1859},{"style":670},[1860],{"type":47,"value":1861},"recompute",{"type":41,"tag":369,"props":1863,"children":1864},{"style":1853},[1865],{"type":47,"value":1866},"\"",{"type":41,"tag":369,"props":1868,"children":1869},{"style":670},[1870],{"type":47,"value":1871}," -q\n",{"type":41,"tag":50,"props":1873,"children":1874},{},[1875],{"type":47,"value":1876},"Success criteria:",{"type":41,"tag":831,"props":1878,"children":1879},{},[1880,1885],{"type":41,"tag":232,"props":1881,"children":1882},{},[1883],{"type":47,"value":1884},"Unit tests pass for recompute config validation",{"type":41,"tag":232,"props":1886,"children":1887},{},[1888],{"type":47,"value":1889},"No assertion errors from config validation",{"type":41,"tag":1891,"props":1892,"children":1893},"style",{},[1894],{"type":47,"value":1895},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":1897,"total":1999},[1898,1913,1927,1941,1953,1970,1985],{"slug":1899,"name":1899,"fn":1900,"description":1901,"org":1902,"tags":1903,"stars":23,"repoUrl":24,"updatedAt":1912},"accelerated-computing-cudf","accelerate data processing with cuDF","Official NVIDIA-authored guidance for NVIDIA cuDF GPU DataFrames, pandas acceleration, dask-cuDF, ETL, joins, groupby, CSV\u002FParquet I\u002FO, nullable semantics, and multi-GPU DataFrame workloads.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1904,1907,1910,1911],{"name":1905,"slug":1906,"type":15},"Data Analysis","data-analysis",{"name":1908,"slug":1909,"type":15},"Data Engineering","data-engineering",{"name":9,"slug":8,"type":15},{"name":13,"slug":14,"type":15},"2026-07-14T05:28:43.176466",{"slug":1914,"name":1914,"fn":1915,"description":1916,"org":1917,"tags":1918,"stars":23,"repoUrl":24,"updatedAt":1926},"aiq-deploy","deploy and manage NVIDIA AI-Q infrastructure","Use when asked to install, deploy, run, validate, troubleshoot, or stop NVIDIA AI-Q Blueprint infrastructure.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1919,1922,1925],{"name":1920,"slug":1921,"type":15},"Deployment","deployment",{"name":1923,"slug":1924,"type":15},"Infrastructure","infrastructure",{"name":9,"slug":8,"type":15},"2026-07-14T05:29:06.667109",{"slug":1928,"name":1928,"fn":1929,"description":1930,"org":1931,"tags":1932,"stars":23,"repoUrl":24,"updatedAt":1940},"aiq-research","conduct deep research with AI-Q","Use when asked to run deep research or AI-Q research through a reachable NVIDIA AI-Q Blueprint backend.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1933,1936,1937],{"name":1934,"slug":1935,"type":15},"Agents","agents",{"name":9,"slug":8,"type":15},{"name":1938,"slug":1939,"type":15},"Research","research","2026-07-14T05:28:06.816956",{"slug":1942,"name":1942,"fn":1943,"description":1944,"org":1945,"tags":1946,"stars":23,"repoUrl":24,"updatedAt":1952},"amc-run-sample-calibration","run AMC sample dataset calibration","Run end-to-end calibration on the shipped sample dataset (sdg_08_2_sample_data_010926.zip) against a running AMC microservice. Use when user says 'test sample dataset', 'run sample calibration', 'verify AMC install', or 'launch and test'.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1947,1948,1949],{"name":1905,"slug":1906,"type":15},{"name":9,"slug":8,"type":15},{"name":1950,"slug":1951,"type":15},"Testing","testing","2026-07-17T05:29:03.913266",{"slug":1954,"name":1954,"fn":1955,"description":1956,"org":1957,"tags":1958,"stars":23,"repoUrl":24,"updatedAt":1969},"amc-run-video-calibration","calibrate video datasets with AutoMagicCalib","Calibrate a new dataset from pre-recorded video files via the AutoMagicCalib REST API. Use when user has local MP4s and says 'calibrate my videos', 'run AMC on these videos', or similar. For RTSP\u002Flive streams, use amc-run-rtsp-calibration instead.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1959,1962,1965,1966],{"name":1960,"slug":1961,"type":15},"Automation","automation",{"name":1963,"slug":1964,"type":15},"Imaging","imaging",{"name":9,"slug":8,"type":15},{"name":1967,"slug":1968,"type":15},"Video","video","2026-07-17T05:28:53.905004",{"slug":1971,"name":1971,"fn":1972,"description":1973,"org":1974,"tags":1975,"stars":23,"repoUrl":24,"updatedAt":1984},"amc-setup-calibration-stack","deploy AutoMagicCalib microservice with Docker","Launch AutoMagicCalib microservice and web UI from NGC release images via Docker Compose. Use when user says 'deploy auto calibration', 'launch auto calibration', 'launch AMC', 'start MS+UI', or 'set up auto-magic-calib'. Requires NGC API key.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1976,1977,1980,1981],{"name":1920,"slug":1921,"type":15},{"name":1978,"slug":1979,"type":15},"Docker","docker",{"name":9,"slug":8,"type":15},{"name":1982,"slug":1983,"type":15},"Operations","operations","2026-07-17T05:28:56.913999",{"slug":1986,"name":1986,"fn":1987,"description":1988,"org":1989,"tags":1990,"stars":23,"repoUrl":24,"updatedAt":1998},"cudaq-guide","develop quantum applications with CUDA-Q","CUDA-Q onboarding guide for installation, test programs, GPU simulation, QPU hardware, and quantum applications.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1991,1992,1995],{"name":9,"slug":8,"type":15},{"name":1993,"slug":1994,"type":15},"Quantum Computing","quantum-computing",{"name":1996,"slug":1997,"type":15},"Simulation","simulation","2026-07-14T05:26:58.898253",305,{"items":2001,"total":2151},[2002,2020,2035,2046,2058,2072,2085,2099,2110,2119,2133,2142],{"slug":2003,"name":2003,"fn":2004,"description":2005,"org":2006,"tags":2007,"stars":2017,"repoUrl":2018,"updatedAt":2019},"nemoclaw-user-guide","retrieve NemoClaw documentation and configuration","Guides human users' AI agents to the NemoClaw docs MCP server and canonical Fern documentation in Markdown form. Use when users ask how to install, configure, operate, troubleshoot, secure, or learn NemoClaw with an AI coding assistant. Trigger keywords - nemoclaw docs, use nemoclaw with ai agent, nemoclaw mcp docs, nemoclaw install help, nemoclaw quickstart, nemoclaw markdown docs, llms.txt, agent skills.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2008,2011,2014],{"name":2009,"slug":2010,"type":15},"Documentation","documentation",{"name":2012,"slug":2013,"type":15},"MCP","mcp",{"name":2015,"slug":2016,"type":15},"Search","search",21777,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FNemoClaw","2026-07-20T06:00:01.461044",{"slug":2021,"name":2021,"fn":2022,"description":2023,"org":2024,"tags":2025,"stars":2032,"repoUrl":2033,"updatedAt":2034},"mcore-build-and-dependency","manage Megatron-LM development environments","Container-based dev environment setup and dependency management for Megatron-LM. Covers acquiring and launching the CI container, uv package management, and updating uv.lock.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2026,2029,2030],{"name":2027,"slug":2028,"type":15},"Containers","containers",{"name":1920,"slug":1921,"type":15},{"name":2031,"slug":362,"type":15},"Python",17049,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FMegatron-LM","2026-07-27T06:06:11.249662",{"slug":2036,"name":2036,"fn":2037,"description":2038,"org":2039,"tags":2040,"stars":2032,"repoUrl":2033,"updatedAt":2045},"mcore-bump-base-image","update NVIDIA PyTorch base images","Bump the NVIDIA PyTorch base image (`nvcr.io\u002Fnvidia\u002Fpytorch:YY.MM-py3`) used by Megatron-LM CI. Covers the two pin sites (GitHub CI in `docker\u002F.ngc_version.dev` and GitLab CI in `.gitlab\u002Fstages\u002F01.build.yml`), the post-bump CI loop (re-run functional tests, refresh golden values, mark broken tests), and the gotchas that bit PRs",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2041,2044],{"name":2042,"slug":2043,"type":15},"CI\u002FCD","ci-cd",{"name":1920,"slug":1921,"type":15},"2026-07-14T05:25:59.97109",{"slug":2047,"name":2047,"fn":2048,"description":2049,"org":2050,"tags":2051,"stars":2032,"repoUrl":2033,"updatedAt":2057},"mcore-cicd","manage CI\u002FCD pipelines for Megatron-LM","CI\u002FCD reference for Megatron-LM. Covers CI pipeline structure, PR scope labels, triggering internal GitLab CI (which force-pushes the current branch to a pull-request\u002FBRANCH ref — always dry-run and verify the destination first; never run against shared or protected branches), and CI failure investigation.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2052,2053,2054],{"name":2042,"slug":2043,"type":15},{"name":1920,"slug":1921,"type":15},{"name":2055,"slug":2056,"type":15},"GitHub","github","2026-07-27T06:06:12.278222",{"slug":2059,"name":2059,"fn":2060,"description":2061,"org":2062,"tags":2063,"stars":2032,"repoUrl":2033,"updatedAt":2071},"mcore-create-issue","investigate CI failures and create issues","Investigate a failing GitHub Actions run or job and create a GitHub issue for the failure.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2064,2067,2068],{"name":2065,"slug":2066,"type":15},"Debugging","debugging",{"name":2055,"slug":2056,"type":15},{"name":2069,"slug":2070,"type":15},"Triage","triage","2026-07-14T05:25:57.442089",{"slug":2073,"name":2073,"fn":2074,"description":2075,"org":2076,"tags":2077,"stars":2032,"repoUrl":2033,"updatedAt":2084},"mcore-linting-and-formatting","lint and format Megatron-LM code","Linting and formatting for Megatron-LM. Covers running autoformat.sh, tools (ruff, black, isort, pylint, mypy), and code style rules.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2078,2081],{"name":2079,"slug":2080,"type":15},"Best Practices","best-practices",{"name":2082,"slug":2083,"type":15},"Code Analysis","code-analysis","2026-07-14T05:25:56.18433",{"slug":2086,"name":2086,"fn":2087,"description":2088,"org":2089,"tags":2090,"stars":2032,"repoUrl":2033,"updatedAt":2098},"mcore-migrate-gpt-to-hybrid","migrate Megatron-LM models to HybridModel","Migration guide for moving Megatron Core GPTModel checkpoints, model providers, training commands, and layer mappings to HybridModel.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2091,2094,2097],{"name":2092,"slug":2093,"type":15},"Machine Learning","machine-learning",{"name":2095,"slug":2096,"type":15},"Migration","migration",{"name":9,"slug":8,"type":15},"2026-07-17T06:07:11.777011",{"slug":2100,"name":2100,"fn":2101,"description":2102,"org":2103,"tags":2104,"stars":2032,"repoUrl":2033,"updatedAt":2109},"mcore-onboard-gb200-1node-tests","onboard functional tests for GB200","Onboard 1-node GitHub MR functional tests for GB200 from existing mr-scoped 2-node tests.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2105,2108],{"name":2106,"slug":2107,"type":15},"QA","qa",{"name":1950,"slug":1951,"type":15},"2026-07-14T05:25:53.673039",{"slug":2111,"name":2111,"fn":2112,"description":2113,"org":2114,"tags":2115,"stars":2032,"repoUrl":2033,"updatedAt":2118},"mcore-run-on-slurm","launch distributed training jobs on SLURM","How to launch distributed Megatron-LM training jobs on a SLURM cluster. Covers a minimal sbatch skeleton, environment-variable setup for torch.distributed.run, CUDA_DEVICE_MAX_CONNECTIONS rules across hardware and parallelism modes, container conventions, monitoring, and per-rank failure diagnosis.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2116,2117],{"name":1920,"slug":1921,"type":15},{"name":1923,"slug":1924,"type":15},"2026-07-14T05:25:49.362534",{"slug":2120,"name":2120,"fn":2121,"description":2122,"org":2123,"tags":2124,"stars":2032,"repoUrl":2033,"updatedAt":2132},"mcore-split-pr","split pull requests to reduce review load","Split a PR into multiple PRs to reduce the number of required CODEOWNERS reviewer groups.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2125,2128,2129],{"name":2126,"slug":2127,"type":15},"Code Review","code-review",{"name":2055,"slug":2056,"type":15},{"name":2130,"slug":2131,"type":15},"Pull Requests","pull-requests","2026-07-14T05:26:01.226578",{"slug":2134,"name":2134,"fn":2135,"description":2136,"org":2137,"tags":2138,"stars":2032,"repoUrl":2033,"updatedAt":2141},"mcore-testing","run and manage Megatron-LM tests","Test system for Megatron-LM. Covers test layout, recipe YAML structure, adding and running unit and functional tests, golden values, marker filters, and CI parity.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2139,2140],{"name":2106,"slug":2107,"type":15},{"name":1950,"slug":1951,"type":15},"2026-07-14T05:25:54.928983",{"slug":2143,"name":2143,"fn":2144,"description":2145,"org":2146,"tags":2147,"stars":2032,"repoUrl":2033,"updatedAt":2150},"nightly-sync","manage nightly main-to-dev sync workflows","Domain knowledge for the nightly main-to-dev sync workflow. Covers merge strategy, CI architecture, failure investigation, and known issues.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2148,2149],{"name":1960,"slug":1961,"type":15},{"name":2042,"slug":2043,"type":15},"2026-07-30T05:29:03.275638",496]