Skip to content

Conversation

ved1beta
Copy link
Contributor

@ved1beta ved1beta commented Apr 6, 2025

SUMMARY:
Fixed issue #1319 where Recipe.model_dump() output couldn't be used with Recipe.model_validate(). Implemented an override of the model_dump() method to ensure it produces output in the format expected by validation, enabling proper round-trip serialization using standard Pydantic methods.

TEST PLAN:
Created test cases to verify fix works with both simple and complex recipes
Confirmed Recipe.model_validate(recipe.model_dump()) succeeds with various recipe formats
Validated that recipes with multiple stages having the same group name serialize/deserialize correctly
Ensured existing YAML serialization pathways continue to work as expected

@brian-dellabetta brian-dellabetta self-requested a review April 10, 2025 14:13
Copy link
Collaborator

@brian-dellabetta brian-dellabetta left a comment

Choose a reason for hiding this comment

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

Hi @ved1beta , thanks for the contribution! We should add some unit tests to make sure the recipes you checked manually get added to our CI tests. I can do this tomorrow, or if you have them handy still please add them to tests/llmcompressor/recipe/test_recipe.py

kylesayrs
kylesayrs previously approved these changes Apr 10, 2025
Copy link
Collaborator

@kylesayrs kylesayrs left a comment

Choose a reason for hiding this comment

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

Looks good! Nice job

@dsikka dsikka added the ready When a PR is ready for review label Apr 12, 2025
@dsikka dsikka added ready When a PR is ready for review and removed ready When a PR is ready for review labels Apr 12, 2025
Copy link
Collaborator

@dsikka dsikka left a comment

Choose a reason for hiding this comment

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

Thank you for your PR!

Would you mind addressing the Quality Checks? You can install the required packages using the dev install and then running make style under the root directory.

Also, could you add the tests that you used to verify the changes? Thank you!

@ved1beta
Copy link
Contributor Author

hey @dsikka made the changes please have look : )

dsikka
dsikka previously requested changes Apr 14, 2025
Copy link
Collaborator

@dsikka dsikka left a comment

Choose a reason for hiding this comment

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

@rahul-tuli
Copy link
Collaborator

Pushed Style Fixes; + merged main!

@dsikka dsikka enabled auto-merge (squash) April 23, 2025 21:20
@dsikka dsikka merged commit 998be99 into vllm-project:main Apr 23, 2025
5 checks passed
rahul-tuli added a commit that referenced this pull request Apr 23, 2025
@rahul-tuli
Copy link
Collaborator

Unfortunately the base tests were skipped; PR will be reverted in #1378 ; re-opened rebased PR #1379

dsikka pushed a commit that referenced this pull request Apr 24, 2025
This PR reverts commit 998be99 which
was merged prematurely. The required base tests were skipped during the
original review process. When these tests eventually ran on the main
branch, they revealed a failure:


https://github.com/vllm-project/llm-compressor/actions/runs/14628792870/job/41046641641

The original PR #1328 has been reopened to address the identified issues
before resubmitting.
kylesayrs added a commit that referenced this pull request Apr 29, 2025
…#1328)

SUMMARY:
Fixed issue #1319 where Recipe.model_dump() output couldn't be used with
Recipe.model_validate(). Implemented an override of the model_dump()
method to ensure it produces output in the format expected by
validation, enabling proper round-trip serialization using standard
Pydantic methods.

TEST PLAN:
Created test cases to verify fix works with both simple and complex
recipes
Confirmed Recipe.model_validate(recipe.model_dump()) succeeds with
various recipe formats
Validated that recipes with multiple stages having the same group name
serialize/deserialize correctly
Ensured existing YAML serialization pathways continue to work as
expected

---------

Signed-off-by: Rahul Tuli <[email protected]>
Co-authored-by: Dipika Sikka <[email protected]>
Co-authored-by: Kyle Sayers <[email protected]>
Co-authored-by: Rahul Tuli <[email protected]>
kylesayrs pushed a commit that referenced this pull request Apr 29, 2025
This PR reverts commit 998be99 which
was merged prematurely. The required base tests were skipped during the
original review process. When these tests eventually ran on the main
branch, they revealed a failure:


https://github.com/vllm-project/llm-compressor/actions/runs/14628792870/job/41046641641

The original PR #1328 has been reopened to address the identified issues
before resubmitting.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready When a PR is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants