TECHNOLOGY

When does Vulkan subgroup pooling help llama.cpp inference?

In this article
THE QUICK TAKE

Profile the pooling operator and end-to-end latency on each GPU before extrapolating a kernel result.

The llama.cpp build b12972, published on December 3, adds a Vulkan subgroup shader for one-dimensional pooling. In the earlier shader, a thread processed its pooling window serially. The new path lets lanes in a subgroup cooperate. Wider windows can expose useful parallel work. The update targets a specific operation along the model’s execution graph, so its practical effect depends on how prominently that operation appears in your workload.

Read the timing at the right scope

In pull request #33221, the contributor reports that pooling time for Mellum 2.1 Instruct went from 4.48 ms to 0.28 ms on an Intel Iris Xe system with Mesa ANV. These timings cover the operation in that experiment. They do not measure the total time from a prompt to a completed response. Preserve the device, driver and input conditions when you cite or compare them.

Test the window shapes you actually run

Record the shape and effective pooling mode in a profiler. Compare an input that spends substantial time in this operation with one where pooling is a minor cost. On the same device and software stack, record old and new kernel duration, time to first token, and completed-request latency. Repeat at normal concurrency. Driver differences and the work available to the subgroup can change the size of the gain.

Verify output around window boundaries

Use representative inputs and add cases where the pooling window meets the end of a sequence. Compare results to the project’s reference backend within a chosen tolerance. Run the upstream operator checks as well as your own inference checks. Keep the conditions with the numbers so that another device can be compared without changing several variables at once.

Decide where to enable the upgrade

Approve the build where both correctness and request latency meet your service targets. A large operator improvement can be valuable on a particular model even if a mixed workload sees a smaller overall gain.

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