Repository navigation
Small CPU models compared; Gemma 4 chat format; fix replies cut inside a character - #22
Merged
Merged
Conversation
…PU profiles and bench_memory --no-train Mem.LlamaChat renders Gemma 4's <|turn>role ... <turn|> format itself (llama.cpp b11985's built-in templates do not know it, so Gemma 4 could not chat), with <bos> written out. A reply cut off by max_new_tokens inside a character (half an emoji) no longer ends in invalid UTF-8. models.json: qwen3-0.6b (trainable), lfm2-1.2b, lfm3-1.7b and gemma4-e2b (chat-only: no llama.cpp backward for their short convolutions, or GELU/TANH). bench_memory.py --no-train scores base and rag for models nothing can train. On 4 CPU cores, 30 facts with the fact in the prompt: Qwen3-0.6B 0.933 (29 t/s at Q8_0), LFM2-1.2B 0.850 (18 t/s); Gemma 4 E2B and LFM3-1.7B still running. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NPVFJHeBeotAKkU7EPbTgn
…, Qwen3-0.6B 0.933 (trainable), LFM2-1.2B 0.85, Gemma 4 E2B 0.73 Speed on 4 cores follows file size (Qwen3-0.6B Q4_0 42 t/s, LFM2-1.2B Q4_K_M 35, LFM3-1.7B 21, Gemma 4 E2B 11). Gemma 4 refuses with the fact in the prompt (16 of 60) but makes up least (0.133). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NPVFJHeBeotAKkU7EPbTgn
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.
This PR compares four small models for a fast CPU profile and fixes two bugs that the comparison turned up. The write-up is in
bench/README.md, under "Small models for a fast CPU profile".Fixes (
Mem.LlamaChat)<|turn>role … <turn|>format, so every prompt failed with "llama.cpp does not know this model's chat template". memagent now renders the format itself and writes<bos>out. Thinking stays off.max_new_tokenspartway through a multi-byte character (half an emoji) used to end in invalid UTF-8, which broke the JSON thatbench_llamawrites. memagent now drops the incomplete character.Profiles (
models.json)qwen3-0.6b: trainable.lfm2-1.2bandlfm3-1.7b: chat-only. Their short convolutions have noSSM_CONVbackward pass.gemma4-e2b: chat-only. There is noGELU/TANHbackward pass.bench_memory.py --no-trainscores the base model and the RAG setup only, for models nothing can train yet.Measured on 4 CPU cores
Test plan
make test-pascalllama-benchon all four models, plustinyandsmallfor referencebench_memory.py --no-trainon all four models (bench/results/memory-*-cpu-rag.json)qwen3-0.6b(not run yet)Generated by Claude Code