-
Notifications
You must be signed in to change notification settings - Fork 264
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feat] dense to sst implementation (#1034)
* [Feat] dense to sst implementation 1. Implementation of dense_to_sst function. 2. calculating the threshold for both the cases of top-k-element and top-k-percentage (fraction) 3. assertions to verify that the top_k_elements is smaller than the numel along the same dim 4. top_k_percent to top-k conversion 5. When calculating SST, now the real part of the complex dense_freq is used instead of the magnitudes. * [Feat, Tests] transform method addition, handling of top_k_element None case 1. Addition of a transform method 2. Adds code to handle the dim=None case for top_k_element * [Feat, Refactor] Reorganizations, new assertions and fixes. 1. XOR for validation that both of topk percent and element are not set, or both simultaneously unset. One and only one is set. 3. Distills topk and percent both to topk using unified helper function . 5. Adds a scatter topk values function to scatter values for SST and in future DST. 6. Validation for percentage range, and ensures k is never 0. 7. Uses config validation, adds config validation for top_k_element > 0 if not None.
- Loading branch information
Showing
3 changed files
with
324 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.