Skip to content

Add convert_llama3_config_to_decilm_config + unit test #465

Merged
danielkorzekwa merged 30 commits intofeature/compressfrom
dkorzekwa/llama3_to_decilm_convertion
Oct 29, 2025
Merged

Add convert_llama3_config_to_decilm_config + unit test #465
danielkorzekwa merged 30 commits intofeature/compressfrom
dkorzekwa/llama3_to_decilm_convertion

Conversation

@danielkorzekwa
Copy link
Contributor

What does this PR do?

  • Add a converter to convert a llama3 model to decilm format
  • Add an integration test

Additional Information

First review/merge #464 and merge it back to this feature branch.

using MIP-based NAS search algorithm.

Signed-off-by: Daniel Korzekwa <dkorzekwa@nvidia.com>
Signed-off-by: Daniel Korzekwa <dkorzekwa@nvidia.com>
Signed-off-by: Daniel Korzekwa <dkorzekwa@nvidia.com>
Signed-off-by: Daniel Korzekwa <dkorzekwa@nvidia.com>
Signed-off-by: Daniel Korzekwa <dkorzekwa@nvidia.com>
Signed-off-by: Daniel Korzekwa <dkorzekwa@nvidia.com>
Signed-off-by: Daniel Korzekwa <dkorzekwa@nvidia.com>
@danielkorzekwa danielkorzekwa requested a review from a team as a code owner October 27, 2025 11:48
@danielkorzekwa danielkorzekwa requested review from kevalmorabia97 and realAsma and removed request for a team October 27, 2025 11:48
@copy-pr-bot
Copy link

copy-pr-bot bot commented Oct 27, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@codecov
Copy link

codecov bot commented Oct 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.40%. Comparing base (ad1d18e) to head (ae61644).
⚠️ Report is 1 commits behind head on feature/compress.

Additional details and impacted files
@@                Coverage Diff                @@
##           feature/compress     #465   +/-   ##
=================================================
  Coverage             73.40%   73.40%           
=================================================
  Files                   180      180           
  Lines                 18127    18127           
=================================================
  Hits                  13306    13306           
  Misses                 4821     4821           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kevalmorabia97 kevalmorabia97 requested review from ChenhanYu and removed request for realAsma October 27, 2025 12:11
return Path(request.config.rootpath)


def test_convert_llama3_config_to_decilm_config(project_root_path: Path, tmp_path: Path):
Copy link
Collaborator

@kevalmorabia97 kevalmorabia97 Oct 27, 2025

Choose a reason for hiding this comment

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

Can we extend this and take a dummy input (available via model.dummy_inputs) and run forward pass on llama model (output1 = model(**model.dummy_inputs)) and converted DeciLM model and assert they are same / almost same (torch.allclose)? This will be a more robuts check that conversion is correct

Copy link
Collaborator

@kevalmorabia97 kevalmorabia97 Oct 27, 2025

Choose a reason for hiding this comment

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

We have a util function to do this. from _test_utils.torch.transformers_models import tf_output_tester

Copy link
Contributor Author

@danielkorzekwa danielkorzekwa Oct 27, 2025

Choose a reason for hiding this comment

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

regarding validating on dummy input (this is planned in the internal nvidia repo, let's migrate it later), creating an issue to migrate it. issues/14

Signed-off-by: Daniel Korzekwa <dkorzekwa@nvidia.com>
Signed-off-by: Daniel Korzekwa <dkorzekwa@nvidia.com>
Signed-off-by: Daniel Korzekwa <dkorzekwa@nvidia.com>
…ation.

Signed-off-by: Daniel Korzekwa <dkorzekwa@nvidia.com>
Signed-off-by: Daniel Korzekwa <dkorzekwa@nvidia.com>
…ress module.

Signed-off-by: Daniel Korzekwa <dkorzekwa@nvidia.com>
@danielkorzekwa danielkorzekwa requested review from a team as code owners October 27, 2025 16:42
danielkorzekwa and others added 4 commits October 27, 2025 18:43
…ntal/ folder to not be run by CICD yet.

Signed-off-by: Daniel Korzekwa <dkorzekwa@nvidia.com>
Signed-off-by: Keval Morabia <28916987+kevalmorabia97@users.noreply.github.com>
…tmp_path.

Signed-off-by: Daniel Korzekwa <dkorzekwa@nvidia.com>
Signed-off-by: Daniel Korzekwa <dkorzekwa@nvidia.com>
Signed-off-by: Daniel Korzekwa <dkorzekwa@nvidia.com>
Signed-off-by: Daniel Korzekwa <dkorzekwa@nvidia.com>
Signed-off-by: Daniel Korzekwa <dkorzekwa@nvidia.com>
Signed-off-by: Daniel Korzekwa <dkorzekwa@nvidia.com>
Signed-off-by: Daniel Korzekwa <dkorzekwa@nvidia.com>
Signed-off-by: Daniel Korzekwa <dkorzekwa@nvidia.com>
…rtion

Signed-off-by: Daniel Korzekwa <dkorzekwa@nvidia.com>
Signed-off-by: Daniel Korzekwa <dkorzekwa@nvidia.com>
Comment on lines +29 to +31
@pytest.fixture
def project_root_path(request: pytest.FixtureRequest) -> Path:
return Path(request.config.rootpath)
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can define this in tests/experimental/torch/_compress/conftest.py so it can be reused in both tests

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Signed-off-by: Daniel Korzekwa <dkorzekwa@nvidia.com>
Signed-off-by: Daniel Korzekwa <dkorzekwa@nvidia.com>
@danielkorzekwa danielkorzekwa merged commit cef3655 into feature/compress Oct 29, 2025
21 checks passed
@danielkorzekwa danielkorzekwa deleted the dkorzekwa/llama3_to_decilm_convertion branch October 29, 2025 16:47
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.

2 participants