Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Compile error for ggml_gemv_q4_K_8x8_q8_K on Intel x86_64 MacOS (AVX2) #14372

Open
@LostRuins

Description

@LostRuins

Git commit

HEAD

Operating systems

Mac

GGML backends

CPU

Problem description & steps to reproduce

I'm posting this on behalf of @FrankDMartinez

There seems to be an issue compiling one single AVX2 branch of a single function on x86_64 intel macs.

Apple clang version 14.0.3 (clang-1403.0.22.14.1)
Target: x86_64-apple-darwin24.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Error is inside ggml_gemv_q4_K_8x8_q8_K

fatal error: error in backend: Cannot select: 0x7fa6c4096f48: v8f16,ch = load<(load (s128) from %ir.64, align 1, !tbaa !6)> 0x7fa6c1a2b198, 0x7fa6c4101908, undef:i64
  0x7fa6c4101908: i64 = add nuw 0x7fa6c28f79c0, Constant:i64<16>
    0x7fa6c28f79c0: i64 = add 0x7fa6c28f78f0, 0x7fa6c2924b70
      0x7fa6c28f78f0: i64,ch = CopyFromReg 0x7fa6c1a2b198, Register:i64 %20
        0x7fa6c28f71a0: i64 = Register %20
      0x7fa6c2924b70: i64 = shl 0x7fa6c28bb488, Constant:i8<7>
        0x7fa6c28bb488: i64 = X86ISD::MUL_IMM 0x7fa6c28f7680, Constant:i64<9>
          0x7fa6c28f7680: i64,ch = CopyFromReg 0x7fa6c1a2b198, Register:i64 %26
            0x7fa6c41064f8: i64 = Register %26
          0x7fa6c28bae70: i64 = Constant<9>
        0x7fa6c4094c08: i8 = Constant<7>
    0x7fa6c28f7750: i64 = Constant<16>
  0x7fa6c4105e10: i64 = undef
In function: ggml_gemv_q4_K_8x8_q8_K
clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)
Apple clang version 14.0.3 (clang-1403.0.22.14.1)
Target: x86_64-apple-darwin24.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
clang: note: diagnostic msg:
********************

This can be fixed by disabling that branch by changing one line

#if defined(__AVX2__)

to

#if 0

whereupon compilation succeeds.

I cannot tell exactly which SIMD instruction is the incompatible one, it's strange that it's only causing an issue with this single function. All other avx2 branches apparently work fine. I do not have an Intel macbook.

ref: LostRuins#1620

@FrankDMartinez do provide additional information and system specs, thanks!

First Bad Commit

No response

Compile command

as above

Relevant log output

as above

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions