mirror of
https://github.com/NVIDIA/Model-Optimizer.git
synced 2026-12-06 04:57:17 +08:00
Name the tested Megatron-Bridge setup; Medusa export stays on ModelOpt 0.50
Point the deprecation at the Megatron-Bridge commit examples/megatron_bridge/README.md names, and exercise the documented source_path call in the Bridge parity test. Medusa export won't move to Megatron-Bridge: keep export_mcore_gpt_to_hf in ModelOpt 0.50 or earlier for it. EAGLE stays listed as still needing the old exporter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Keval Morabia <28916987+kevalmorabia97@users.noreply.github.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
7c75acd305
commit
517b447ea9
+1
-1
@@ -50,7 +50,7 @@ Changelog
|
||||
|
||||
**Deprecations**
|
||||
|
||||
- ``modelopt.torch.export.export_mcore_gpt_to_hf`` is deprecated and planned for removal in 0.51.0; it now emits a ``DeprecationWarning``. Where it supports the checkpoint, export quantized Megatron-Core models to Hugging Face checkpoints with Megatron-Bridge's ``AutoBridge.save_hf_pretrained_modelopt`` (in Megatron-Bridge newer than the ``nemo:26.10`` container) instead, from the quantized model chunks and the local source checkpoint (``source_path``); see the function's docstring. It doesn't export GGML / IQ formats, EAGLE / Medusa modules (``export_extra_modules=True``), weight formats it can't pack (e.g. INT8 weight-only) or a VLM whose Megatron checkpoint holds only the language model yet.
|
||||
- ``modelopt.torch.export.export_mcore_gpt_to_hf`` is deprecated and planned for removal in 0.51.0; it now emits a ``DeprecationWarning``. Where it supports the checkpoint, export quantized Megatron-Core models to Hugging Face checkpoints with Megatron-Bridge's ``AutoBridge.save_hf_pretrained_modelopt`` (in a Megatron-Bridge newer than the one in ``nemo:26.10``, such as the commit ``examples/megatron_bridge/README.md`` names) instead, from the quantized model chunks and the local source checkpoint (``source_path``); see the function's docstring. It doesn't export GGML / IQ formats, EAGLE modules (``export_extra_modules=True``), weight formats it can't pack (e.g. INT8 weight-only) or a VLM whose Megatron checkpoint holds only the language model yet. Medusa export won't move to Megatron-Bridge; to export Medusa heads, keep using ``export_mcore_gpt_to_hf`` in ModelOpt 0.50 or earlier.
|
||||
|
||||
**Bug Fixes**
|
||||
|
||||
|
||||
@@ -2441,9 +2441,10 @@ def export_mcore_gpt_to_hf(
|
||||
|
||||
.. deprecated:: 0.50.0
|
||||
Planned for removal in 0.51.0. Where it supports the checkpoint, export with
|
||||
Megatron-Bridge's ``AutoBridge.save_hf_pretrained_modelopt`` (in Megatron-Bridge newer
|
||||
than the ``nemo:26.10`` container) instead, from the quantized model chunks and the local
|
||||
HF source checkpoint:
|
||||
Megatron-Bridge's ``AutoBridge.save_hf_pretrained_modelopt`` instead, from the quantized
|
||||
model chunks and the local HF source checkpoint. It needs a Megatron-Bridge newer than the
|
||||
one in ``nemo:26.10``: ModelOpt tests it at the commit ``examples/megatron_bridge/README.md``
|
||||
names.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
@@ -2451,14 +2452,17 @@ def export_mcore_gpt_to_hf(
|
||||
bridge.save_hf_pretrained_modelopt(model_chunks, export_dir, source_path=hf_path)
|
||||
|
||||
It doesn't export these yet, so keep using this function for them: GGML / IQ formats,
|
||||
EAGLE / Medusa modules (``export_extra_modules=True``), weight formats it can't pack
|
||||
(e.g. INT8 weight-only), and a VLM whose Megatron checkpoint holds only the language model.
|
||||
EAGLE modules (``export_extra_modules=True``), weight formats it can't pack (e.g. INT8
|
||||
weight-only), and a VLM whose Megatron checkpoint holds only the language model.
|
||||
|
||||
Medusa export won't move to Megatron-Bridge. To export Medusa heads, keep using this
|
||||
function in ModelOpt 0.50 or earlier.
|
||||
"""
|
||||
warnings.warn(
|
||||
"export_mcore_gpt_to_hf is deprecated as of 0.50.0 and planned for removal in 0.51.0. "
|
||||
"Where it supports the checkpoint, export with Megatron-Bridge's "
|
||||
"AutoBridge.save_hf_pretrained_modelopt instead; see this function's docstring for what "
|
||||
"it doesn't export yet (e.g. GGML / IQ formats, EAGLE / Medusa modules).",
|
||||
"it doesn't export (e.g. GGML / IQ formats, EAGLE and Medusa modules).",
|
||||
DeprecationWarning,
|
||||
stacklevel=2,
|
||||
)
|
||||
|
||||
@@ -85,7 +85,7 @@ def _export_with_megatron_exporter(source, quant_cfg_name, export_dir, rank, siz
|
||||
|
||||
def _export_with_bridge(source, quant_cfg_name, export_dir, rank, size):
|
||||
bridge, model, _ = _quantize(source, quant_cfg_name, size)
|
||||
bridge.save_hf_pretrained_modelopt(model, str(export_dir))
|
||||
bridge.save_hf_pretrained_modelopt(model, str(export_dir), source_path=str(source))
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
Reference in New Issue
Block a user