Skip to content

NeMo-UX: fix nemo-ux export path#11081

Merged
akoumpa merged 19 commits intomainfrom
akoumparouli/nemo_ux_fix_export_path
Oct 30, 2024
Merged

NeMo-UX: fix nemo-ux export path#11081
akoumpa merged 19 commits intomainfrom
akoumparouli/nemo_ux_fix_export_path

Conversation

@akoumpa
Copy link
Collaborator

@akoumpa akoumpa commented Oct 29, 2024

What does this PR do ?

Fixes #10939

In particular changes include:

  1. when using nemo_load setting setup_optimizers to False
  2. load_context will try to load from /context or parent if it fails
  3. when exporting to HF will prune padding from input and output layers to restore original vocab size.

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 

GitHub Actions CI

The Jenkins CI system has been replaced by GitHub Actions self-hosted runners.

The GitHub Actions CI will run automatically when the "Run CICD" label is added to the PR.
To re-run CI remove and add the label again.
To run CI on an untrusted fork, a NeMo user with write access must first click "Approve and run".

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)

@akoumpa akoumpa force-pushed the akoumparouli/nemo_ux_fix_export_path branch 3 times, most recently from 7f05199 to 3ea99d4 Compare October 29, 2024 11:14
@akoumpa akoumpa force-pushed the akoumparouli/nemo_ux_fix_export_path branch 4 times, most recently from 5a50005 to 0ce22da Compare October 29, 2024 15:56
@akoumpa akoumpa force-pushed the akoumparouli/nemo_ux_fix_export_path branch from 77a1e61 to 0ce22da Compare October 29, 2024 16:01
@akoumpa akoumpa force-pushed the akoumparouli/nemo_ux_fix_export_path branch from 86f9067 to 3a1a0bb Compare October 29, 2024 16:15
@akoumpa akoumpa force-pushed the akoumparouli/nemo_ux_fix_export_path branch from 212522f to bb08dbe Compare October 29, 2024 16:17
@akoumpa akoumpa force-pushed the akoumparouli/nemo_ux_fix_export_path branch from e19759e to eb9e86a Compare October 29, 2024 16:19
@akoumpa akoumpa removed the Run CICD label Oct 29, 2024
@akoumpa akoumpa changed the title Akoumparouli/nemo ux fix export path Fix nemo-ux export path Oct 29, 2024
@akoumpa akoumpa added the r2.0.0 label Oct 29, 2024
Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
@akoumpa akoumpa force-pushed the akoumparouli/nemo_ux_fix_export_path branch 3 times, most recently from 678501a to e8d045c Compare October 30, 2024 02:14
Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
@akoumpa akoumpa force-pushed the akoumparouli/nemo_ux_fix_export_path branch from 582bc4a to 227a693 Compare October 30, 2024 02:15
@akoumpa akoumpa added Run CICD and removed Run CICD labels Oct 30, 2024
Signed-off-by: akoumpa <akoumpa@users.noreply.github.com>
@akoumpa akoumpa added Run CICD and removed Run CICD labels Oct 30, 2024
@akoumpa akoumpa changed the title Fix nemo-ux export path NeMo-UX: fix nemo-ux export path Oct 30, 2024
@akoumpa akoumpa marked this pull request as ready for review October 30, 2024 07:40
@akoumpa akoumpa enabled auto-merge (squash) October 30, 2024 09:36
@github-actions
Copy link
Contributor

[🤖]: Hi @akoumpa 👋,

We wanted to let you know that a CICD pipeline for this PR just finished successfully

So it might be time to merge this PR or get some approvals

I'm just a bot so I'll leave it you what to do next.

//cc @pablo-garay @ko3n1g

@akoumpa akoumpa merged commit b543225 into main Oct 30, 2024
@akoumpa akoumpa deleted the akoumparouli/nemo_ux_fix_export_path branch October 30, 2024 12:55
akoumpa added a commit that referenced this pull request Oct 30, 2024
* only make optim config if model has optim and setup_optimizers is True

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* pass setup_optimizers=False in nemo_load

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* fix backwards compatibility in load_context

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* fix

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* add torch_dtype_from_mcore_config

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* fix hf model dtype & prune embedding size

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate changes: mistral

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate changes: mixtral

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate changes: nemotron

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate changes: qwen2

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate changes: startcoder

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate changes: startcoder2

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate chatglm

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* remove commented code

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* rm rename

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* rm rename

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* fix

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* fix

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: akoumpa <akoumpa@users.noreply.github.com>

