Until now `auto` kept llama.cpp's reader whenever the CPU's best kernel tier was below AVX2, because the only tier there was the slow portable one. The SSE4.1 and AVX
tiers (0991006d2, 117473f64) and the run-time dispatch (0c83610e5) change that, and the owner asked for ours as the default on these CPUs ("Yes make ours the default").
`auto` now gives our tower on every CPU tier for a tower it can run (both public reader files: Qwen3.8 BF16, Qwen3.6 F16). The setting that picks llama.cpp's reader
(STRATA_VISION_TOWER=mtmd, or --tower mtmd) works as before, and --tower own as before. No new setting, no new line in a log.
What a user on such a CPU gets (p2006, Zen 4 running the forced tier, 8 threads, medians, ours / llama.cpp's reader built for the same CPU class; big1024 = 1,024 tokens,
shapes = 260 tokens; rule 1 = the lowest cosine over 18 pictures against llama.cpp's portable AVX2 reader, the bar is 0.999):
| CPU class (our tier / llama.cpp build) | model | big1024 | shapes | rule 1 minimum |
|---|---|---|---|---|
| no AVX (sse41 / SSE4.2 build) | Qwen3.8 | 25.2 s / 150.8 s (0.167) | 3.5 s / 37.1 s (0.095) | 0.999029 |
| no AVX | Qwen3.6 | 25.3 s / 123.3 s (0.205) | 3.5 s / 29.3 s (0.121) | 0.999975 |
| AVX, no F16C (avx / avx build) | Qwen3.8 | 11.8 s / 35.7 s (0.331) | 1.37 s / 8.2 s (0.167) | 0.999674 |
| AVX, no F16C | Qwen3.6 | 12.2 s / 123.1 s (0.099) | 1.41 s / 30.4 s (0.046) | 0.999975 |
| AVX with F16C (avx / avx_f16c build) | Qwen3.8 | 12.1 s / 34.8 s (0.346) | 1.34 s / 8.0 s (0.166) | 0.999674 |
| AVX with F16C | Qwen3.6 | 12.1 s / 11.6 s (1.040) | 1.39 s / 2.17 s (0.643) | 0.999975 |
The one slower cell is Qwen3.6 on a CPU with AVX and F16C, on the large picture: 1.04 of llama.cpp's time (pair ratios 1.024 to 1.056); on the 260-token picture the same
pair is 0.643. Everywhere else below AVX2 ours takes 0.05 to 0.35 of llama.cpp's time. The AVX2 and AVX-512 CPUs are not affected: they already took our tower.
The code: own_reader_supported() loses the "best tier below AVX2" rule; the CPU half is own_cpu_reader_supported(geometry, tier) (true for every tier when the tower's
operations are implemented) and the reader a setting gives is vision_tower_resolve(setting, own_ok), so the selection is unit tested for the CPU classes no AVX, AVX without F16C,
AVX with F16C, AVX2 and AVX-512 (and a CPU older than SSE4.1), for both reader files' geometry, and for the explicit setting both ways (strata-vision-own-test). cpu_caps.h gets
isa_ok_for / best_isa_for (the same two functions for a given feature set); best_isa() and isa_ok() are unchanged.
Checks run for this commit are in phaseA-tests/cleanup/RESULTS-OWN-3V.md PART H (unit and Python suites on p1006; a default start with the tier set by STRATA_FORCE_ISA on p2006;
a default start under qemu-user with the Westmere CPU model on z440).
- the default tower is `auto` (was mtmd); without --tower, STRATA_VISION_TOWER=mtmd|own|auto decides (the run config's env carries it when someone picks llama.cpp's reader; an older strata-vision ignores it); an explicit --tower wins
- `auto` now takes ours on Metal (gate passed on the M5 Max, RESULTS-OWN-3V.md D1/D4-D8) and on MSVC x86 builds (rule cab87a2e8 removed: 0.986 of mtmd-CPU since 54f9cc3c0, D2)
- kept: gfx1151, Pascal with F16 matrices at <= 1,024 tokens, x86 without AVX2; new hold: every card on Windows HIP (not measured with the Windows ROCm package; remove when one RX 9000 / RX 7000 run on Windows is in)
- under `auto`, a failure of ours before READY (no GPU, the load, the warm-up) writes nothing on stdout; strata-vision logs the reason and starts mtmd's reader in the same process; `--tower own` keeps its hard failure
- READY names the reader: "READY <n> own", "READY <n> mtmd", "READY <n> mtmd fallback" (servers read only the start)
- test hook STRATA_VIT_TEST_FAIL=gpu|load|warmup; unit tests for the default, the Windows HIP hold, the soft start and the hook (p2006 job p2006-20261111-0743-7d3b: strata-vision-own-test ok, cpu-test all passed)
The reader was clamped only when the config carried vision.max_tokens; an old, hand-edited or migrated config left it unclamped and
one picture became 93,700 image tokens. Vision.token_limit gives every reader a limit (GPU 1024, CPU 300, the numbers setup writes)
unless the config names one (a value the person set is kept, 0 still means none). strata-vision refuses a picture that comes back
over the limit plus an eighth with a plain ERR instead of passing 90 times the budget on, and prints a WARNING when its own warm-up
picture is over it. The server logs a picture that is more than 4 times the limit with the numbers to send with a report.
tools/vision builds one program for the Mac: ggml's Metal backend inside, --gpu reads on the GPU, without it on the CPU. The reader
choice (strata_control/vision_reader.py) gives a Mac the GPU reader whatever its memory (the CPU reader needs ~50 s per picture:
ggml has no BF16 vector kernel on ARM). setup.py's Mac path downloads the mmproj and writes the vision section; strata launch,
the MCP server and metal/setup_mac.py default pictures on. packaging/build_vision_mac.sh builds the program for the engine package.
llama.cpp refuses a GGUF whose tensor directory has a type it does not know, so the picture reader could not open a Gyro model (TQK6 / TQK7, ids 145 and 146) and Gyro was left without pictures. strata-vision now copies the key/value header into a small tensor-less GGUF and loads that vocab-only; the weights are never read or type-checked. Falls back to the file itself when the header holds a value type the copier does not handle.
Gyro-S and Gyro-M read pictures (setup.py, MCP catalog). Adds a C++ test (strata-vision-gguf-test) with a GGUF that has unknown tensor types.
The HC read takes, per matrix, its load-time Q8_0 copy or the file's own tensor: Unsloth's Q8_0 down/up need no copy,
their F32 inject rows go to gr_down_q8f (mac-kern 945c0d24). router_route_<type> for BF16 and F32 (opt-in). The M4's
v2 prompt kernels: K-quant gate/up TK 128, Q8_0 / IQ4_XS TK 32, Q5_1 / Q8_0 / IQ4_NL down TK 32. GSQ packs unchanged:
Q2_0 prompt1/story, IQ3_XXS prompt1 and the 1,662-token chain prompt give the same tokens as before (M5 Max).
tools/vision/strata_vision.cpp: no posix_fadvise on macOS (it does not have it); strata-vision then builds there with
ggml-metal.
ggml's tiled CPU flash-attention kernel needs the head size (72 in this
encoder) to be a multiple of the vector width: 8 floats with AVX2, 16 with
AVX-512. With AVX-512, which a build from source gets on a CPU that has it,
ggml falls back to a kernel that is several times slower and accumulates in
FP16. The release builds are AVX2, where flash attention is the faster one,
so auto stays the default there.
1024x1024 picture, Ryzen 7 7700X, 8 threads, F16 mmproj: AVX2 8.3-9.9 s
with it, 14.0-15.2 s without; AVX-512 43.5 s with it (26% off the FP32
output), 13.3 s without. --gpu keeps auto, and an explicit --flash-attn
still wins.
Rebased onto the 0.1.40 strata_vision.cpp (the --min-tokens usage line). Only a source build on an AVX-512 CPU changes; the release builds (AVX2) do not. The Zen4 timing is not run here.
(PR #660)
The native output head (437 MB) and the token embedding (260 MiB) were copied
out of the mapped GGUF one page fault at a time, and strata-vision's projector
(907 MB) went through llama.cpp's sequential reads, all before the server was
ready. Each now asks for its bytes ahead (the vision encoder honours
STRATA_READ_AHEAD=0 too), and the head, the embedding, the projector load, the
encoder warm-up and the pinned cache complement log their times.
- --flash-attn on|off|auto (mtmd's flash_attn_type): flash attention keeps K and V in FP16. On the NVFP4 fork the
vision tower's output was 11.2% off with it on the GPU; FP32 attention (CPU) 0.1%.
- On the CPU a CUDA build keeps the GPU unseen (CUDA_VISIBLE_DEVICES=-1 before the runtime starts): it otherwise
opened a context there, 0.4-0.7 GB of VRAM the expert cache loses.
- On the CPU without --threads: one thread per core (mtmd's default is 4); no warm-up encode (~6 s of start).
- serve/server.py: relative exe/mmproj/model paths in the vision config are the config's cwd's, as the engine's are.
Streaming
- tool calls stream as they are written (OpenAI tool_calls deltas, Anthropic input_json_delta)
- keep-alives while a long prompt is read, progress in the server window, GET /status
- closing the connection or pressing stop really stops the engine (STOP)
Stalled requests (mostly image turns)
- the expert cache is sized after its slots are written (Windows only counts GPU memory once it is
touched), so the reserve really stays free instead of the card running at 0 MiB and paging
- the prompt chunk shrinks when its buffers do not fit in the cache, instead of allocating on top
- the image encoder warms up before the engine starts; images are encoded in request order
- the log shows the VRAM left once everything is loaded
setup.py now requires engine 0.1.2 (downloaded automatically on the next START-HERE.bat).
Inference engine, OpenAI/Anthropic API on localhost, optional image input, one-file setup
(START-HERE.bat / setup.sh). Model files are downloaded from Hugging Face by the setup.