8000 Fix MacOS Sonoma model quantization by TortoiseHam · Pull Request #4052 · ggml-org/llama.cpp · GitHub
[go: up one dir, main page]

Skip to content

Fix MacOS Sonoma model quantization #4052

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

Merged
merged 7 commits into from
Nov 14, 2023
Merged
Changes from 1 commit
Commits
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
Update ggml-quants.c
  • Loading branch information
TortoiseHam authored Nov 13, 2023
commit 287bc685738ff415d872823103a61cfd56cdc3ef
12 changes: 6 additions & 6 deletions ggml-quants.c
Original file line number Diff line number Diff line change
Expand Up @@ -1273,12 +1273,12 @@ static float make_qkx2_quants(int n, int nmax, const float * restrict x, const f
float max = x[0];
float sum_w = weights[0];
float sum_x = sum_w * x[0];
+#if defined(__APPLE__) && defined(__clang_major__) && __clang_major__ >= 15
+ // use 'volatile' to prevent unroll and work around a bug in Apple clang 15.x.x
+ for (volatile int i = 1; i < n; ++i) {
+#else
for (int i = 1; i < n; ++i) {
+#endif
#if defined(__APPLE__) && defined(__clang_major__) && __clang_major__ >= 15
// use 'volatile' to prevent unroll and work around a bug in Apple clang 15.x.x with -O3 flag
for (volatile int i = 1; i < n; ++i) {
#else
for (int i = 1; i < n; ++i) {
#endif
if (x[i] < min) min = x[i];
if (x[i] > max) max = x[i];
float w = weights[i];
Expand Down
0