Repository navigation
Commit 43eb53e
committed
[model] fix: restore position_embedding_type and gradient_accumulation_fusion for MLA models
Two regressions caused a ~30% perf drop on DSV3 GB300 MXFP8 (1292 → 914
TFLOPs, March 14 → March 18), introduced by PRs #2599 and #2739.
Fix 1 (model_bridge.py): MLA providers with YaRN rope_scaling were
getting position_embedding_type="learned_absolute". The base
provider_bridge() only set "rope" when rope_type != "yarn", but for MLA
models YaRN scaling is handled via mla_rope_params — position_embedding_type
must always be "rope". Add is_mla_provider check to handle this correctly.
Fix 2 (deepseek_v2/v3_bridge.py): gradient_accumulation_fusion was
hardcoded True before #2739 removed it in favor of the dynamic
can_enable_gradient_accumulation_fusion() check. That check returns False
if fused_weight_gradient_mlp_cuda (APEX CUDA extension) is not importable,
silently disabling the fusion. Restore explicit True for DeepSeek V2/V3.
Signed-off-by: Yu Yao <yaoyu.094@gmail.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>1 parent 877779a commit 43eb53e
3 files changed
Lines changed: 12 additions & 6 deletions
File tree
- src/megatron/bridge/models
- conversion
- deepseek
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
448 | 448 | | |
449 | 449 | | |
450 | 450 | | |
| 451 | + | |
451 | 452 | | |
452 | 453 | | |
453 | 454 | | |
| |||
458 | 459 | | |
459 | 460 | | |
460 | 461 | | |
| 462 | + | |
461 | 463 | | |
462 | 464 | | |
463 | 465 | | |
464 | 466 | | |
465 | 467 | | |
466 | 468 | | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
472 | 474 | | |
473 | 475 | | |
474 | 476 | | |
475 | 477 | | |
476 | | - | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
477 | 481 | | |
478 | 482 | | |
479 | 483 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| |||
0 commit comments