-
Notifications
You must be signed in to change notification settings - Fork 48
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
Add additional matching logic to MMGroupQuantRewriterPass #473
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.
Aside from the test failures, I think I need to see the IR we are trying to match. But this seems like it might be tricky to keep working.
@@ -313,8 +315,12 @@ def evict_kvcache_space(self): | |||
if quantization == "int4" and not compile_to == "linalg": | |||
from shark_turbine.transforms.quantization import mm_group_quant | |||
|
|||
print(param_set) |
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.
Remove
The IR this is matching looks like this:
This change basically just rewrites the parameter to the viewed type and elides the view ( This pass was already pretty specific to llama, especially since it was matching for a specific parameter name, so I figured that this should be okay for now. Maybe the view rewrite could be moved to its own pass, but this just seemed like the easiest path forward for me, and I like the idea of having fewer passes to call after exporting. |
This adds additional matching logic on
tensor.view
ops required for using MMGroupQuantRewriterPass in the llama.turbine model (used here stellaraccident/llama.turbine#2).