TECHNOLOGY

Why test Metal graph fusion at several microbatch sizes?

In this article
THE QUICK TAKE

Compare small and larger microbatches in the same process. Check for successful graph reuse and matching outputs before measuring throughput.

On November 28, llama.cpp published b12840 with a change to the Metal ADD fusion rule. The note explains that bias and residual addends could share a layout for a single-token microbatch while belonging to different buffers. Changing the microbatch could change how nodes were packed and ordered. A scheduler reservation built for another ordering could then require an unexpected reallocation. The update requires the addends in a fused chain to share a backend buffer.

Keep the model and allocation mode constant

Run the same model revision, backend and memory settings for the full comparison. Start with a small decode step and follow it with a larger unit of work in the same process. The order matters because exercising independent processes can hide a reuse issue. Include a repeated small step after the larger workload to observe whether returning to the usual decode path is stable.

Test normal generation and draft verification

A static configuration can still see different microbatch shapes during interactive generation or speculative verification. The maintainers report tests with several verification sizes and a Nemotron graph. Treat those as the project’s reported coverage. Choose representative inputs from the specific model family and scheduling mode in your deployment, then check generation succeeds through each transition.

Observe memory and output together

Track graph reservations and unexpected allocations in staging. Record the peak resident memory and compare deterministic outputs or agreed numerical tolerances. An allocation warning can precede poor reliability, and a run that merely stays alive can still produce different results. Check the compiler, Metal device and source build along with settings for each test.

Evaluate performance after the correctness gate

Use a fixed input and add repeated mixed workloads to characterize latency distribution. Compare throughput within the same microbatch configuration before generalizing across configurations. This approach separates an improvement in graph reuse reliability from the decision to use bigger batches for throughput.

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