-
Notifications
You must be signed in to change notification settings - Fork 400
[WIP] Apply SuperBlock to Llama #1047
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?
Changes from 5 commits
8b52500
6f0d04b
4237c0a
0a9bb8a
252402b
7dad328
b605649
7f7bd85
d6ed541
f26658f
a7ebb1e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -120,7 +120,7 @@ def mlp_only(mod, name): | |
|
|
||
|
|
||
| def superblock_only(mod, name): | ||
| return isinstance(mod, SupermaskLinear) and "mlp" in name | ||
| return isinstance(mod, SupermaskLinear)# and "mlp" in name | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mostafaelhoushi Should this be changed to
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmmm...
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think I need to do some more refactoring:
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I think I read your changes wrong, I was assuming you created a SupermaskReplacementClass to combine SupermaskLinear, SupermaskConv, but I still you're still using those under the hood. I think this should be fine actually. |
||
|
|
||
|
|
||
| def mlp_only_with_args( | ||
|
|
@@ -138,7 +138,7 @@ def mlp_only_with_args( | |
| ### Custom sparsification utils | ||
| def apply_sparsity(model): | ||
| for name, module in model.named_modules(): | ||
| if isinstance(module, SupermaskLinear) and "mlp" in name: | ||
| if isinstance(module, SupermaskLinear):# and "mlp" in name: # TODO: add option in another function for "mlp" in name | ||
| module.sparsify_offline() | ||
|
|
||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
should be
torchao/prototype/sparsity? #1013There 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.
I think this is because this PR forked from an old commit that had superblock in
torchao/sparsity/prototype.When finalizing the PR we can rebase on top of main and change the path of the directory.