tlc-pack / cutlass_fpa_intb_gemm Goto Github PK
View Code? Open in Web Editor NEWA standalone GEMM kernel for fp16 activation and quantized weight, extracted from FasterTransformer
License: Apache License 2.0
A standalone GEMM kernel for fp16 activation and quantized weight, extracted from FasterTransformer
License: Apache License 2.0
Would you plan to provide any test example of this kernel in the future which will be very helpful?
I have observed that some recent SOTA work like GPTQ and AWQ have used 4/3 bit weight-only quantization, so I wonder if I can use the kernel in this repo to do 4bit weight-only quantization.
This work is awesome, and I hope to ask for more details about using. Have you tested the accuracy or are there any test cases, because I don't know if I use this correctly. Below is my wrapper for gemm_fp16_int_bias_act
. I get weird result such as nan but the torch output is correct in the same case.
void fpA_intB_gemm_forward_cuda(torch::Tensor &input,
torch::Tensor &weight,
torch::Tensor &scale,
torch::Tensor &output,
int m, int n, int k)
{
c10::cuda::CUDAGuard device_guard(input.device());
const fastertransformer::half *input_ptr = reinterpret_cast<fastertransformer::half *>(input.data_ptr());
const uint8_t *weight_ptr = reinterpret_cast<const uint8_t *>(weight.data_ptr());
const fastertransformer::half *scale_ptr = reinterpret_cast<fastertransformer::half *>(scale.data_ptr());
fastertransformer::half *output_ptr = reinterpret_cast<fastertransformer::half *>(output.data_ptr());
fastertransformer::gemm_fp16_int_bias_act(
input_ptr,
weight_ptr,
scale_ptr,
nullptr,
output_ptr,
std::nullopt,
m, n, k,
0,
nullptr,
0,
0);
}
Thank you for your excellent work.
May I ask if this project fully supports int4 weight-only quantized inference, such as AWQ's group-wise int4 quantization?
I've seen some features related to int4
but I'm not sure how to use them specifically.
Have you tested the code for compatibility in the Windows environment? Can you publish a Windows-compatible version?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.