Skip to content

Commit

Permalink
feat: fallback implementation for matmulQ40vQ80.
Browse files Browse the repository at this point in the history
  • Loading branch information
b4rtaz committed Jul 28, 2024
1 parent 9a729c9 commit 755cdf2
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/funcs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,18 @@ void matmulQ40vQ80(const MatmulThreadInfo* a) {
a->output[d] = hsum_float_8(acc);
}
#else
printf("matmulQ40vQ80 - not implemented\n");
exit(EXIT_FAILURE);
float group[QK40];
for (unsigned int d = a->ds; d < a->de; d++) {
float sum = 0.0;
for (unsigned int j = 0; j < n; j++) {
dequantizeQ40Row(&w[d * n + j], group, QK40);
float iD = convertF16ToF32(input[j].d);
for (unsigned int z = 0; z < QK40; z++) {
sum += group[z] * iD * (float)input[j].qs[z];
}
}
a->output[d] = sum;
}
#endif
}

Expand Down

0 comments on commit 755cdf2

Please sign in to comment.