forked from vllm-project/vllm
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Support for compressed-tensors
#159
Open
dbogunowicz
wants to merge
18
commits into
main
Choose a base branch
from
feature/damian/support_compression
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
39fcb11
initial commit
dbogunowicz c97fde6
ruff
dbogunowicz 7c21857
Merge branch 'main' into feature/damian/support_compression
dbogunowicz 94aaf9b
testing
dbogunowicz 6567b48
Merge remote-tracking branch 'origin/main' into feature/damian/suppor…
dbogunowicz aba6834
Merge remote-tracking branch 'origin/main' into feature/damian/suppor…
dbogunowicz eed5123
finish up
37b22ec
Merge branch 'main' into feature/damian/support_compression
dbogunowicz 3bdca69
add mapping from config to sparsity_structure
3af0404
Update vllm/config.py
dbogunowicz 59b1577
Update vllm/config.py
dbogunowicz 54d504c
Update vllm/config.py
dbogunowicz ac66cd6
michaels comments
118d82a
lets trigger GHA just for kicks
185ff9b
formatting
0c6a2d5
improve tests and refactor the code
1fda4fc
Merge branch 'main' into feature/damian/support_compression
dbogunowicz 13a1f5b
rebase
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -205,7 +205,8 @@ def _verify_sparsity(self) -> None: | |||||
"inferred from the config: " | ||||||
f"{sparsity_structure} with: {self.sparsity}") | ||||||
self.sparsity = self.sparsity or sparsity_structure | ||||||
if self.sparsity not in supported_sparsity and self.sparsity is not None: # noqa E501 | ||||||
if (self.sparsity not in supported_sparsity) and \ | ||||||
(self.sparsity is not None): | ||||||
raise ValueError( | ||||||
f"Unknown sparsity_structure: {self.sparsity}. Must " | ||||||
f"be one of {supported_sparsity}. Running the models " | ||||||
|
@@ -238,21 +239,21 @@ def _sparsity_structure_from_config( | |||||
# check for valid dtype | ||||||
if dtype not in supported_sparsity_dtypes: | ||||||
logger.warning( | ||||||
"Sparsity is only supported for float16 and bfloat16 " | ||||||
f"Sparsity is only supported for {supported_sparsity_dtypes}" | ||||||
"dtypes. Running the models without sparse kernels.") | ||||||
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 actually meant the current dtype, but supported dtypes are good too!
Suggested change
|
||||||
return None | ||||||
|
||||||
# choose the sparsity structure based on the sparsity config | ||||||
if sparsity_config["sparsity_structure"] in {"unstructured", "0:0"}: | ||||||
return SparsityStructure.sparse_w16a16 | ||||||
return SparsityStructure.sparse_w16a16.value | ||||||
|
||||||
elif sparsity_config["sparsity_structure"] == "2:4": | ||||||
return SparsityStructure.semi_structured_sparse_w16a16 | ||||||
return SparsityStructure.semi_structured_sparse_w16a16.value | ||||||
|
||||||
# if the sparsity config is not recognized, return None | ||||||
logger.warning("The valid sparsity structure cannot be inferred from " | ||||||
"the valid sparsity config. Running the models without " | ||||||
"sparse kernels.") | ||||||
"the valid sparsity config:\n{sparsity_config}" | ||||||
"\n Running the models without sparse kernels.") | ||||||
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.
Suggested change
|
||||||
return None | ||||||
|
||||||
def _verify_quantization(self) -> None: | ||||||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why remove bfloat16 here?