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

Bf16 support for tinychat 2.0 on GEMV and GEMM #255

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

Conversation

jason-huang03
Copy link
Collaborator

This PR adds bf16 support for GEMV and GEMM operation under awq/kernels/csrc/quantization_new directory. BF16 is crucial for serving some model like Qwen2.5 72B, which would encounter NaN problem using fp16 even with original model.

The main point of this PR is:

  1. Fast int4x8 to bf16x8 dequantization.
  2. Usage of fp32 accumulator for bf16 mma, rather than fp16 accumulator for fp16 mma.
  3. Dispatching logic.

@ys-2020
Copy link
Contributor

ys-2020 commented Jan 31, 2025

Hi @jason-huang03 . Thank you for the great work! I will approve all the changes till now.

Do we have any modification for the front-ends in accordance with the bf16 support. I guess it would be better to merge them to the codebase within the same PR. 😊

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.

2 participants