Skip to content

fix for missing mcore arg#8070

Closed
arendu wants to merge 4 commits intomainfrom
adithyare/merge_fix
Closed

fix for missing mcore arg#8070
arendu wants to merge 4 commits intomainfrom
adithyare/merge_fix

Conversation

@arendu
Copy link
Collaborator

@arendu arendu commented Dec 20, 2023

What does this PR do ?

Mcore refactor introduced an error when trying to merge.

Loading distributed checkpoint with TensorStoreLoadShardedStrategy
[NeMo I 2023-12-13 12:13:12 nlp_overrides:752] Model MegatronGPTModel was successfully restored from /workspace/models/nemo_version/llama2-7b.nemo.
Error executing job with overrides: []
Traceback (most recent call last):
  File "/workspace/NeMo/scripts/nlp_language_modeling/merge_lora_weights/merge.py", line 198, in main
    lora_model_cfg = MegatronGPTLoRAModel.restore_from(
TypeError: NLPModel.restore_from() got an unexpected keyword argument 'mcore'

This PR is a patch for this error.

Collection: [Note which collection this PR will affect]

Changelog

  • Add specific line by line info of high level changes in this PR.

Usage

  • You can potentially add a usage example below
# Add a code snippet demonstrating how to use this 

Jenkins CI

To run Jenkins, a NeMo User with write access must comment jenkins on the PR.

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you add or update any necessary documentation?
  • Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
    • Reviewer: Does the PR have correct import guards for all optional libraries?

PR Type:

  • New Feature
  • Bugfix
  • Documentation

If you haven't finished some of the above items you can still open "Draft" PR.

Who can review?

Anyone in the community is free to review the PR once the checks have passed.
Contributor guidelines contains specific people who can review PRs to various areas.

Additional Information

  • Related to # (issue)

Signed-off-by: arendu <adithya.r@gmail.com>
@arendu arendu changed the title xfix for missing mcore arg fix for missing mcore arg Dec 20, 2023
@arendu
Copy link
Collaborator Author

arendu commented Dec 21, 2023

jenkins


if hasattr(model, 'mcore_gpt'):
assert (
model.mcore_gpt == False
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please write this as assert not model.mcore_gpt for consistency?

I hope we'll introduce flake8 for static code analysis soon and this would be one of the places it complains about, see https://www.flake8rules.com/rules/E712.html.

@cuichenx
Copy link
Collaborator

cuichenx commented Jan 2, 2024

Addressed in #8113 so closing this

@cuichenx cuichenx closed this Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments