Skip to content

ggml : repack block_iq4_nlx8 (AVX) #14904

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

ggerganov
Copy link
Member

@ggerganov ggerganov commented Jul 27, 2025

Repack 8x block_iq4_nl into block_iq4_nlx8 + add AVX implementation

  • Reuse the existing block_q4_0x8 GEMV/GEMM implementation (the logic is the same, just the lookup table for nibbles -> bytes is different)
  • Cleanup some UNUSED macros (not exhaustive)

TODOs:

  • Test the __AVX512F__ path after the refactoring

@github-actions github-actions bot added the ggml changes relating to the ggml tensor library for machine learning label Jul 27, 2025
@ggerganov
Copy link
Member Author

@Srihari-mcw Since you have access to AVX512, could you run this branch with an iq4_nl quantizaion and verify that the perplexity is within norm?

@Srihari-mcw
Copy link
Collaborator

Srihari-mcw commented Jul 30, 2025

@Srihari-mcw Since you have access to AVX512, could you run this branch with an iq4_nl quantizaion and verify that the perplexity is within norm?

Sure, will check and get back on the same. Thanks

@ggerganov ggerganov force-pushed the gg/repack-iq4_nl-avx2 branch from e2661ed to d1788b7 Compare July 30, 2025 12:36
@Srihari-mcw
Copy link
Collaborator

Hi @ggerganov , we tested the model for perplexity with meta llama2 7B model quantized to 'IQ4_NL' and observed the following perplexity in AVX512 Machine (AMD Ryzen 5 7600X). The perplexity seem close enough

model perplexity (Final estimate PPL) Commit id
llama 7B IQ4_NL 5.8822 +/- 0.03282 Base - 00131d6e
llama 7B IQ4_NL 5.8828 +/- 0.03283 PR Branch - d1788b72

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