← all posts
// optimization · avx512

AVX-512 helps only inside the complete CPU path

Treat AVX-512 as a line item on a spec sheet, not a purchasing decision. It buys you nothing until everything around it agrees to use it: the quantization scheme, the runtime build, the memory feeding the core. Get one wrong and you paid for silicon that sits idle while the CPU falls back to a slower generic kernel. That's the whole rule. The rest of this just earns it.

Pick the box by the path, not the part number

Say you're comparing two CPU platforms for a local inference appliance, and one leads with AVX-512 as the reason to pay more. Before touching hardware or flipping a launch flag, write down what has to improve: first-token latency, jobs accepted per hour, how many models you can keep resident, energy per completed task, or fewer human corrections afterward. "Make it faster" doesn't tell you when you're done, and it won't stop a change from trading quality for speed.

Then build a baseline you can reproduce: pin the model artifact, tokenizer, prompt template, runtime build, launch command, and sampling settings, then test a small set of real-workload inputs, awkward cases included. Run once cold, with an unloaded model, if users will hit that path, then warm long enough for cache effects, queueing, memory pressure, and heat to surface. Record timings by phase, not one total: queue wait, load or activation, prefill, time to first token, decode rate, peak memory and power, and whether the answer passed quality or needed a retry. Raw tokens per second is a diagnostic, not the result: count valid completed records per hour for a batch job, review and correction time for a coding assistant, p50 and p95 first-token latency for chat, not one short warm run at batch size one that flatters a chip and falls apart once prompts and model swaps arrive.

The runtime never tells you when it gives up

The easiest way to get this wrong is picking the older, hotter box purely for its AVX-512 line, ignoring the platform cost around it. Local runtimes are stubbornly good at limping along: they offload layers, page memory to disk, miss the cache, queue requests, or drop to a generic kernel when the fast path doesn't fit. That also hides a configuration running nowhere near what you paid for. Read the startup logs. Check where tensors land. Watch the operating system's counters. Confirm the optimization you enabled is active for the tensor shapes and context length you run, not the ones in someone else's benchmark.

Change one variable at a time unless you're comparing two whole systems, and keep the full output, not just the metric. Quantization, context compression, sampling changes, and model swaps can move the speed number while changing the answer underneath it, so the quality gate runs on every candidate, no exceptions. If a response got shorter, check it's still complete; if an extractor got faster, count records that validate, not braces that parse. Weigh operational cost too: startup, upgrades, observability, rollback, whether you can rebuild the box after a disk dies. A five-percent win resting on an undocumented patch or manual cache-warming is a bad trade for anything run unattended. Boring setups age well.

Put the conclusion in a file, with an expiration date

Whatever the test shows, write the conclusion into a result file next to the workload, the date, and the reasoning, and note what would make you retest it: a new model family, a driver update, longer contexts than you tried, a different user population, a shifted traffic mix. Skip that and last quarter's numbers turn into this quarter's folklore, repeated by people who never ran the test.

Once you clear the target, stop optimizing and leave room instead. Spare memory absorbs prompt variance. Spare queue capacity keeps a batch job from starving someone waiting on a chat response. Thermal headroom keeps the box fast past the first burst of traffic, not just during the demo. None of that is packing every resource to its limit; it's finishing real work predictably on the cheapest system that won't fall over. It's also the case for running any of this locally: no layer is hidden, so performance doesn't have to be somebody else's claim.

AVX-512 is a contributor you measure, not a purchase you make on faith.

#avx512#cpu#optimization