makepad/tools/vlm_oracle/build.sh
Admin 9f851e2d45 vlm: clip.cpp oracle tool — dump qwen3.5 mmproj preproc + embeddings for parity testing
Links the local llama.cpp April build (libmtmd exports clip_* internals);
generates deterministic PPM test images; dumps preprocessed f32 tensor and
projected [n_tokens x 4096] embeddings. Reference stats recorded: radar
512x384 -> 192 tokens, cpu-vs-metal spread ~2e-4 abs on embd values.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-28 14:07:18 +02:00

19 lines
728 B
Bash
Executable file

#!/usr/bin/env bash
# Build the clip.cpp oracle against the local llama.cpp checkout.
set -euo pipefail
LLAMA_CPP="${LLAMA_CPP:-/Users/admin/llama.cpp}"
# NOTE: build/ is stale (Aug 2025); build-arm64-apple-clang-release matches the
# April 2026 source and has qwen3vl mmproj support.
LLAMA_BIN="${LLAMA_BIN:-$LLAMA_CPP/build-arm64-apple-clang-release/bin}"
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
clang++ -std=c++17 -O2 \
-I "$LLAMA_CPP/tools/mtmd" \
-I "$LLAMA_CPP/ggml/include" \
-I "$LLAMA_CPP/include" \
-I "$LLAMA_CPP/vendor" \
"$DIR/clip_dump.cpp" \
-L "$LLAMA_BIN" -lmtmd -lggml -lggml-base -lllama \
-Wl,-rpath,"$LLAMA_BIN" \
-o "$DIR/clip_dump"
echo "built $DIR/clip_dump"