Skip to content

Commit 8fc0f7d

Browse files
committed
clean up
Signed-off-by: Li Ding <liding@nvidia.com>
1 parent 7618457 commit 8fc0f7d

2 files changed

Lines changed: 0 additions & 71 deletions

File tree

‎src/megatron/bridge/models/nemotronh/nemotron_h_provider.py‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -197,24 +197,6 @@ class Nemotron3SuperProvider(NemotronHModelProvider):
197197
mtp_use_repeated_layer: bool = False
198198

199199

200-
# TODO(liding): remove debug provider
201-
@dataclass
202-
class Nemotron3SuperDebugProvider(Nemotron3SuperProvider):
203-
"""Configuration for a 3B parameter Nemotron 3 Super model."""
204-
205-
num_query_groups: int = 2
206-
hybrid_layer_pattern: str = "MEM*EME"
207-
hidden_size: int = 288
208-
ffn_hidden_size: int = 384
209-
num_attention_heads: int = 40
210-
num_moe_experts: int = 128
211-
moe_ffn_hidden_size: int = 2688
212-
moe_router_topk: int = 6
213-
moe_latent_size: int = 576
214-
mtp_num_layers: int = 2
215-
mtp_hybrid_override_pattern: str = "*E"
216-
217-
218200
# -----------------------------------------------------------------------------
219201
# Deprecated aliases (to be removed in a future release)
220202
# -----------------------------------------------------------------------------

‎src/megatron/bridge/recipes/nemotronh/nemotron_3_super.py‎

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import torch
1717

1818
from megatron.bridge import AutoBridge
19-
from megatron.bridge.models.nemotronh import Nemotron3SuperDebugProvider
2019
from megatron.bridge.peft.base import PEFT
2120
from megatron.bridge.peft.lora import LoRA
2221
from megatron.bridge.recipes.common import _peft_common, _pretrain_common, _sft_common
@@ -124,7 +123,6 @@ def nemotron_3_super_pretrain_config() -> ConfigContainer:
124123
cfg.ddp.overlap_param_gather = True
125124
cfg.ddp.check_for_nan_in_grad = True
126125
cfg.ddp.use_distributed_optimizer = True
127-
# TODO(liding): why others recipes set this to True? and can work with calc_per_token_loss?
128126
cfg.ddp.average_in_collective = False
129127

130128
cfg.model.init_method_std = 0.014
@@ -261,57 +259,6 @@ def nemotron_3_super_finetune_config(
261259
return cfg
262260

263261

264-
# TODO(liding): remove debug provider
265-
def nemotron_3_super_debug_pretrain_config() -> ConfigContainer:
266-
"""Return a pre-training config for Nemotron 3 Super Debug (small, 1-node).
267-
268-
Uses ``Nemotron3SuperDebugProvider`` which is a small model that fits on a
269-
single node with TP=1, EP=8.
270-
271-
Returns:
272-
ConfigContainer: Pre-training configuration for Nemotron 3 Super Debug.
273-
"""
274-
cfg = nemotron_3_super_pretrain_config()
275-
276-
cfg.model = Nemotron3SuperDebugProvider(
277-
tensor_model_parallel_size=1,
278-
pipeline_model_parallel_size=1,
279-
pipeline_dtype=torch.bfloat16,
280-
virtual_pipeline_model_parallel_size=None,
281-
context_parallel_size=1,
282-
sequence_parallel=True,
283-
expert_tensor_parallel_size=1,
284-
expert_model_parallel_size=8,
285-
seq_length=8192,
286-
)
287-
288-
# MoE Token Dispatcher Settings
289-
cfg.model.moe_token_dispatcher_type = "alltoall"
290-
cfg.model.moe_shared_expert_overlap = False
291-
cfg.model.moe_flex_dispatcher_backend = "hybridep"
292-
293-
# CUDA Graph (TE impl + partial scopes: ~40% throughput gain over disabled)
294-
cfg.model.cuda_graph_impl = "transformer_engine"
295-
cfg.model.cuda_graph_scope = ["attn", "mamba", "moe_router", "moe_preprocess"]
296-
cfg.model.cuda_graph_warmup_steps = 3
297-
298-
# Transformer Engine (TE)
299-
cfg.model.transformer_impl = "transformer_engine"
300-
301-
# Kernel Selections
302-
cfg.model.attention_backend = "fused"
303-
cfg.model.cross_entropy_fusion_impl = "te"
304-
cfg.model.use_te_rng_tracker = True
305-
306-
# MTP Settings
307-
cfg.model.keep_mtp_spec_in_bf16 = True
308-
cfg.model.calculate_per_token_loss = True
309-
cfg.model.mtp_loss_scaling_factor = 0.3
310-
cfg.model.mtp_use_repeated_layer = True
311-
312-
return cfg
313-
314-
315262
__all__ = [
316263
"nemotron_3_super_pretrain_config",
317264
"nemotron_3_super_debug_pretrain_config",

0 commit comments

Comments
 (0)