Skip to content

awq -- hotfix to missing kwargs #1395

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 28, 2025
Merged

awq -- hotfix to missing kwargs #1395

merged 1 commit into from
Apr 28, 2025

Conversation

brian-dellabetta
Copy link
Collaborator

@brian-dellabetta brian-dellabetta commented Apr 28, 2025

SUMMARY:
This PR resolves the issues surrounding an Optional parameter passed into a torch module's .forward method during AWQ. Previous attempts to resolve in #1384 also added kwargs for parameters passed in positionally later on. This will make the addition to kwargs more strict, only if the annotation indicates if it is an optional field.

This hotfix will fail if optional fields are passed in positionally, if typing annotation is a: int | None instead of a: typing.Optional[int], or if there is no typehint at all and the field is not provided. It will be addressed with a more general solution soon, see #1385

TEST PLAN:
New test was run with python 3.9 and passed -- https://github.com/neuralmagic/llm-compressor-testing/actions/runs/14713323963/job/41291028422

Copy link

👋 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.

@brian-dellabetta brian-dellabetta changed the title awq -- more general solution to missing kwargs awq -- hotfix to missing kwargs Apr 28, 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.

Looking forward to #1385

kylesayrs
kylesayrs previously approved these changes Apr 28, 2025
@brian-dellabetta brian-dellabetta added the ready When a PR is ready for review label Apr 28, 2025
@dsikka dsikka enabled auto-merge (squash) April 28, 2025 17:21
@dsikka dsikka merged commit ef175d7 into main Apr 28, 2025
17 of 18 checks passed
@dsikka dsikka deleted the bdellabe/awq-kwargs-bugfix branch April 28, 2025 18:03
kylesayrs pushed a commit that referenced this pull request Apr 29, 2025
SUMMARY:
This PR resolves the issues surrounding an Optional parameter passed
into a torch module's .forward method during AWQ. Previous attempts to
resolve in #1384 also added kwargs for parameters passed in positionally
later on. This will make the addition to kwargs more strict, only if the
annotation indicates if it is an optional field.

This hotfix will fail if optional fields are passed in positionally, if
typing annotation is `a: int | None` instead of `a:
typing.Optional[int]`, or if there is no typehint at all and the field
is not provided. It will be addressed with a more general solution soon,
see #1385


TEST PLAN:
New test was run with python 3.9 and passed --
https://github.com/neuralmagic/llm-compressor-testing/actions/runs/14713323963/job/41291028422

Signed-off-by: Brian Dellabetta <[email protected]>
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.

3 participants