Skip to content
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 24 compressor #167

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Add 24 compressor #167

wants to merge 4 commits into from

Conversation

rahul-tuli
Copy link
Member

@rahul-tuli rahul-tuli commented Sep 26, 2024

This PR adds Sparse24Compressor, for 2:4 sparse models
The code is based off #129

Depends on:

This implements Part 3 of the Design doc: https://www.notion.so/Design-Document-24-Compressor-25ac643aee604c298f2bb12a6c220861?pvs=4

Class Hierarchy:

BaseCompressor (Abstract Class)
    |
    +-- BaseSparsityCompressor (Abstract Class)
           |
           +-- Sparse24Compressor

File Structure:

compressors/
└── sparse_compressors/
    ├── __init__.py
    ├── base.py                 <-- Contains BaseSparsityCompressor
    ├── dense.py
    ├── sparse_bitmask.py
    └── sparse24.py             <-- New file for Sparse24Compressor

@rahul-tuli rahul-tuli changed the base branch from main to update-folder-structure-compressors September 26, 2024 15:42
horheynm
horheynm previously approved these changes Sep 26, 2024
Copy link
Member

@horheynm horheynm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very clean.
lgtm after tests
!!

@rahul-tuli rahul-tuli force-pushed the update-folder-structure-compressors branch 2 times, most recently from 2f69d16 to fc4b23c Compare October 2, 2024 20:56
@rahul-tuli rahul-tuli force-pushed the update-folder-structure-compressors branch from fc4b23c to dd16499 Compare October 2, 2024 21:02
Move tests

Remove unused import
@rahul-tuli rahul-tuli force-pushed the update-folder-structure-compressors branch from dd16499 to 7155e61 Compare October 2, 2024 21:06
Base automatically changed from update-folder-structure-compressors to main October 3, 2024 00:43
@mgoin mgoin dismissed horheynm’s stale review October 3, 2024 00:43

The base branch was changed.

Copy link
Member

@markurtz markurtz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall code looks simple. I'd like to reformulate the scope, though. Specifically, I'm not following why we are restricting to just 2:4 right now when we could easily expand this to handle all sparsity cases and detect whether it is 2:4 format, some type of structured pruning, and if not any then set as unstructured. cc @dsikka

Copy link
Contributor

@dsikka dsikka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

testing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants