Repository navigation
chore(model): deprecate legacy model support - #5025
Conversation
|
/ok to test 0b68d05 |
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
0b68d05 to
c581694
Compare
|
/ok to test c581694 |
|
Light Review Docs-heavy deprecation PR plus a new Findings
Test coverage notes
Suggested test cases
No perf tests impacted (no |
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
|
/ok to test ee5a06a |
|
/ok to test 16d2f10 |
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
|
/ok to test 163d3fb |
…2 TE path Gemma2TEDotProductAttention applied sliding-window attention to even 1-indexed layers and full causal attention to odd ones. That is the exact inverse of both the unfused Gemma2DotProductAttention oracle and HuggingFace: transformers builds layer_types as "sliding_attention" when (i + 1) % 2 is truthy over its 0-indexed i, and mcore's layer_number is i + 1, so HF layer 0 is mcore layer 1 and slides. Every layer therefore got the wrong mask under use_transformer_engine_attention, silently training a different model rather than failing. The stale comment quoting the oracle as "% 2 == 0" described the pre-fix oracle, which was corrected in NVIDIA-NeMo#4875; the HF-derived guard that would have caught this lived in test_gemma2_provider.py, deleted in NVIDIA-NeMo#5025. Also: - Re-anchor the SWA masking test on the unfused oracle instead of comparing the TE path against itself. The previous form passed with the inversion present and would have failed once it was fixed. - Set _QUERY_PRE_ATTN_SCALAR != _HEAD_DIM in the test fixture. They were both 64, so 1/sqrt(query_pre_attn_scalar) coincided with the default 1/sqrt(head_dim) and removing the Gemma2 scale logic entirely would still have passed. - Re-apply the attention constraints in finalize(). apply_overrides_and_finalize() setattrs then calls finalize() and never re-runs __post_init__, so enabling the flag through the canonical override path selected the TE attention class while leaving attention_backend at auto and skipped the softcap validation. Follows the gemma4_provider.py precedent. Signed-off-by: Nitin Vegesna <nvegesna@nvidia.com>
…2 TE path Gemma2TEDotProductAttention applied sliding-window attention to even 1-indexed layers and full causal attention to odd ones. That is the exact inverse of both the unfused Gemma2DotProductAttention oracle and HuggingFace: transformers builds layer_types as "sliding_attention" when (i + 1) % 2 is truthy over its 0-indexed i, and mcore's layer_number is i + 1, so HF layer 0 is mcore layer 1 and slides. Every layer therefore got the wrong mask under use_transformer_engine_attention, silently training a different model rather than failing. The stale comment quoting the oracle as "% 2 == 0" described the pre-fix oracle, which was corrected in NVIDIA-NeMo#4875; the HF-derived guard that would have caught this lived in test_gemma2_provider.py, deleted in NVIDIA-NeMo#5025. Also: - Re-anchor the SWA masking test on the unfused oracle instead of comparing the TE path against itself. The previous form passed with the inversion present and would have failed once it was fixed. - Set _QUERY_PRE_ATTN_SCALAR != _HEAD_DIM in the test fixture. They were both 64, so 1/sqrt(query_pre_attn_scalar) coincided with the default 1/sqrt(head_dim) and removing the Gemma2 scale logic entirely would still have passed. - Re-apply the attention constraints in finalize(). apply_overrides_and_finalize() setattrs then calls finalize() and never re-runs __post_init__, so enabling the flag through the canonical override path selected the TE attention class while leaving attention_backend at auto and skipped the softcap validation. Follows the gemma4_provider.py precedent. Signed-off-by: Nitin Vegesna <nvegesna@nvidia.com>
Summary
NemotronForCausalLMbridgeFutureWarningnotices fromAutoBridgeand legacy Nemotron H recipe entry points, with removal scheduled for Megatron Bridge 0.7.0nvidia/Nemotron-4-340B-Instructbefore config loading because the public repository does not expose an AutoBridge-readable HF configLlama 3, Ministral 3, Nemotron Nano v2, and Nemotron 3 are not deprecated.
Testing
uv run --no-sync pre-commit run --all-filesruff check,ruff format --check, Python compile, and deprecated-reference auditsPYTHONPATH=src:3rdparty/Megatron-LM uv run --no-sync mypy --strict --follow-imports=skip src/megatron/bridge/models/_deprecation.pyFocused pytest collection could not run locally on macOS. Normal
uv rundependency sync is blocked by the Linux-onlynvidia-resiliency-extwheel; the no-sync worktree lacks an importable Megatron-Core installation, and the reduced environment reaches a Triton dependency unavailable on macOS. Linux CI covers the remaining validation.