Skip to content

Fix const-correctness error in ggml_vec_dot_i2_i8_s_Nx1#451

Open
Jah-yee wants to merge 3 commits intomicrosoft:mainfrom
Jah-yee:fix/const-correctness-y-col
Open

Fix const-correctness error in ggml_vec_dot_i2_i8_s_Nx1#451
Jah-yee wants to merge 3 commits intomicrosoft:mainfrom
Jah-yee:fix/const-correctness-y-col

Conversation

@Jah-yee
Copy link

@Jah-yee Jah-yee commented Mar 13, 2026

Summary

Line 811 in src/ggml-bitnet-mad.cpp initializes int8_t * y_col from a const pointer y, causing compilation error on Apple Clang:

error: cannot initialize a variable of type 'int8_t *' (aka 'signed char *') with an rvalue of type 'const int8_t *' (aka 'const signed char *')

Fix

Changed int8_t * y_col to const int8_t * y_col to match the const-correct usage pattern in the function (line 906 already uses const int8_t *).

This fixes compilation on macOS with Apple Clang.

Jah-yee and others added 3 commits March 13, 2026 15:44
In setup_env.py (line 107) and utils/e2e_benchmark.py (line 23), the
sys.exit(1) was at the same indentation level as 'try', causing it to
run unconditionally after subprocess completes - even when the command
succeeds. This moves sys.exit(1) inside the except block where it
belongs.

Fixes: microsoft#447
Line 811 initializes 'int8_t * y_col' from const pointer 'y', causing
compilation error on Apple Clang: 'cannot initialize a variable of type
int8_t * with an rvalue of type const int8_t *'.

Changed to 'const int8_t * y_col' to match the const-correct usage pattern
in the function (line 906 already uses const int8_t *).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant