fix: const-correctness in ggml-bitnet-mad.cpp#422
Open
redhole-org wants to merge 1 commit intomicrosoft:mainfrom
Open
fix: const-correctness in ggml-bitnet-mad.cpp#422redhole-org wants to merge 1 commit intomicrosoft:mainfrom
redhole-org wants to merge 1 commit intomicrosoft:mainfrom
Conversation
`y` is declared as `const int8_t *` (line 794) but `y_col` on line 811 drops the const qualifier by assigning to `int8_t *`. This is a const-correctness violation that compiles as a hard error on Clang with strict settings (e.g. ClangCL on Windows). Additionally, the llama.cpp submodule has missing `#include <chrono>` in `common/log.cpp` and `common/common.cpp` — both use `std::chrono::system_clock` but rely on transitive includes that only work on GCC/Apple Clang, not ClangCL. That fix should be applied to the llama.cpp submodule (Eddie-Wang1120/llama.cpp branch merge-dev).
|
Thanks, it helps but we need to update some more files with #include as mentioned here: #334 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
yis declared asconst int8_t *(line 794) buty_colon line 811 assigns toint8_t *, dropping the const qualifier-T ClangCL)Fix
Changed
int8_t * y_col = y + col * by;→const int8_t * y_col = y + col * by;Note: llama.cpp submodule also has issues
The
3rdparty/llama.cppsubmodule (Eddie-Wang1120/llama.cppbranchmerge-dev) has missing#include <chrono>in:common/log.cpp(line 28 usesstd::chrono::system_clock)common/common.cpp(line 445 usesstd::chrono::system_clock)Both rely on transitive includes that work on GCC and Apple Clang but fail on ClangCL (Windows). That fix should be applied upstream in the llama.cpp fork.
Test plan