-
Notifications
You must be signed in to change notification settings - Fork 157
Drop unnecessary torch warnings, allow numpy v2 support #1595
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @brian-dellabetta, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request primarily focuses on modernizing the project's dependency stack by aligning with newer versions of torch
and numpy
, and removing outdated compatibility code. Additionally, it introduces a significant new feature: a TransformModifier
that enables applying advanced model transformations, enhancing the project's capabilities in model optimization.
Highlights
- Dependency Updates: I've updated the project's core dependencies in
setup.py
. Thenumpy
dependency now allows for version 2.0 and above by removing the upper bound, and thetorch
dependency has been bumped to requiretorch>=2.7.0
, effectively dropping support fortorch
v1. - Removal of Legacy Torch Compatibility: I've removed the
src/llmcompressor/pytorch/__init__.py
file entirely. This file contained logic for handlingtorch
v1.x versions and warnings related totorch.compile
ontorch
v2.x, which are no longer necessary with the updatedtorch
dependency requirement. - Introduction of Transform Modifier: I've added a new
TransformModifier
undersrc/llmcompressor/modifiers/transform/
. This new modifier introduces the capability to apply model transformations, such as QUIP (Quantization-aware Unit-wise Input Preprocessing) and SpinQuant, to models. This includes new template configurations for these transforms and an example script demonstrating its usage with a Llama-3 model.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
c3ce42b
to
ae3915b
Compare
👋 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. |
ae3915b
to
6afe1fa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request drops support for PyTorch v1 and enables NumPy v2. It also introduces a new TransformModifier
, complete with templates, an example, and tests. My review focuses on improving the new additions. The TransformModifier
implementation has some hardcoded values that should be generalized. The new example and test files have some device-handling issues (hardcoded "cuda") that could be made more robust. I've also identified a likely typo in one of the new transform templates. Addressing these points will improve the quality and reusability of the new code.
Signed-off-by: Brian Dellabetta <[email protected]>
9138e5f
to
4eb30bd
Compare
Signed-off-by: Brian Dellabetta <[email protected]>
4eb30bd
to
88d4bb3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the numpy restriction was related to some random tensorboard conflict
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Thanks for cleaning this up : )
SUMMARY:
Drop torch extraneous warnings, including warning about use of torch.compile on torch v2. Allow numpy v2 as a dependency (unclear why this was previously not allowed)
TEST PLAN:
no net new src code