Back Home

GitHub Repo

Ollama Community Reports Clef Loading Memory Issue; Default Context May Inflate Compute Buffers

An October 8 report from the Ollama community says the Clef reasoning model’s micro-batch size may be set to the full context length, causing memory allocation failures with default settings. The report includes logs from multiple backends and a workaround using a shorter context, but maintainers have yet to confirm or fix the issue.

Mattruffoni · CC BY-SA 4.0 · Image source
zh-Hant

On October 8, the Ollama community reported a Clef/Clef Flash loading issue: in the reporter’s Windows 11 system with a Radeon 890M, memory allocation failed on the CPU, ROCm, and Vulkan backends when the model used the default 16,384-token context. The report includes startup parameters, buffer sizes, and error logs that provide verifiable diagnostic clues. Community report

The key discrepancy in the logs is that Ollama passes -b 512 -ub 512 when starting the underlying llama-server, but initialization sets n_batch and n_ubatch to 16,384, matching n_ctx. The reporter observed that compute buffers grew with the context length. ROCm’s capacity estimate initially showed about 18.7 GB available, yet a later allocation for a roughly 3.3 GB buffer still failed. This points to a possible gap between the capacity estimate and the actual allocation, but maintainers have not confirmed the root cause. Diagnostic logs

A temporary workaround is to create a derived model and change PARAMETER num_ctx to 4096. The official Modelfile documentation confirms that FROM can reuse an existing model and PARAMETER num_ctx can specify the context size. This adjustment also reduces the amount of input the model can process, so check that it meets the task’s requirements before deployment. Ollama also notes that increasing the context length increases the memory required to run the model. Modelfile documentation, context length documentation

From an engineering perspective, this case suggests checking whether micro-batch settings, context settings, and memory estimates are consistent. Developers can compare the startup command, initialization logs, and actual buffer allocations rather than relying solely on model weight size to judge whether a model will load. The evidence is limited to one reporter’s hardware and test setup and does not establish that all platforms are affected. Next, watch for upstream confirmation of the batch-setting behavior and whether a fix addresses both capacity estimation and automatic context reduction. At the time of review, the issue remained open, with no linked fix listed. Issue status

Sources

  1. Clef / Clef Flash: n_ubatch is forced to n_ctx — Ollama issue #18865
  2. Modelfile Reference
  3. Context length