Skip to content

Fixes for AVXVNNI instruction set - Clang Compiler - #11027

Merged
slaren merged 4 commits into
ggml-org:masterfrom
Srihari-mcw:clang_avxvnni_branch
Dec 31, 2024
Merged

slaren merged 4 commits into
ggml-org:masterfrom
Srihari-mcw:clang_avxvnni_branch

Conversation

@Srihari-mcw

@Srihari-mcw Srihari-mcw commented Dec 31, 2024 •

Copy link
Copy Markdown
Collaborator

The PR is to fix issues with the AVX_VNNI instruction set with the clang compiler. The updates were built across compilers and was seen to be building fine post the changes

Error seen :

image (21)

The performance was tested before and after changes and were found to be similar - Tested with Linux GCC 12.3

model size params backend threads test t/s speedup Commit id
llama 7B Q4_0 3.56 GiB 6.74 B CPU 14 pp 512 52.69 ± 0.15 0.02% 2a4e792
llama 7B Q4_0 3.56 GiB 6.74 B CPU 14 pp 512 52.68 ± 0.19 7909e858
llama 7B Q4_0 3.56 GiB 6.74 B CPU 14 tg 128 19.91 ± 0.25 0.55% 2a4e792
llama 7B Q4_0 3.56 GiB 6.74 B CPU 14 tg 128 19.80 ± 0.46 7909e858

The perplexity was tested for 32 chunks and was found to be the same for Q4_0 model before and after changes - 5.4993 +- 0.13676

Flags enabled - Flags:| CPU : SSE3 = 1 | SSSE3 = 1 | AVX = 1 | AVX_VNNI = 1 | AVX2 = 1 | F16C = 1 | FMA = 1 | LLAMAFILE = 1 | OPENMP = 1 | AARCH64_REPACK = 1 |

Model - Meta LLama2 7B - https://huggingface.co/meta-llama/Llama-2-7b

@github-actions github-actions Bot added the ggml changes relating to the ggml tensor library for machine learning label Dec 31, 2024
@slaren

slaren commented Dec 31, 2024

Copy link
Copy Markdown
Member

Thanks, this also fixes AVX VNNI with MSVC, so I have enabled it for MSVC as well.

Comment thread ggml/src/ggml-cpu/ggml-cpu-aarch64.cpp Resolved
Comment thread ggml/src/ggml-cpu/ggml-cpu-quants.c Resolved
Comment thread ggml/src/ggml-cpu/llamafile/sgemm.cpp Resolved
@slaren
slaren merged commit 0827b2c into ggml-org:master Dec 31, 2024
arthw pushed a commit to arthw/llama.cpp that referenced this pull request Feb 26, 2025
…g#11027)

* Fixes for clang AVX VNNI

* enable AVX VNNI and alder lake build for MSVC

* Apply suggestions from code review

---------

Co-authored-by: slaren <[email protected]>
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
…g#11027)

* Fixes for clang AVX VNNI

* enable AVX VNNI and alder lake build for MSVC

* Apply suggestions from code review

---------

Co-authored-by: slaren <[email protected]>
ljubomirj pushed a commit to ljubomirj/llama.cpp that referenced this pull request May 6, 2026
…g#11027)

* Fixes for clang AVX VNNI

* enable AVX VNNI and alder lake build for MSVC

* Apply suggestions from code review

---------

Co-authored-by: slaren <[email protected]>
my-other-github-account pushed a commit to my-other-github-account/llama.cpp that referenced this pull request May 15, 2026
…g#11027)

* Fixes for clang AVX VNNI

* enable AVX VNNI and alder lake build for MSVC

* Apply suggestions from code review

---------

Co-authored-by: slaren <[email protected]>
AlexiAlp pushed a commit to minghaop/llama.cpp that referenced this pull request Jun 2, 2026
…g#11027)

* Fixes for clang AVX VNNI

* enable AVX VNNI and alder lake build for MSVC

* Apply suggestions from code review

---------

Co-authored-by: slaren <[email protected]>
AlexiAlp pushed a commit to minghaop/llama.cpp that referenced this pull request Jun 2, 2026
…g#11027)

* Fixes for clang AVX VNNI

* enable AVX VNNI and alder lake build for MSVC

* Apply suggestions from code review

---------

Co-authored-by: slaren <[email protected]>
fukuro-kun pushed a commit to fukuro-kun/fukuro-llama-cpp-turboquant that referenced this pull request Jul 5, 2026
…g#11027)

* Fixes for clang AVX VNNI

* enable AVX VNNI and alder lake build for MSVC

* Apply suggestions from code review

---------

Co-authored-by: slaren <[email protected]>
zommiommy pushed a commit to zommiommy/llama.cpp that referenced this pull request Aug 18, 2026
…g#11027)

* Fixes for clang AVX VNNI

* enable AVX VNNI and alder lake build for MSVC

* Apply suggestions from code review

---------

Co-authored-by: slaren <[email protected]>
frostyautumnleaf pushed a commit to frostyautumnleaf/llama.cpp that referenced this pull request Oct 5, 2026
…g#11027)

* Fixes for clang AVX VNNI

* enable AVX VNNI and alder lake build for MSVC

* Apply suggestions from code review

---------

Co-authored-by: slaren <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ggml changes relating to the ggml tensor library for machine learning

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants