test: build optimizer on windows cuda#3
Draft
HermestoAizales wants to merge 9 commits into
Draft
Conversation
The optimizer preset types (preset_params, preset_load, preset_apply, preset_save) were declared in tools/optimizer/preset.h but common/common.cpp could not see them — causing 'not declared in this scope' errors when compiling with CUDA. Fix: Move the optimizer preset into the existing common/preset.h/common_preset system as common_optimizer_preset_params and related functions. The tools/optimizer/preset.h now wraps the common types as aliases. This avoids a circular dependency between common/ and tools/optimizer/.
Build fixes for upstream/master compatibility: - Remove preset fields that don't exist in upstream common_params: pipeline_partial, kv_cache_bounded, fit_target_mib, n_cpu_moe, spec_ngram_size, use_numa (n_threads/n_threads_batch are in cpuparams) - Fix ggml_type incomplete type: include ggml.h before optimizer.h - Fix llama_model_bos_token -> llama_vocab_bos(get_vocab(model)) - Fix ggml_log_set return type (void, not auto) - Fix GPU/MoE detection: remove llama_model_n_devices/get_device/n_expert - Fix m_benchmark_tokens mutable in const method - Fix CMakeLists: link to llama-common (not common), fix include paths - Fix tools/optimizer/preset.h wrapper: include common/preset.h After this commit: 'cmake --build . --target llama-optimizer -j6' succeeds.
41beb07 to
0da272c
Compare
…l warning GCC 13 with -Werror flags std::copy inside vector range-for loops with -Wnonnull when iterating over small inline-initialized vectors. Replaced io_values and spec_values std::vector with fixed-size arrays and index-based loops to avoid the false-positive warning. Fixes ubuntu-latest-cuda CI failure.
… only Upstream llama_model_load_from_file asserts !ml.no_alloc when the backend supports buffer_from_host_ptr (e.g. ARM64 CPU). Fix: disable mmap when loading model metadata in optimizer interactive_setup() and main.cpp non-interactive mode.
… model load - interactive_setup(): only ask for model path if not already set via --model - Call ggml_backend_load_all() before llama_model_load_from_file() in both interactive and non-interactive paths (optimizer bypasses common/arg.cpp which normally handles backend loading)
085efec to
880511d
Compare
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.
CI test build only