Skip to content

test: build optimizer on windows cuda#3

Draft
HermestoAizales wants to merge 9 commits into
masterfrom
feature/optimizer-ci2
Draft

test: build optimizer on windows cuda#3
HermestoAizales wants to merge 9 commits into
masterfrom
feature/optimizer-ci2

Conversation

@HermestoAizales

Copy link
Copy Markdown
Owner

CI test build only

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.
@HermestoAizales HermestoAizales force-pushed the feature/optimizer-ci2 branch from 41beb07 to 0da272c Compare May 8, 2026 12:47
…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)
@HermestoAizales HermestoAizales force-pushed the master branch 2 times, most recently from 085efec to 880511d Compare May 27, 2026 22:30
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