forked from ggml-org/llama.cpp
-
Notifications
You must be signed in to change notification settings - Fork 18
QVAC-8561: Merge DL and other progress from 6469 #69
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
Closed
jesusmb1995
wants to merge
17
commits into
tetherto:temp-latest
from
jesusmb1995:jmb/sync_progress_from_6469
Closed
QVAC-8561: Merge DL and other progress from 6469 #69
jesusmb1995
wants to merge
17
commits into
tetherto:temp-latest
from
jesusmb1995:jmb/sync_progress_from_6469
Conversation
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
jesusmb1995
commented
Nov 27, 2025
- default_dl_search
- log
- force_SHARD_LIBSON
- adreno_logic
- optimizedCpuEntries
- ** backend_selection**
- disable_ci_test_for_cmake
- disable_flaky_shift_disabled_short_prompt
- disable_tests_failing_repositories
- ** supress_test_sanitizer**
- fix_flake8_linter
- Merge pull request QVAC-7519: Dynamic loading of backends #52 from jesusmb1995/jmb/build_dl15
- fix_absolute_install
- Merge pull request QVAC-7519: Fix dynamic libs path with vcpkg install (issue during cached CI) #57 from jesusmb1995/jmb/build_dl18
- fix_absolute_install
- remove_cache
- Merge pull request QVAC-7519: Fix dynamic libs path with vcpkg install #59 from jesusmb1995/jmb/build_dl20
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 87edff8..559bda344 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -291,6 +291,15 @@ jobs: - name: Test id: cmake_test + env: + # AddressSanitizer options + ASAN_OPTIONS: "verbosity=1:abort_on_error=1:print_stats=1:check_initialization_order=1:strict_init_order=1:detect_stack_use_after_return=1:print_summary=1:print_scariness=1:print_legend=1" + # ThreadSanitizer options + TSAN_OPTIONS: "verbosity=1:abort_on_error=1:print_stats=1:print_summary=1:print_legend=1" + # UndefinedBehaviorSanitizer options + UBSAN_OPTIONS: "verbosity=1:abort_on_error=1:print_stacktrace=1:print_summary=1" + # Common options for all sanitizers + MSAN_OPTIONS: "verbosity=1:abort_on_error=1:print_stats=1" run: | cd build ctest -L main --verbose --timeout 900 @@ -921,6 +930,15 @@ jobs: - name: Test id: cmake_test if: ${{ matrix.arch == 'x64' }} + env: + # AddressSanitizer options + ASAN_OPTIONS: "verbosity=1:abort_on_error=1:print_stats=1:check_initialization_order=1:strict_init_order=1:detect_stack_use_after_return=1:print_summary=1:print_scariness=1:print_legend=1" + # ThreadSanitizer options + TSAN_OPTIONS: "verbosity=1:abort_on_error=1:print_stats=1:print_summary=1:print_legend=1" + # UndefinedBehaviorSanitizer options + UBSAN_OPTIONS: "verbosity=1:abort_on_error=1:print_stacktrace=1:print_summary=1" + # Common options for all sanitizers + MSAN_OPTIONS: "verbosity=1:abort_on_error=1:print_stats=1" run: | cd build ctest -L main -C Release --verbose --timeout 900 diff --git a/tests/test-gguf.cpp b/tests/test-gguf.cpp index 3f0c312..1c852934c 100644 --- a/tests/test-gguf.cpp +++ b/tests/test-gguf.cpp @@ -101,6 +101,24 @@ static bool expect_context_not_null(const enum handcrafted_file_type hft) { typedef std::pair<enum ggml_type, std::array<int64_t, GGML_MAX_DIMS>> tensor_config_t; +// Helper function to safely cast to gguf_type, suppressing sanitizer warnings for intentional invalid values +// Portable implementation for disabling sanitizer attributes, depending on compiler +#if defined(__clang__) || defined(__GNUC__) +static inline enum gguf_type __attribute__((no_sanitize("undefined"))) +safe_cast_to_gguf_type(int value) { + return static_cast<enum gguf_type>(value); +} +#elif defined(_MSC_VER) +// MSVC does not support __attribute__; just define without it +static inline enum gguf_type safe_cast_to_gguf_type(int value) { + return static_cast<enum gguf_type>(value); +} +#else +static inline enum gguf_type safe_cast_to_gguf_type(int value) { + return static_cast<enum gguf_type>(value); +} +#endif + static std::vector<tensor_config_t> get_tensor_configs(std::mt19937 & rng) { std::vector<tensor_config_t> tensor_configs; tensor_configs.reserve(100); @@ -140,7 +158,9 @@ static std::vector<std::pair<enum gguf_type, enum gguf_type>> get_kv_types(std:: continue; } - kv_types.push_back(std::make_pair(type, gguf_type(-1))); + // Intentionally create invalid enum value for testing error handling + // Suppress sanitizer warning as this is intentional undefined behavior for testing + kv_types.push_back(std::make_pair(type, safe_cast_to_gguf_type(-1))); } std::shuffle(kv_types.begin(), kv_types.end(), rng); @@ -232,8 +252,10 @@ static FILE * get_handcrafted_file(const unsigned int seed, const enum handcraft } for (int i = 0; i < int(kv_types.size()); ++i) { - const enum gguf_type type = gguf_type(hft == HANDCRAFTED_KV_BAD_TYPE ? GGUF_TYPE_COUNT : kv_types[i].first); - const enum gguf_type type_arr = gguf_type(hft == HANDCRAFTED_KV_BAD_TYPE ? GGUF_TYPE_COUNT : kv_types[i].second); + // Intentionally create invalid enum values for testing error handling + // Suppress sanitizer warning as this is intentional undefined behavior for testing + const enum gguf_type type = safe_cast_to_gguf_type(hft == HANDCRAFTED_KV_BAD_TYPE ? GGUF_TYPE_COUNT : kv_types[i].first); + const enum gguf_type type_arr = safe_cast_to_gguf_type(hft == HANDCRAFTED_KV_BAD_TYPE ? GGUF_TYPE_COUNT : kv_types[i].second); const std::string key = "my_key_" + std::to_string((hft == HANDCRAFTED_KV_DUPLICATE_KEY ? i/2 : i)); @@ -463,8 +485,9 @@ static bool handcrafted_check_kv(const gguf_context * gguf_ctx, const unsigned i bool ok = true; for (int i = 0; i < int(kv_types.size()); ++i) { - const enum gguf_type type = gguf_type(kv_types[i].first); - const enum gguf_type type_arr = gguf_type(kv_types[i].second); + // Suppress sanitizer warning for intentional invalid enum values in test data + const enum gguf_type type = safe_cast_to_gguf_type(kv_types[i].first); + const enum gguf_type type_arr = safe_cast_to_gguf_type(kv_types[i].second); const std::string key = "my_key_" + std::to_string(i);
QVAC-7519: Dynamic loading of backends
QVAC-7519: Fix dynamic libs path with vcpkg install (issue during cached CI)
QVAC-7519: Fix dynamic libs path with vcpkg install
Author
|
No need to merge this PR, most changes seem to be already on |
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.