cann: support q8_0 for Ascend backend (#8805)

This commit is contained in:
wangshuai09 2024-08-01 10:39:05 +08:00 committed by GitHub
parent afbbcf3c04
commit c8a0090922
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2381,10 +2381,10 @@ static void ggml_cann_mul_mat_q8_0(ggml_backend_cann_context& ctx,
size_t input_nb[] = {input_elem_size, input_elem_size * src1->ne[0]}; size_t input_nb[] = {input_elem_size, input_elem_size * src1->ne[0]};
size_t input_stride = input_elem_size * src1->ne[0] * src1->ne[1]; size_t input_stride = input_elem_size * src1->ne[0] * src1->ne[1];
ggml_cann_pool_alloc input_alloctor(ctx.pool());
if (src1->type != GGML_TYPE_F16) { if (src1->type != GGML_TYPE_F16) {
aclTensor* acl_src1_tensor = ggml_cann_create_tensor(src1); aclTensor* acl_src1_tensor = ggml_cann_create_tensor(src1);
ggml_cann_pool_alloc input_alloctor( input_alloctor.alloc(ggml_nelements(src1) * input_elem_size);
ctx.pool(), ggml_nelements(src1) * input_elem_size);
input_buffer = input_alloctor.get(); input_buffer = input_alloctor.get();
int64_t* input_cast_ne = src1->ne; int64_t* input_cast_ne = src1->ne;