-
Notifications
You must be signed in to change notification settings - Fork 240
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
Post-training Activation Pruning algorithm #2683
Post-training Activation Pruning algorithm #2683
Conversation
f2a2cbc
to
c6c753d
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.
Thanks for the contribution!
Could you add to the description any results by accuracy and performance?
Thanks for your reply! We will add this by the beginning of ww24. |
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.
Great work with the implementation, Yujie! Also, the tests are very thorough. Mostly minor comments from my side.
nncf/experimental/torch/sparsify_activations/sparsify_activations_impl.py
Outdated
Show resolved
Hide resolved
nncf/experimental/torch/sparsify_activations/sparsify_activations_impl.py
Outdated
Show resolved
Hide resolved
nncf/experimental/torch/sparsify_activations/sparsify_activations_impl.py
Outdated
Show resolved
Hide resolved
tests/post_training/experimental/sparsify_activations/test_sparsify_activations_conformance.py
Outdated
Show resolved
Hide resolved
tests/post_training/experimental/sparsify_activations/test_sparsify_activations_conformance.py
Outdated
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2683 +/- ##
============================================
+ Coverage 47.13% 62.10% +14.96%
============================================
Files 495 486 -9
Lines 45986 46630 +644
============================================
+ Hits 21675 28959 +7284
+ Misses 24311 17671 -6640
... and 223 files with indirect coverage changes
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Model accuracy check: Llama-2-7b-hf
Mixtral-8x7B-Instruct-v0.1
Tasks: 'arc_easy', 'arc_challenge', 'boolq', "piqa", 'lambada_openai', 'winogrande', 'sciq', 'hellaswag' |
f9af328
to
61a0fc8
Compare
Remaining issues at this moment:
|
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.
Another round of review. Awaiting addition of activation sparsity test pipeline to our CI to check the conformance test results there.
nncf/experimental/torch/sparsify_activations/sparsify_activations_impl.py
Outdated
Show resolved
Hide resolved
nncf/experimental/torch/sparsify_activations/sparsify_activations_impl.py
Outdated
Show resolved
Hide resolved
@daniil-lyakhov could you please review the PyTorch backend part of the implementation, specifically |
7c81fc5
to
17792bd
Compare
@daniil-lyakhov Hi Daniil, thanks for reviewing this PR. Are there any openings that we need to change? |
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.
LGTM 👍
e1f7af2
to
63a87e8
Compare
Conformance test build (id=12) has passed. The time it takes is about half an hour. The only thing left is some documentation of the method. |
5cb146a
to
f3fcea8
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 good! I can suggest only some minor tweaks
nncf/experimental/torch/sparsify_activations/ActivationSparsity.md
Outdated
Show resolved
Hide resolved
nncf/experimental/torch/sparsify_activations/ActivationSparsity.md
Outdated
Show resolved
Hide resolved
There is a failed test but seems not caused by this PR: FAILED tests/common/graph/test_dot_file_rw.py::test_colons_are_replaced_in_written_dot_file - AssertionError: assert False
+ where False = <function cmp at 0x7f52758f80d0>(PosixPath('/tmp/pytest-of-runner/pytest-0/popen-gw0/test_colons_are_replaced_in_wr0/graph.dot'), PosixPath('/home/runner/work/nncf/nncf/tests/common/data/reference_graphs/dot_rw_reference.dot'))
+ where <function cmp at 0x7f52758f80d0> = filecmp.cmp Update: the failed test can pass after retry |
* remove ignore_scope argument sparsify_activations call in example snippet
* Add notes about experimental features and in-development of runtime kernel * Elaborate on target support only on Linear layers for LLMs
007c04a
to
5f04275
Compare
Thank you all for the reviews! Since we have resolved all the issues, I wonder whether this PR is ready to be merged. If there are any further changes needed, we would be glad to deal with them. 🙂 |
@alexsu52, please take a look. The PR should be ready for merging. |
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.
Thanks for the contribution!
Changes
Add torch backend implementation for Post-training Activation Pruning algorithm.
The current interface is
See model accuracy check at #2683 (comment)
Tests
Added unit tests at
tests/torch/experimental/sparsify_activations
Added conformance tests at
tests/post_training/experimental/sparsify_activations