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

Why the linear input for Layer.pack "must be of type torch.half"? #28

Open
Azure-Tang opened this issue Jun 26, 2024 · 4 comments
Open

Comments

@Azure-Tang
Copy link

It seems that if we remove assert in the Layer.pack, then we can pack an bf16 linear?

By the way, will marlin support "int4 \times bf16" as input?

@efrantar
Copy link
Member

Hi, Marlin currently does not support BF16 inputs (though in many cases you can just convert your BF16 model to FP16). These require slightly different GPU instructions as well as a slightly different dequantization process (since there are only 5 mantissa bits). This is also why Layer.pack has a corresponding assert.

@Azure-Tang
Copy link
Author

Azure-Tang commented Jun 27, 2024

hi, I notice that the core mma function for bf16 is supported by vllm's gptq marlin. It seems that a few changes can do this feature. https://github.com/vllm-project/vllm/blob/main/csrc/quantization/gptq_marlin/gptq_marlin.cu#L89

I really need this bf16 input (actually most model is by bf16 now), if it doesn't take much time can you merge that feature in the marlin repo? If not, I can do this later.

@brisker
Copy link

brisker commented Jul 26, 2024

@Azure-Tang
Is bf16 support done? Have you made a PR elsewhere?

@Azure-Tang
Copy link
Author

@Azure-Tang Is bf16 support done? Have you made a PR elsewhere?

Didnt donw yet, maybe next week?

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

No branches or pull requests

3 participants