Skip to content

Commit

Permalink
Fix f16 cpuid check
Browse files Browse the repository at this point in the history
Fixes #413
  • Loading branch information
jart committed May 21, 2024
1 parent 938cf72 commit 87d4ce1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion llamafile/tinyblas_cpu_mixmul.inc
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class MixMul {
tinyBLAS<NCB | NCC, 16, __m512, __m512, ggml_fp16_t, ggml_fp16_t, TC>,
ggml_fp16_t, ggml_fp16_t, TC>();
#elif (defined(__AVX__) || defined(__AVX2__)) && defined(__F16C__)
if (X86_HAVE(F16C)) {
if (X86_CHECK(F16C)) {
return mixmat<8, 1,
tinyBLAS<NCB | NCC, 8, __m256, __m256, ggml_fp16_t, ggml_fp16_t, TC>,
ggml_fp16_t, ggml_fp16_t, TC>();
Expand Down
4 changes: 2 additions & 2 deletions llamafile/tinyblas_cpu_sgemm.inc
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ bool llamafile_sgemm_impl(long m, long n, long k, const void *A, long lda, const
tb.matmul(m, n, task);
return true;
#elif (defined(__AVX__) || defined(__AVX2__)) && defined(__F16C__)
if (X86_HAVE(F16C)) {
if (X86_CHECK(F16C)) {
if (k % 8)
return NOT_SUPPORTED;
if (Btype == GGML_TYPE_F32 && n < 2) {
Expand Down Expand Up @@ -316,7 +316,7 @@ bool llamafile_sgemm(long m, long n, long k, const void *A, long lda, const void
assert(ith < nth);

#if defined(__x86_64__) && QK_K == 256
if (X86_HAVE(AVX2) && X86_HAVE(FMA)) {
if (X86_CHECK(AVX2) && X86_CHECK(FMA)) {
if (Btype == GGML_TYPE_Q8_K && Ctype == GGML_TYPE_F32) {
if (iqk_mul_mat(m, n, k * QK_K, Atype, A, B, (float *)C, ldc, ith, nth)) {
return true;
Expand Down

0 comments on commit 87d4ce1

Please sign in to comment.