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 support for Marlin 2:4 sparsity #2102

Merged
merged 1 commit into from
Jun 25, 2024
Merged

Add support for Marlin 2:4 sparsity #2102

merged 1 commit into from
Jun 25, 2024

Conversation

danieldk
Copy link
Member

What does this PR do?

This change adds support for 2:4 sparsity when using Marlin quantization. The 2:4 kernel is used when:

  • The quantizer is marlin;
  • the quantizer checkpoint format is marlin_24.

Fixes #2098.

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@danieldk danieldk marked this pull request as ready for review June 21, 2024 13:29
@@ -19,6 +19,23 @@ def gptq_marlin_gemm(
"""
...

def gptq_marlin_24_gemm(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are we running a fork of marlin ?
Shouldn't we use the classic makefile + commit approach instead (or already made releases if possible) ?

Copy link
Member Author

Choose a reason for hiding this comment

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

These come from VLLM. We could also directly import them from VLLM if we prefer.

Narsil
Narsil previously approved these changes Jun 24, 2024
Copy link
Collaborator

@Narsil Narsil left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +217 to +221
GPTQ_MARLIN_24_MIN_THREAD_N = 128
GPTQ_MARLIN_24_MIN_THREAD_K = 128
GPTQ_MARLIN_24_MAX_PARALLEL = 64
GPTQ_MARLIN_24_SUPPORTED_NUM_BITS = [4, 8]
GPTQ_MARLIN_24_SUPPORTED_GROUP_SIZES = [-1, 128]
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is coming from marlin directly I guess ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, they come from upstream.

server/text_generation_server/layers/marlin.py Outdated Show resolved Hide resolved
This change adds support for 2:4 sparsity when using Marlin
quantization. The 2:4 kernel is used when:

* The quantizer is `marlin`;
* the quantizer checkpoint format is `marlin_24`.

Fixes #2098.
@danieldk danieldk force-pushed the feature/marlin-24 branch from 8f541bc to b06dda9 Compare June 25, 2024 09:20
@danieldk danieldk merged commit f1f98e3 into main Jun 25, 2024
8 of 9 checks passed
@danieldk danieldk deleted the feature/marlin-24 branch June 25, 2024 19:09
glegendre01 pushed a commit that referenced this pull request Jul 2, 2024
This change adds support for 2:4 sparsity when using Marlin
quantization. The 2:4 kernel is used when:

* The quantizer is `marlin`;
* the quantizer checkpoint format is `marlin_24`.

Fixes #2098.
yuanwu2017 pushed a commit to yuanwu2017/tgi-gaudi that referenced this pull request Sep 26, 2024
This change adds support for 2:4 sparsity when using Marlin
quantization. The 2:4 kernel is used when:

* The quantizer is `marlin`;
* the quantizer checkpoint format is `marlin_24`.

Fixes huggingface#2098.
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.

Sparse Marlin
2 participants