Skip to content

Return empty sparsity config if targets and ignores are empty#1115

Merged
dsikka merged 2 commits intomainfrom
no-sparsity-config-if-targets-empty
Jan 29, 2025
Merged

Return empty sparsity config if targets and ignores are empty#1115
dsikka merged 2 commits intomainfrom
no-sparsity-config-if-targets-empty

Conversation

@rahul-tuli
Copy link
Copy Markdown
Collaborator

@rahul-tuli rahul-tuli commented Jan 29, 2025

This PR fixes an issue where a sparsity configuration could end up being empty under certain conditions. Specifically, if the global sparsity is greater than 0.05, but no individual layer has a sparsity greater than 0.5, we end up with an empty sparsity config.

To address this, we now ensure that an empty sparsity config is not added in such cases


Signed-off-by: Rahul Tuli <rahul@neuralmagic.com>
@github-actions
Copy link
Copy Markdown

👋 Hi! Thank you for contributing to llm-compressor. Please add the ready label when the PR is ready for review.

Note: This is required to complete the testing suite, please only add the label once the PR is code complete and local testing has been performed.

Copy link
Copy Markdown
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.

👍

@horheynm
Copy link
Copy Markdown

Would making a test for this .from_pretrained func take a while?

@dsikka dsikka added the ready When a PR is ready for review label Jan 29, 2025
@dsikka dsikka merged commit 8de50a2 into main Jan 29, 2025
@dsikka dsikka deleted the no-sparsity-config-if-targets-empty branch January 29, 2025 20:46
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.

4 participants