Team Ai
Apppublic

KBaba7/llama.cpp

sourceHugging Faceapache-2.0updated 2y agoView on Hugging Face
0likes
quantize.cuh25 linesDownload Raw Back to ggml-cuda
1#pragma once2 3#include "common.cuh"4#include "mmq.cuh"5 6#include <cstdint>7 8#define CUDA_QUANTIZE_BLOCK_SIZE     2569#define CUDA_QUANTIZE_BLOCK_SIZE_MMQ 12810 11static_assert(MATRIX_ROW_PADDING %    CUDA_QUANTIZE_BLOCK_SIZE      == 0, "Risk of out-of-bounds access.");12static_assert(MATRIX_ROW_PADDING % (4*CUDA_QUANTIZE_BLOCK_SIZE_MMQ) == 0, "Risk of out-of-bounds access.");13 14typedef void (*quantize_cuda_t)(15    const float * x, void * vy, const int64_t kx0, const int64_t kx1, const int64_t channels, const int64_t kx0_padded,16    const ggml_type type_x, cudaStream_t stream);17 18void quantize_row_q8_1_cuda(19    const float * x, void * vy, const int64_t kx0, const int64_t kx1, const int64_t channels, const int64_t kx0_padded,20    const ggml_type type_x, cudaStream_t stream);21 22void quantize_mmq_q8_1_cuda(23    const float * x, void * vy, const int64_t kx0, const int64_t kx1, const int64_t channels, const int64_t kx0_padded,24    const ggml_type type_x, cudaStream_t stream);25