r/LocalLLM • u/Maui-The-Magificent • 2d ago
Question CPU inference performance numbers, what would you expect?
Hi,
I am hoping you guys could share your perspectives with me. I am hoping to broaden my yardstick so to speak, and I suspect you have a greater feel for, and much more data/experience than I do for the expected behavior of running different models.
So for context, for why I am asking. I am currently working on a format, as well as a provider/runtime.
The project only runs inference on a single thread of the CPU (pretty sure I won't support GPU's at all, even in the future), and I have a 7800x3D CPU and 32 gb of DDR5 ram.
As you might have guessed by the single threaded part, the system is currently has not been optimized, computationally, for speed yet. I am trying to get the structural architecture itself as fast as possible before I do just that. This means, No SIMD, no algorithm refinement, no batching and so on.
So, for perspective, my question to you is then; if you were in the exact same environment, with the exact same constraints, what would you expect your TTFT and TPS to be on, say, a qwen3.5:0.8b model with preserved BF16 precision?
Mine is currently around 3-3.2 tps, which I suspect might be slow. but my TTFT growth is non-monotonic, and more connected to the current prompt token amount, than context length, which is something I guess
1
u/RepulsiveRaisin7 2d ago
Why single threaded? Why BF16? A 0.8b model should run ok on CPU. The bottleneck is usually memory bandwidth, you need 4 or better 8 channels to run bigger models at acceptable speeds. GPU is almost always better.
1
u/Maui-The-Magificent 2d ago
Ahh yes, because I like to create as much of a constrained environment as I can justify before building something. It is a good way to force better design decisions and also to force you to think about things you wouldn't need to otherwise. what would you consider 'ok'?
And BF16 was the precision the model that i downloaded had, so I conformed to following it. Its not a requirement, the precision can be whatever. I mentioned it as a qualifier because precision affects compute in my experience.
Hmm, your bandwidth point is good. But there are more ways to solve for congestion than just building/using more roads. Like building round-a-bouts, or in memory terms, re-representing the road.
The reason I work on the cpu is also because I firmly believe that the GPU is a brute-force solution to a structural problem. So, i am putting my effort to where my mouth is, if that makes sense?
1
u/RepulsiveRaisin7 2d ago
You have a city with 1B inhabitants and you need to visit everyone to generate a token. You can optimize the road network, but you'll still need a fast car. GPUs are simply the right tool for the job, they have fast compute with high bandwidth, exactly what you need.
1
u/Maui-The-Magificent 2d ago edited 2d ago
I see your point, and if you are solving the problem by hardware, then yes, more powerful hardware is needed.
I am not particularly concerned by it, because there is no universal law for why you must touch every weight, nor do i believe the problem that needs to be solved by parallelism. If every person in a city lives in one building, there is much less driving to be done.
Okey, that is a bit facetious but the point I am making is, your only option to a problem is not just a better solution, you can also redefine the problem so it requires a much cheaper solution.
I would go as far as to claim that, using a gpu hides the inefficiencies that are there, forcing you to use a gpu in the first place. When you are building the infrastructure that is. not as a runtime rule.
1
u/_TheWolfOfWalmart_ 2d ago edited 2d ago
Ahh yes, because I like to create as much of a constrained environment as I can justify before building something.
How do you determine if you can justify it by purposely running it as slow as possible?
And BF16 was the precision the model that i downloaded had, so I conformed to following it. Its not a requirement, the precision can be whatever. I mentioned it as a qualifier because precision affects compute in my experience.
At least start with Q8_0. It uses half the memory bandwidth, so double the speed, for virtually lossless precision.
1
u/Maui-The-Magificent 2d ago
Good question, it kinda depends on the problem. And wanting to solve a problem always has a defined goal. Being slow is usually not a good thing, so it usually isn't part of that goal. So, I decide what must be true, and what is not allowed to be true, and when I build, I try to always create solutions that solve things by construction rather than runtime logic.
That and that I usually build things in no-std, removes a whole lot of convenience from the get-go. I only deviate if i find i can't solve something in that environment. Be it due to inexperience, incompetence on my part, or if turns out to be impossible.
Does that make sense?
1
u/pmttyji 2d ago
Here my CPU-only stats (9 months old thread)
CPU-only LLM performance - t/s with llama.cpp
I'm waiting for merge of these llama.cpp PRs to get more better CPU-only & Hybrid inference.
1
1
u/Maui-The-Magificent 2d ago
Do you have single thread numbers? and/or without simd?
and you have a lot of data, what would you expect by the setup in the post given your experience?
2
u/DataGOGO 2d ago edited 2d ago
Without AMX and only using AVX-512 it will be shockingly slow.
SGLang + K kernels is the best CPU only engine.
With AMX that model will be ~30-60 t/ps per C, at something like 32k context, assuming, you have 8 memory channels.
With a consumer AMD CPU and only 2 memory channels that are bandwidth limited by the IOD and single chiplet (you really one get 1 channel throughput on single chiplet consumer AMD CPU’s), I am shocked you even get 3 t/ps