Skip to content

Commit d5d39a7

Browse files
committed
Merge branch 'main' into super-v3-pr
2 parents fdd3b7f + 821aa6a commit d5d39a7

7 files changed

Lines changed: 171 additions & 71 deletions

File tree

‎.github/workflows/_update_dependencies.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ jobs:
115115
commit-message: ${{ env.title }}
116116
signoff: true
117117
committer: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>"
118-
labels: needs-more-tests
118+
labels: full-test-suite
119119

120120
- name: Post /ok to test comment
121121
env:

‎.github/workflows/cicd-main.yml‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ jobs:
298298
needs: [pre-flight, cicd-container-build]
299299
outputs:
300300
needs_more_tests: ${{ steps.check.outputs.needs_more_tests }}
301+
full_test_suite: ${{ steps.check.outputs.full_test_suite }}
301302
steps:
302303
- name: Check PR labels
303304
id: check
@@ -312,8 +313,14 @@ jobs:
312313
else
313314
echo "needs_more_tests=false" >> $GITHUB_OUTPUT
314315
fi
316+
if echo "$LABELS" | grep -q "full-test-suite"; then
317+
echo "full_test_suite=true" >> $GITHUB_OUTPUT
318+
else
319+
echo "full_test_suite=false" >> $GITHUB_OUTPUT
320+
fi
315321
else
316322
echo "needs_more_tests=false" >> $GITHUB_OUTPUT
323+
echo "full_test_suite=false" >> $GITHUB_OUTPUT
317324
fi
318325
319326
cicd-unit-tests-core:
@@ -558,7 +565,7 @@ jobs:
558565
|| needs.pre-flight.outputs.force_run_all == 'true'
559566
)
560567
&& !cancelled()
561-
&& (github.ref == 'refs/heads/main' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || needs.check-labels.outputs.needs_more_tests == 'true')
568+
&& (github.ref == 'refs/heads/main' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || needs.check-labels.outputs.needs_more_tests == 'true' || needs.check-labels.outputs.full_test_suite == 'true')
562569
&& (github.event.inputs.test_suite == '' || github.event.inputs.test_suite == 'all' || github.event.inputs.test_suite == 'functional-only')
563570
name: ${{ matrix.script }}
564571
environment: nemo-ci
@@ -617,7 +624,7 @@ jobs:
617624
fail-fast: false
618625
max-parallel: 16
619626
matrix: ${{ fromJSON(needs.generate-test-matrix.outputs.matrix_l2) }}
620-
needs: [pre-flight, generate-test-matrix, cicd-unit-tests-core, cicd-unit-tests-diffusion]
627+
needs: [pre-flight, generate-test-matrix, cicd-unit-tests-core, cicd-unit-tests-diffusion, check-labels]
621628
runs-on: ${{ needs.pre-flight.outputs.runner_prefix }}-gpu-x2
622629
if: |
623630
(
@@ -626,7 +633,7 @@ jobs:
626633
|| needs.pre-flight.outputs.force_run_all == 'true'
627634
)
628635
&& !cancelled()
629-
&& (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
636+
&& (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || needs.check-labels.outputs.full_test_suite == 'true')
630637
&& (github.event.inputs.test_suite == '' || github.event.inputs.test_suite == 'all' || github.event.inputs.test_suite == 'functional-only')
631638
name: ${{ matrix.script }}
632639
environment: nemo-ci

‎docs/performance-summary.md‎

Lines changed: 148 additions & 61 deletions
Large diffs are not rendered by default.

‎src/megatron/bridge/models/conversion/model_bridge.py‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,7 @@ def provider_bridge(self, hf_pretrained: HFPreTrained) -> ModelProviderTarget:
448448
ModelProviderTarget: A configured model provider instance
449449
"""
450450
from megatron.bridge.models.gpt_provider import GPTModelProvider
451+
from megatron.bridge.models.mla_provider import MLAModelProvider
451452

452453
hf_config = hf_pretrained.config
453454

@@ -458,22 +459,25 @@ def provider_bridge(self, hf_pretrained: HFPreTrained) -> ModelProviderTarget:
458459

459460
# Use specified provider class, defaulting to GPTModelProvider
460461
provider_class = self.PROVIDER_CLASS if self.PROVIDER_CLASS is not None else GPTModelProvider
462+
is_mla_provider = issubclass(provider_class, MLAModelProvider)
461463
# Filter kwargs to only fields the provider dataclass accepts, so that MLA-only None
462464
# values (q_lora_rank, kv_lora_rank, …) are silently dropped for non-MLA providers
463465
# while still being passed through for MLA providers that declare them as fields.
464466
valid_fields = provider_class.__dataclass_fields__
465467
provider = provider_class(**{k: v for k, v in provider_kwargs.items() if k in valid_fields})
466468

467-
# All models that flow through the base provider_bridge use RoPE.
468-
# YARN is already handled above (hf_config_to_provider_kwargs sets
469-
# position_embedding_type="yarn"), so we only need to guard against
470-
# overwriting it here. Every other rope_type value (None, "default",
471-
# "llama3", "longrope", …) means plain RoPE.
469+
# Determine position_embedding_type from HF rope_scaling.
470+
# For GPT providers: rope_type=="yarn" → "yarn"; everything else → "rope".
471+
# For MLA providers: always "rope" — YaRN scaling parameters are applied
472+
# separately via mla_rope_params (rotary_scaling_factor, mscale, etc.) and
473+
# position_embedding_type="yarn" is not a valid MLA config value.
472474
hf_rope_scaling = getattr(hf_config, "rope_scaling", None)
473475
rope_type = None
474476
if hf_rope_scaling:
475477
rope_type = hf_rope_scaling.get("type") or hf_rope_scaling.get("rope_type")
476-
if rope_type != "yarn":
478+
if rope_type == "yarn" and not is_mla_provider:
479+
provider.position_embedding_type = "yarn"
480+
else:
477481
provider.position_embedding_type = "rope"
478482

479483
# Apply MLA rope params via setattr (for MLA models like DeepSeek, Kimi)

‎src/megatron/bridge/models/deepseek/deepseek_v2_bridge.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def provider_bridge(self, hf_pretrained: PreTrainedCausalLM) -> MLAModelProvider
6262
provider.moe_permute_fusion = True
6363

6464
provider.apply_rope_fusion = False
65+
provider.gradient_accumulation_fusion = True
6566
provider.bias_activation_fusion = True
6667
provider.bias_dropout_fusion = True
6768
provider.cross_entropy_fusion_impl = "te"

‎src/megatron/bridge/models/deepseek/deepseek_v3_bridge.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ def provider_bridge(self, hf_pretrained: PreTrainedCausalLM) -> MLAModelProvider
6969
provider.moe_aux_loss_coeff = 0.0001
7070

7171
provider.apply_rope_fusion = False
72+
provider.gradient_accumulation_fusion = True
7273
provider.bias_activation_fusion = True
7374
provider.bias_dropout_fusion = True
7475
provider.cross_entropy_fusion_impl = "te"

tests/functional_tests/launch_scripts/active/L2_Launch_recipes_qwen_vl.sh renamed to tests/functional_tests/launch_scripts/flaky/L2_Launch_recipes_qwen_vl.sh

File renamed without changes.

0 commit comments

Comments
 (0)