mirror of
https://github.com/opencv/opencv.git
synced 2026-12-05 22:45:01 -06:00
dnn: optimize int4 LLM decode models and support Gemma-3 quantized models (#30258)
MatMulNBits kernel. The op was compiling at the SSE3 baseline, so 128 bits on a 512-bit machine. It now has dispatched SIMD kernels (AVX2, AVX-512, NEON) that unpack the int4 weights straight into the dot product instead of dequantising a whole column into a buffer first, and the parallel stripes follow onnxruntime's 16-column policy rather than issuing 269k dispatches per token. Layer_MatMulNBits in perf_layer.cpp covers M=1/16/128 for 4-bit, 4-bit with zero points and 8-bit.
This commit is contained in:
committed by
GitHub
parent
dbe66b4214
commit
14790c2faa
@@ -230,6 +230,7 @@ void initializeLayerFactory()
|
||||
CV_DNN_REGISTER_LAYER_CLASS(Reciprocal, ReciprocalLayer);
|
||||
CV_DNN_REGISTER_LAYER_CLASS(Gather, GatherLayer);
|
||||
CV_DNN_REGISTER_LAYER_CLASS(Gather2, Gather2Layer);
|
||||
CV_DNN_REGISTER_LAYER_CLASS(GatherBlockQuantized, GatherBlockQuantizedLayer);
|
||||
CV_DNN_REGISTER_LAYER_CLASS(GatherElements, GatherElementsLayer);
|
||||
CV_DNN_REGISTER_LAYER_CLASS(LayerNormalization, LayerNormLayer);
|
||||
CV_DNN_REGISTER_LAYER_CLASS(RMSNormalization, RMSNormLayer);
|
||||
|
||||
Reference in New Issue
Block a user