Skip to content

feat(benchmarks): standardize LLM/RAG/LoRA artifact preflight checks (Maßnahme #6) - #4640

Merged
makr-code merged 3 commits into
developfrom
copilot/standardize-artifact-setup
Apr 14, 2026
Merged

makr-code merged 3 commits into
developfrom
copilot/standardize-artifact-setup

Conversation

Copilot AI commented Apr 13, 2026 •

Copy link
Copy Markdown
Contributor

LLM/RAG/LoRA benchmarks were failing with opaque "file not found" errors in clean CI environments due to missing GGUF/LoRA artifact setup. No standardized preflight mechanism existed to catch this before benchmark execution.

Core additions

  • scripts/download_models.sh — canonical entry point matching the M06 audit path list; thin wrapper over prepare_llm_bench_artifacts.sh
  • benchmarks/benchmark_artifact_preflight.h — shared C++ preflight utility:
    • LLMArtifactPreflight::create() for fixture SetUp() use
    • resolveModelPath() / resolveLoraPath() using THEMIS_MODEL_DIR → THEMIS_LLM_MODEL_PATH → stub fallback priority chain
    • THEMIS_BENCH_REQUIRE_ARTIFACT / THEMIS_BENCH_SKIP_IF_ARTIFACT_MISSING macros for benchmark body guards
// In fixture SetUp():
auto preflight = themis::bench::LLMArtifactPreflight::create(/*require_lora=*/true);
if (!preflight.ok()) { preflight_error_ = preflight.errorMessage(); return; }

// In benchmark body:
THEMIS_BENCH_REQUIRE_ARTIFACT(state, themis::bench::resolveModelPath());

Fixes to existing code

  • prepare_llm_bench_artifacts.sh — adds offline/air-gapped fallback: writes a minimal valid GGUF v3 header stub (magic + version + 0 tensors + 0 KV pairs) when HuggingFace download fails, so path-existence checks pass and benchmarks emit SkipWithError cleanly instead of crashing
  • bench_llm_real_models.cpp — switches path resolution to the preflight utility; error message now actionable (run scripts/download_models.sh --stub-only)
  • bench_multi_lora_fusion.cpp — replaces hardcoded /path/to/bench*.bin paths with resolveLoraPath(); all BENCHMARK_F functions guard via ensureReady(state)

CI integration

  • nightly-benchmark-sweep.yml — adds "Prepare LLM/LoRA benchmark artefacts (stub mode)" step (calls download_models.sh --stub-only) before CMake configure, exporting THEMIS_MODEL_DIR and THEMIS_LLM_STUB_MODELS=ON for subsequent steps

Audit tools

Audit result after change: # 6 ✅ PASS [ERLEDIGT] / [OK] M06 model_setup_script_found + [OK] M06 benchmark_preflight_header_found

Type of Change

  • Bug fix (non-breaking)
  • New feature (non-breaking)
  • Refactoring (non-breaking)
  • Documentation
  • Breaking change (requires MAJOR version bump — see VERSIONING.md)
  • Security fix
  • Other:

Breaking Change Checklist

  • MAJOR version bump planned in VERSION and CMakeLists.txt
  • Migration guide added in docs/migration/
  • Announcement prepared for GitHub Discussions (≥ 2 weeks before release)
  • CHANGELOG ### Removed / ### Changed section updated

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed
  • Benchmarks run (if performance-sensitive change)

📚 Research & Knowledge (wenn applicable)

  • Diese PR basiert auf wissenschaftlichen Paper(s) oder Best Practices?
    • Falls JA: Research-Dateien in /docs/research/ angelegt?
    • Falls JA: Im Modul-README unter "Wissenschaftliche Grundlagen" verlinkt?
    • Falls JA: In /docs/research/implementation_influence/ eingetragen?

Relevante Quellen:

  • Paper:
  • Best Practice:
  • Architecture Decision:

Checklist

  • Code follows project style guidelines (clang-format / clang-tidy)
  • Self-review completed
  • Documentation updated (if needed)
  • CHANGELOG.md updated under [Unreleased]
  • No new warnings introduced
  • Security-sensitive paths reviewed by security maintainer (if applicable)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • huggingface.co
    • Triggering command: /usr/bin/wget wget -q --show-progress -O /home/REDACTED/.local/share/themis/models/gguf/tinyllama-1.1b-chat-v1.0.Q4_K_M.gguf REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Implement standardized artifact preparation for benchmarks feat(benchmarks): standardize LLM/RAG/LoRA artifact preflight checks (Maßnahme #6) Apr 13, 2026
Copilot AI requested a review from makr-code April 13, 2026 20:36
@makr-code
makr-code marked this pull request as ready for review April 14, 2026 04:40
@makr-code
makr-code merged commit aac9b9e into develop Apr 14, 2026
11 checks passed
makr-code added a commit that referenced this pull request Apr 14, 2026
…(Maßnahme #6) (#4640)

* Initial plan

* feat(benchmarks): standardize LLM/RAG/LoRA artifact preflight checks (Maßnahme #6)

Agent-Logs-Url: https://github.com/makr-code/ThemisDB/sessions/a45496e4-0a50-47dd-b366-543fe540527b

Co-authored-by: makr-code <[email protected]>

* fix(benchmarks): address code review feedback on preflight implementation

Agent-Logs-Url: https://github.com/makr-code/ThemisDB/sessions/a45496e4-0a50-47dd-b366-543fe540527b

Co-authored-by: makr-code <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: makr-code <[email protected]>
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.

[Agentic AI][Benchmarks] Modell-/Artefakt-Vorbereitung für LLM/RAG/LoRA standardisieren

2 participants