Skip to content
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

ggml : remove bit shuffling #1305

Closed
wants to merge 20 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ggml : fix Q4_1 quantization
  • Loading branch information
ggerganov committed May 8, 2023
commit c216656990dc328915814663d55901d3df7a90bc
4 changes: 2 additions & 2 deletions ggml.c
Original file line number Diff line number Diff line change
Expand Up @@ -826,8 +826,8 @@ static void quantize_row_q4_1_reference(const float * restrict x, block_q4_1 * r
y[i].m = min;

for (int l = 0; l < qk/2; ++l) {
const float x0 = (x[0 + l] - min)*id;
const float x1 = (x[qk/2 + l] - min)*id;
const float x0 = (x[i*qk + 0 + l] - min)*id;
const float x1 = (x[i*qk + qk/2 + l] - min)*id;

const uint8_t xi0 = MIN(15, (int8_t)(x0 + 0.5f));
const uint8_t xi1 = MIN(15, (int8_t)(x1 + 0.5f));
Expand Down