Skip to content
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
d586ddb
Remove do_not_average_loss
yfw Feb 18, 2026
96d4a11
Update gitmodules for mcore branch
yfw Feb 18, 2026
9bc1b9a
Merge remote-tracking branch 'origin/yifu/remove_do_not_average_loss'…
ahmadki Feb 19, 2026
e5d1ae9
Switching mcore to upstream main
ahmadki Feb 19, 2026
50aa2de
refit latest update based on ahmads refactor
Feb 19, 2026
13a5c0a
Some fixes:
Feb 19, 2026
af27054
Fixes for offload
Feb 20, 2026
6b4ad6f
Fixes for offload
Feb 20, 2026
c19ee75
chore: Switching mcore to upstream main
ahmadki Feb 19, 2026
b0bd9f9
Point Megatron-LM submodule to fork with fixes
Feb 20, 2026
fb3905c
Update Megatron-LM submodule
Feb 20, 2026
924e32a
TE version bump to match mcore
ahmadki Feb 22, 2026
4ba7f09
bumped mbridge
ahmadki Feb 22, 2026
07f73ce
Fixed mcore inference module
ahmadki Feb 22, 2026
3b9f96b
bumped megatron-lm again
ahmadki Feb 22, 2026
f6f06c9
fix: move SequencePackingGradientTestActor to separate module to avoi…
ahmadki Feb 22, 2026
04d300f
fix: moved PackSequencesTestActor to a to separate module to avoid py…
ahmadki Feb 22, 2026
9527d56
temporarily disabled test_megatron_checkpoint_save_kill_and_restore d…
ahmadki Feb 22, 2026
8d0d33e
temp: don't exit on first failure.
ahmadki Feb 22, 2026
8a09bf8
switched to a fork of mcore with fixed dist optim
ahmadki Feb 23, 2026
5e4a61f
Latest changes to remove inference_mode context manager
Feb 23, 2026
3dde60d
Fixes (latest mcore main + helens fix)
Feb 23, 2026
5258e35
nccl timeout issue
Feb 24, 2026
3f93550
Using main branch
Feb 26, 2026
af43ba3
merge conflicts
Feb 26, 2026
a4f1dcd
Update nccl_timeout.md
shanmugamr1992 Feb 28, 2026
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
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "3rdparty/Megatron-LM"]
path = 3rdparty/Megatron-LM-workspace/Megatron-LM
url = https://github.com/yaoyu-33/Megatron-LM.git
url = https://github.com/NVIDIA/Megatron-LM.git
branch = main
shallow = true
[submodule "3rdparty/Megatron-Bridge"]
Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/Megatron-LM-workspace/Megatron-LM
Submodule Megatron-LM updated 723 files
7 changes: 5 additions & 2 deletions 3rdparty/Megatron-LM-workspace/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
# VCS dependencies use full "pkg @ git+URL@rev" format matching pyproject.toml [tool.uv.sources]
CACHED_DEPENDENCIES = [
# Default dependencies from pyproject.toml
"torch",
"torch>=2.6.0",
"numpy",
"packaging>=24.2",
# Dev dependencies from pyproject.toml
Expand All @@ -58,7 +58,7 @@
"opentelemetry-api~=1.33.1",
"mamba-ssm~=2.2",
"causal-conv1d~=1.5",
"flash-linear-attention~=0.3.2",
"flash-linear-attention~=0.4.0",
"nv-grouped-gemm~=1.1",
"megatron-energon[av_decode]~=6.0",
"av",
Expand All @@ -69,6 +69,9 @@
"emerging_optimizers @ git+https://github.com/NVIDIA-NeMo/Emerging-Optimizers.git@v0.1.0",
"datasets",
"fastapi~=0.50",
"flask[async]",
"hypercorn",
"openai",
]


Expand Down
14 changes: 11 additions & 3 deletions examples/configs/grpo_math_1B.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@ policy:
moe_enable_deepep: false
moe_token_dispatcher_type: "allgather"
moe_shared_expert_overlap: false
moe_pad_experts_for_cuda_graph_inference: false
cuda_graph_impl: "local"
cuda_graph_scope: null
use_te_rng_tracker: true
inference_rng_tracker: true

optimizer:
optimizer: "adam"
Expand Down Expand Up @@ -252,13 +257,16 @@ policy:
stop_strings: null
mcore_generation_config:
buffer_size_gb: 20 # Total GPU memory (in GB) allocated for KV cache buffers
buffer_guaranteed_fraction: 0.1 # Fraction of buffer reserved for guaranteed active requests
num_cuda_graphs: 16 # Number of CUDA graphs to pre-compile for different batch sizes
block_size_tokens: 256 # Size of each KV cache block in tokens (affects memory granularity)
use_cuda_graphs_for_non_decode_steps: true # Enable CUDA graphs for prefill/context processing
enable_chunked_prefill: true # Split long prefills into chunks for better memory management
unified_memory_level: 0 # Unified memory usage level (0=disabled, higher values enable more aggressive paging)
unified_memory_level: 0 # Unified memory usage level (0=disabled, 1+=enables unified memory )
max_tokens: 16384 # Maximum number of tokens to use in a single step. Analogous to vllm's max_num_batched_tokens
enable_chunked_prefill: false
kv_cache_management_mode: "persist" # Can be "persist", "offload", or "recompute"
static_kv_memory_pointers: false # Relevant only for offload and recompute modes
materialize_only_last_token_logits: false

vllm_cfg:
async_engine: false
precision: ${policy.precision}
Expand Down
12 changes: 10 additions & 2 deletions examples/configs/grpo_math_1B_megatron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ policy:
moe_shared_expert_overlap: false
#gives ~20% training perf speedup with sequence packing
apply_rope_fusion: True
moe_pad_experts_for_cuda_graph_inference: false
cuda_graph_impl: "local"
cuda_graph_scope: null
use_te_rng_tracker: true
inference_rng_tracker: true

optimizer:
optimizer: "adam"
Expand Down Expand Up @@ -151,9 +156,12 @@ policy:
num_cuda_graphs: 16 # Number of CUDA graphs to pre-compile for different batch sizes
block_size_tokens: 256 # Size of each KV cache block in tokens (affects memory granularity)
use_cuda_graphs_for_non_decode_steps: true # Enable CUDA graphs for prefill/context processing
enable_chunked_prefill: false # Split long prefills into chunks for better memory management
unified_memory_level: 0 # Unified memory usage level (0=disabled, higher values enable more aggressive paging)
unified_memory_level: 1 # Unified memory usage level (0=disabled, 1+=enables unified memory )
max_tokens: 16384 # Maximum number of tokens to use in a single step. Analogous to vllm's max_num_batched_tokens
enable_chunked_prefill: false
kv_cache_management_mode: "persist" # Can be "persist", "offload", or "recompute"
static_kv_memory_pointers: false # Relevant only for offload and recompute modes
materialize_only_last_token_logits: false

vllm_cfg:
tensor_parallel_size: 1
Expand Down
Loading
Loading