Disable SSE4.2 in noavx native builds - #1438
Conversation
ggml still enables SSE4.2 on a non-cross compile even with GGML_NATIVE=OFF, so the current noavx binaries SIGILL on SSSE3-only CPUs.
a4db5b8 to
b3ddc1d
Compare
|
Thanks for putting this together, it all looks good to me. Could you please trigger a test action run on your fork (I can't do it in this repo until it's merged). To do that:
|
|
Triggered Update Binaries on the fork from this branch ( https://github.com/modelpath-dev/LLamaSharp/actions/runs/34667855880 |
windows-latest is VS 18, where ClangCL rebuilds ggml-cpu against a C17 PCH with C17 disabled, so llama.dll is never produced and artifact upload fails.
ggml-cpu fails with a C17 PCH mismatch on both windows-latest and windows-2022, so llama.dll is never produced. Also fail the job when cmake --build fails instead of hiding it behind tree.
|
Update Binaries completed successfully on the fork from this branch: https://github.com/modelpath-dev/LLamaSharp/actions/runs/34669867568 llama.cpp The first run failed on Windows ARM64 only. ClangCL + CMake PCH disagrees on C17 for ggml-cpu, so |
martindevans
left a comment
There was a problem hiding this comment.
Thanks very much for working on this! Ready to merge once the CI passes :)
|
Hi Martin, thanks again for the thorough review on this one. Walking through the noavx native builds and the fork CI runs taught me a lot about how the binary pipeline fits together. I would like to keep contributing to LLamaSharp, especially around native builds and packaging. I am currently looking for a role, so if there is ever build or maintenance work you would like a hand with, I would be glad to help. Either way, I will keep an eye on the open issues. |
Summary
noavxCPU backend still compiles with-msse4.2. ggml turnsGGML_SSE42on for a normal (non-cross) compile even whenGGML_NATIVE=OFF.lscputhere has noavx,sse4_1, orsse4_2.noavxjobs on Linux, musl, Windows, and the macOS x64 Rosetta build now pass-DGGML_SSE42=OFF. gcc/clang jobs also pin-march=x86-64so auto-vectorization cannot put SSE4 back in. MSVC only gets the CMake flag.Test plan
Adding CPU backend variant ggml-cpu: -msse4.2 GGML_SSE42.GGML_SSE42=OFF.objdumpoflibggml-cpu.so: old build containspblendvb/pinsrd(SSE4.1). New build does not.LLamaSharp.Backend.Cpupublish, Getting a Illegal instruction (core dumped) when trying to run聽#1422 should load without SIGILL. Until then the FAQ notes the self-compile path.