Skip to content

Commit 3e9bdf9

Browse files
Address review: warn when the GLM-5 MTP copy finds no tensors; note optional DSA test imports
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Keval Morabia <28916987+kevalmorabia97@users.noreply.github.com>
1 parent 526ee78 commit 3e9bdf9

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

‎modelopt/torch/export/unified_export_megatron.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,8 @@ def _copy_decoder_mtp_layers_from_pretrained(self) -> dict[str, torch.Tensor]:
936936
self.exclude_modules.append(dst + "*")
937937
if mtp_state_dict:
938938
print(f"Copied {len(mtp_state_dict)} MTP tensors from {source}")
939+
else:
940+
warn_rank_0(f"No MTP tensors under {src_prefixes} in {source}; exporting without MTP.")
939941
return mtp_state_dict
940942

941943
@staticmethod

‎tests/gpu_megatron/torch/quantization/plugins/test_megatron.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1886,6 +1886,7 @@ def test_registered_megatron_quant_modules_checkpoint_quantizer_state():
18861886

18871887
def _get_tiny_dsa_gpt_model():
18881888
"""Tiny GPT with DSA sparse attention (AbsorbedMLASelfAttention + DSAttention + indexer)."""
1889+
# Local: DSA is optional; test_dsa_kv_cache_quant importorskips it before calling this.
18891890
from megatron.core.models.gpt.experimental_attention_variant_module_specs import (
18901891
get_transformer_block_with_experimental_attention_variant_spec,
18911892
)
@@ -1925,6 +1926,7 @@ def _get_tiny_dsa_gpt_model():
19251926

19261927

19271928
def _test_dsa_kv_cache_quant_helper(tmp_path, rank, size):
1929+
# Local: DSA is optional; test_dsa_kv_cache_quant importorskips it before calling this.
19281930
from megatron.core.transformer.experimental_attention_variant.dsa import DSAttention
19291931

19301932
initialize_for_megatron(tensor_model_parallel_size=1, pipeline_model_parallel_size=1, seed=SEED)

0 commit comments

Comments
 (0)