[model] feat: Add YARN support for mamba_model from MCORE#3289
Draft
guihong-nv wants to merge 1 commit intoNVIDIA-NeMo:mainfrom
Draft
[model] feat: Add YARN support for mamba_model from MCORE#3289guihong-nv wants to merge 1 commit intoNVIDIA-NeMo:mainfrom
guihong-nv wants to merge 1 commit intoNVIDIA-NeMo:mainfrom
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Signed-off-by: guihong-nv <guihongl@nvidia.com>
14bef13 to
0acb904
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do ?
Add the YARN support for mamba_model from MCORE.
Changelog
src/megatron/bridge/models/mamba/mamba_builder.py"yarn"to theposition_embedding_typeLiteralyarn_rotary_scaling_factor,yarn_original_max_position_embeddings,yarn_beta_fast,yarn_beta_slow,yarn_mscale,yarn_mscale_all_dim,yarn_correction_range_round_to_int)build_model(), injects YaRN fields onto the embeddedTransformerConfigbefore constructingMCoreMambaModelsrc/megatron/bridge/models/mamba/mamba_provider.pyTransformerConfig)provide(), computesyarn_original_max_position_embeddingsdefault fromseq_length / yarn_rotary_scaling_factorwhen not explicitly settests/unit_tests/models/mamba/test_mamba_builder.pyTestMambaModelConfigYarnDefaults: field defaults, type acceptance, mutabilityTestMambaModelBuilderBuildModelWithYarn: YaRN attr injection onto transformer config, default/explicityarn_original_max_position_embeddings, no injection for non-YaRN typestests/unit_tests/models/mamba/test_mamba_provider.pyTestMambaModelProviderYarnDefaults: field defaults and type acceptanceTestMambaModelProviderProvideWithYarn: default computation, explicit value preservation, no injection for non-YaRN typesGitHub Actions CI
See the CI sectionin the Contributing doc for how to trigger the CI. A Nvidia developer will need to approve and trigger the CI for external contributors.
Before your PR is "Ready for review"
Pre checks:
If you haven't finished some of the above items you can still open "Draft" PR.
Additional Information