[Transforms] Update examples for R4 and transform_block_size option#1870
[Transforms] Update examples for R4 and transform_block_size option#1870brian-dellabetta merged 5 commits intomainfrom
transform_block_size option#1870Conversation
Signed-off-by: Brian Dellabetta <bdellabe@redhat.com>
Signed-off-by: Brian Dellabetta <bdellabe@redhat.com>
Signed-off-by: Brian Dellabetta <bdellabe@redhat.com>
|
👋 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. |
Summary of ChangesHello @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 focuses on enhancing the usability and consistency of the transformation examples and underlying API. It updates the QuIP and SpinQuant examples to demonstrate new features like Highlights
Using Gemini Code AssistThe 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 by creating a comment using either
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 Limitations & Feedback Gemini Code Assist 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. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. 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
|
There was a problem hiding this comment.
Code Review
This pull request updates the SpinQuant and QuIP examples to use the transform_block_size option and adds support for R4 rotation in the SpinQuant example. The core change is the renaming of the block_size parameter to head_dim in the internal TransformScheme class to maintain compatibility with vllm, as explained in the description. The user-facing API in the modifiers correctly retains the transform_block_size parameter. The changes are consistent, and the examples are updated accordingly. I've identified a couple of areas where validation could be improved to prevent potential runtime errors.
fynnsu
left a comment
There was a problem hiding this comment.
Looks good! Added a question about comment below.
transform_block_size optiontransform_block_size option
…1883) SUMMARY: Quick follow-up to recently merged * #1870 Updates our `examples/transform` scripts to - [x] default to `transform_type="hadamard"`, which is preferred so that vllm hadacore kernel is used - [x] default to `tranform_block_size=128`, which is preferred for group-size 128 schemes like W4A16 TEST PLAN: Previously confirmed that hadacore kernel was being invoked for `transform_type="hadamard"` --------- Signed-off-by: Brian Dellabetta <bdellabe@redhat.com> Signed-off-by: Kyle Sayers <kylesayrs@gmail.com> Co-authored-by: Kyle Sayers <kylesayrs@gmail.com> Co-authored-by: Rahul Tuli <rtuli@redhat.com>
…vllm-project#1870) SUMMARY: Prerequisites: - [x] vllm-project/compressed-tensors#472 This PR updates the SpinQuant and Quip examples to include `transform_block_size` and the latest R4 feature in SpinQuant. It also reverts the `TransformScheme.block_size` changes previously introduced into CT, and updated in Pr linked above. While `block_size` is a more appropriate name, `head_dim` has already landed in vllm, and it would be too much of a pain to change. Users will rarely create their own `TransformScheme` anyway. TEST PLAN: - [x] Both examples run and the saved model can be run in vllm, output is meaningful. - [x] with prints, confirmed hadacore is used for `QuIPModifier(rotations=["v", "u"], transform_block_size=64, transform_type="hadamard")` - [x] and dense gemm is used for `QuIPModifier(rotations=["v", "u"], transform_block_size=64, transform_type="random-hadamard")` --------- Signed-off-by: Brian Dellabetta <bdellabe@redhat.com> Signed-off-by: Cassie Jeon <cajeon@redhat.com>
…llm-project#1883) SUMMARY: Quick follow-up to recently merged * vllm-project#1870 Updates our `examples/transform` scripts to - [x] default to `transform_type="hadamard"`, which is preferred so that vllm hadacore kernel is used - [x] default to `tranform_block_size=128`, which is preferred for group-size 128 schemes like W4A16 TEST PLAN: Previously confirmed that hadacore kernel was being invoked for `transform_type="hadamard"` --------- Signed-off-by: Brian Dellabetta <bdellabe@redhat.com> Signed-off-by: Kyle Sayers <kylesayrs@gmail.com> Co-authored-by: Kyle Sayers <kylesayrs@gmail.com> Co-authored-by: Rahul Tuli <rtuli@redhat.com> Signed-off-by: Cassie Jeon <cajeon@redhat.com>
SUMMARY:
Prerequisites:
TransformScheme.head_dimfor compatibility with vllm compressed-tensors#472This PR updates the SpinQuant and Quip examples to include
transform_block_sizeand the latest R4 feature in SpinQuant. It also reverts theTransformScheme.block_sizechanges previously introduced into CT, and updated in Pr linked above. Whileblock_sizeis a more appropriate name,head_dimhas already landed in vllm, and it would be too much of a pain to change. Users will rarely create their ownTransformSchemeanyway.TEST PLAN:
QuIPModifier(rotations=["v", "u"], transform_block_size=64, transform_type="hadamard")QuIPModifier(rotations=["v", "u"], transform_block_size=64, transform_type="random-hadamard")