Repository navigation
Make lcode bench count the part of a loaded model in RAM - #261
Open
nasser1941 wants to merge 4 commits into
Open
nasser1941 wants to merge 4 commits into
nasser1941 wants to merge 4 commits into
Conversation
lcode doctor looked for lcode-qwen3.6-35b in /api/ps, where Ollama lists lcode-qwen3.6-35b:latest, so its Loaded line never appeared for the models lcode setup creates. It now finds the model the way the load line does (same_model) and says the same thing, with the context. The line after a load repeated /api/ps, which leaves out the weights that stay mapped from the model's file in system RAM: with Ollama 0.40, qwen3.6-35b at 32K on a 12 GB GPU showed as "10.5 GB, 98% on the GPU" while ~12 GB of experts were in RAM. For catalog models partly off the GPU, lcode now counts the model at the catalog's estimate, the one lcode setup and lcode doctor show: "~23 GB, 42% on the GPU and the rest in system RAM". With that share the warning that another program is using GPU memory can fire again; it now says how much of the model fits rather than calling the catalog's figure usual. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merging main filed them under 0.62.0, the release that renamed the old Unreleased section. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lcode bench read /api/ps directly, so with Ollama 0.40 it printed lcode-qwen3.6-35b at 32K on a 12 GB GPU as 10.4 GB, 98% on the GPU, leaving out the ~12 GB of experts that stay mapped from the model's file in RAM. It now uses residency.placement and with_estimate, as the line after a load does: ~23 GB, 42% on the GPU and the rest in system RAM, and ~23 GB, 42% on GPU in the summary. --json results keep Ollama's count in memory_gb and gpu_percent, so they still compare with older results, and add the estimate in estimated_memory_gib and estimated_gpu_percent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Builds on #260 and merges after it. This branch has #260's commit, then main merged in, then its own two commits. Until #260 merges, the diff below includes #260's changes too; this PR's own are 784f8dd (CHANGELOG placement after merging main) and f3395e9 (the change).
What changes
lcode benchread/api/psdirectly. With Ollama 0.40,lcode-qwen3.6-35bat 32K on a 12 GB GPU printedLoaded in 18s · 10.4 GB, 98% on the GPU, because Ollama leaves out the ~12 GB of experts that stay mapped from the model's file in RAM. The summary and the--markdowntable said the same.It now uses
residency.placement(which matcheslcode-qwen3.6-35b:latest) and #260'sresidency.with_estimate, so it says what the line after a load says:and
~23 GB, 42% on GPUin the summary's Memory row. When Ollama counts the whole model (all of it on the GPU, or a model outside the catalog), both show Ollama's numbers as before, in the load line's words:6.6 GB, all on the GPU.The JSON
--jsonresults keep Ollama's count under the names it always had:memory_gb(10.4) andgpu_percent(98). docs/bench.md promises that existing fields keep their meaning untilschemachanges, and older results only have Ollama's count, so comparing those two fields across results stays like for like. lcode's estimate goes next to them:estimated_memory_giblcode setupshows it (~23 GB)estimated_gpu_percentBoth are
nullwhen Ollama counts the whole model.lcode bench --comparereads only--harborresults, which record no memory, so nothing changes there.Docs and CHANGELOG
docs/bench.md: the example's Loaded line, What's measured, the 12 GB laptop table (with a note that 0.58.0 printed Ollama's10.5 GB, 98% on GPU), the JSON example and the field table.docs/models.md: nameslcode benchnext to the load line andlcode doctor.CHANGELOG.md: a Fixed entry under the new Unreleased.Merging main
Main released 0.62.0 after #260 branched, which renamed the old Unreleased section. Merging main filed #260's two CHANGELOG entries under
[0.62.0]without a conflict. 784f8dd puts them back under Unreleased, where this PR's entry follows them. After #260 merges, merging main here again will likely conflict in Unreleased, since both sides add #260's entries there: keep main's and this PR's entry after them.Testing
uv run pytest: 1156 passed, 2 skippeduv run ruff check . && uv run ruff format --check .: cleanuv run basedpyright: 0 errorsuv run --group docs mkdocs build --strict: buildstests/test_bench.py, withFakeOllama: Ollama 0.40's numbers forlcode-qwen3.6-35b:latest(the line, the JSON and the Memory row), a model all on the GPU and one outside the catalog (Ollama's count stands), and a model measured after its tasks because the load failed. All three fail on the oldbench.py.🤖 Generated with Claude Code