---------

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
Signed-off-by: akoumpa <akoumpa@users.noreply.github.com>
Co-authored-by: akoumpa <akoumpa@users.noreply.github.com>
akoumpa added a commit that referenced this pull request Oct 30, 2024
* Add lazy init for export (#10613)

* Add lazy init for export

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: akoumpa <akoumpa@users.noreply.github.com>

---------

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
Signed-off-by: akoumpa <akoumpa@users.noreply.github.com>
Co-authored-by: akoumpa <akoumpa@users.noreply.github.com>

* NeMo-UX: fix nemo-ux export path (#11081)

* only make optim config if model has optim and setup_optimizers is True

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* pass setup_optimizers=False in nemo_load

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* fix backwards compatibility in load_context

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* fix

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* add torch_dtype_from_mcore_config

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* fix hf model dtype & prune embedding size

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate changes: mistral

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate changes: mixtral

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate changes: nemotron

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate changes: qwen2

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate changes: startcoder

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate changes: startcoder2

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate chatglm

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* remove commented code

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* rm rename

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* rm rename

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* fix

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* fix

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: akoumpa <akoumpa@users.noreply.github.com>

---------

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
Signed-off-by: akoumpa <akoumpa@users.noreply.github.com>
Co-authored-by: akoumpa <akoumpa@users.noreply.github.com>

---------

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
Signed-off-by: akoumpa <akoumpa@users.noreply.github.com>
Co-authored-by: akoumpa <akoumpa@users.noreply.github.com>
hainan-xv pushed a commit to hainan-xv/NeMo that referenced this pull request Nov 5, 2024
* only make optim config if model has optim and setup_optimizers is True

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* pass setup_optimizers=False in nemo_load

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* fix backwards compatibility in load_context

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* fix

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* add torch_dtype_from_mcore_config

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* fix hf model dtype & prune embedding size

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate changes: mistral

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate changes: mixtral

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate changes: nemotron

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate changes: qwen2

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate changes: startcoder

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate changes: startcoder2

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate chatglm

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* remove commented code

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* rm rename

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* rm rename

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* fix

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* fix

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: akoumpa <akoumpa@users.noreply.github.com>

---------

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
Signed-off-by: akoumpa <akoumpa@users.noreply.github.com>
Co-authored-by: akoumpa <akoumpa@users.noreply.github.com>
Signed-off-by: Hainan Xu <hainanx@nvidia.com>
lilyw97 pushed a commit to lilyw97/NeMo that referenced this pull request Nov 13, 2024
* only make optim config if model has optim and setup_optimizers is True

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* pass setup_optimizers=False in nemo_load

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* fix backwards compatibility in load_context

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* fix

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* add torch_dtype_from_mcore_config

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* fix hf model dtype & prune embedding size

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate changes: mistral

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate changes: mixtral

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate changes: nemotron

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate changes: qwen2

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate changes: startcoder

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate changes: startcoder2

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate chatglm

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* remove commented code

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* rm rename

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* rm rename

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* fix

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* fix

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: akoumpa <akoumpa@users.noreply.github.com>

---------

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
Signed-off-by: akoumpa <akoumpa@users.noreply.github.com>
Co-authored-by: akoumpa <akoumpa@users.noreply.github.com>
HuiyingLi pushed a commit to HuiyingLi/NeMo that referenced this pull request Nov 15, 2024
* only make optim config if model has optim and setup_optimizers is True

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* pass setup_optimizers=False in nemo_load

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* fix backwards compatibility in load_context

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* fix

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* add torch_dtype_from_mcore_config

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* fix hf model dtype & prune embedding size

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate changes: mistral

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate changes: mixtral

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate changes: nemotron

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate changes: qwen2

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate changes: startcoder

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate changes: startcoder2

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate chatglm

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* remove commented code

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* rm rename

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* rm rename

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* fix

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* fix

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: akoumpa <akoumpa@users.noreply.github.com>

---------

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
Signed-off-by: akoumpa <akoumpa@users.noreply.github.com>
Co-authored-by: akoumpa <akoumpa@users.noreply.github.com>
XuesongYang pushed a commit to paarthneekhara/NeMo that referenced this pull request Jan 18, 2025
* only make optim config if model has optim and setup_optimizers is True

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* pass setup_optimizers=False in nemo_load

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* fix backwards compatibility in load_context

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* fix

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* add torch_dtype_from_mcore_config

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* fix hf model dtype & prune embedding size

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate changes: mistral

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate changes: mixtral

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate changes: nemotron

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate changes: qwen2

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate changes: startcoder

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate changes: startcoder2

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* propagate chatglm

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* remove commented code

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* rm rename

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* rm rename

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* fix

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* fix

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: akoumpa <akoumpa@users.noreply.github.com>

---------

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
Signed-off-by: akoumpa <akoumpa@users.noreply.github.com>
Co-authored-by: akoumpa <akoumpa@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NeMo2.0 nemorun llm export ValueError: PyTorch DDP is not enabled for mcore optimizer

2 participants