TECHNOLOGY

llama.cpp HIP TOP_K fallback: the historical cliff and the radix fix

In this article
THE QUICK TAKE

GPU-resident weights do not prove GPU-only execution. Verify per-operation placement and the accepted implementation in the exact engine revision before applying an old issue to a current system.

A model can have its weights on AMD GPUs while particular graph operations execute on the CPU. The historical llama.cpp TOP_K incident shows why weight placement alone cannot explain decode speed. It also shows why an old issue title must be read alongside subsequent implementation changes before describing the current backend.

Identify the graph operation rather than the sampler setting

The original report concerns DeepSeek’s indexer graph, not simply a user’s top-k token-sampling parameter. The owner reported a six-MI50 configuration and a steep throughput change as actual prompt history grew. A per-request trace showed all observed TOP_K nodes on GPU for a shorter request, with most moving to CPU for a longer one.

That is stronger placement evidence than high CPU utilization alone. It still describes particular forked binaries, weights and topology. Other participants reported different performance effects, including cases without the same collapse. Backend support, transfer cost and host capacity must remain separate parts of an explanation.

Retain the author’s corrected hypothesis

The issue initially discussed allocation failures, but its updated account found the same load-time failure count on either side of the performance cliff. That observation did not support allocation retries as its cause.

The historical unsupported-operation condition depended on tensor width. Tensor width and actual context length were not conclusively mapped for the owner’s binaries. A source-code size boundary should therefore not be presented as a universal prompt-length threshold. Similarly, a graph-reservation log is not a substitute for placement observed while a real request executes.

Follow the accepted implementation change

Pull request 27466, merged in August 2026, added a radix TOP_K path for long rows without requiring hipCUB. Its actual diff separated TOP_K support from the older ARGSORT condition and retained the small-row bitonic path.

The author’s performance table and backend-operation checks belong to that proposal’s configurations. They are not measurements from Retrivium and do not establish an identical gain for every AMD system. The issue’s later automated closure as stale also does not identify a package version containing the fix. A deployment needs its own source or binary provenance.

Check a pinned revision before repeating an old limitation

In the reviewed pinned backend source, TOP_K is supported up to the integer-width bound, while ARGSORT has a separate support check. The matching kernel implementation contains a radix route when the CUB route is unavailable. Consequently, repeating the original narrow-row limitation as an unconditional current HIP restriction would be inaccurate.

A useful comparison retains the exact engine revision, actual prompt history, graph shapes and placement alongside prefill and decode results. It checks whether the expected operation stays on the intended device before attributing a speed change to hardware. The stack-reproducibility guide and benchmark protocol explain that record. We reviewed reports and source text without building or running the model. The practical lesson is to verify the execution path in the version being evaluated, then measure its effect under equivalent workload conditions.

Sources

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles