|
16 | 16 | import torch |
17 | 17 |
|
18 | 18 | from megatron.bridge import AutoBridge |
19 | | -from megatron.bridge.models.nemotronh import Nemotron3SuperDebugProvider |
20 | 19 | from megatron.bridge.peft.base import PEFT |
21 | 20 | from megatron.bridge.peft.lora import LoRA |
22 | 21 | from megatron.bridge.recipes.common import _peft_common, _pretrain_common, _sft_common |
@@ -124,7 +123,6 @@ def nemotron_3_super_pretrain_config() -> ConfigContainer: |
124 | 123 | cfg.ddp.overlap_param_gather = True |
125 | 124 | cfg.ddp.check_for_nan_in_grad = True |
126 | 125 | cfg.ddp.use_distributed_optimizer = True |
127 | | - # TODO(liding): why others recipes set this to True? and can work with calc_per_token_loss? |
128 | 126 | cfg.ddp.average_in_collective = False |
129 | 127 |
|
130 | 128 | cfg.model.init_method_std = 0.014 |
@@ -261,57 +259,6 @@ def nemotron_3_super_finetune_config( |
261 | 259 | return cfg |
262 | 260 |
|
263 | 261 |
|
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 | | - |
315 | 262 | __all__ = [ |
316 | 263 | "nemotron_3_super_pretrain_config", |
317 | 264 | "nemotron_3_super_debug_pretrain_config", |
|
0 commit comments