Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

PowerInfer - a high-speed inference engine for deploying LLMs locally. Just came across this super interesting project on speeding up inference. It's not MoE but it's a simple approach that exploits the high locality in LLM inference to design a GPU-CPU hybrid inference engine. Hot-activated neurons are preloaded onto...

261,770 Aufrufe • vor 2 Jahren •via X (Twitter)

10 Kommentare

Profilbild von elvis
elvisvor 2 Jahren

source: github:

Profilbild von Adam Pippert
Adam Pippertvor 2 Jahren

This is HUGE. I always suspected that there would be a way to break up the architecture of a model to alleviate the GPU cost and availability bottleneck. Will play with this on LLaMa2, but highly anticipating Mistral-7B.

Profilbild von Hamid R. Darabi
Hamid R. Darabivor 2 Jahren

It's very interesting! 11.69x improvement over llama.cpp sounds a lot, given that it's already super efficient. Are you sure it's not 11.7%? Even that could be a good result.

Profilbild von Loki (cute/acc)
Loki (cute/acc)vor 2 Jahren

I almost tried this before I realized it's one more model exchange format 🥲 ".powerinfer.gguf" Can't all of you just use onnx and move on in life? 😭

Profilbild von catid (e/acc)
catid (e/acc)vor 2 Jahren

Nice I was working in this direction recently noting the same things. 12x speedup is very respectable compared to 8x being the best so far achieved by any one approach (e.g. pruning/quantization)!

Profilbild von Filippo Pedrazzini
Filippo Pedrazzinivor 2 Jahren

15 GiBs of weights? And this is supposed to run on Consumer Devices?! 🧐

Profilbild von Medium Boss - 70b_Float16.Q8.gguf
Medium Boss - 70b_Float16.Q8.ggufvor 2 Jahren

The week I got a new PC with a beefy CPU. Fucking nice.

Profilbild von Sahar Mor
Sahar Morvor 2 Jahren

Paper tl;dr

Profilbild von s3nh
s3nhvor 2 Jahren

Fastest bookmark 🤫🤫🤫

Profilbild von Ruairi
Ruairivor 2 Jahren

Noob question, is this just for the activation function or is it also cutting down the number of entries for GPU matrix multiplication as well?

Ähnliche Videos

A 12GB RTX 3060 is reportedly generating around 50 tokens/s with Qwen3.8-35B-A3B, a model with 35 billion parameters. The same setup is also reporting approximately 550 tokens/s in prompt processing. No 24GB GPU or expensive multi-GPU setup. Just an RTX 3060, 16GB of system RAM and some careful inference optimisation. The hardware and configuration The reported setup uses: GPU: RTX 3060 (12GB VRAM) System RAM: 16GB Model: Qwen3.8-35B-A3B Quantization: Q4_K_M Generation speed: ~50 tokens/s Prompt processing: ~550 tokens/s Configured context: 262K tokens Runtime: llama.cpp Optimisations: Flash Attention and Q8 KV cache The two speed figures measure different stages of inference Generation speed measures how quickly the model produces new tokens. Prompt processing measures how quickly it processes incoming text before generating a response Both are useful, but they shouldn’t be treated as interchangeable How does a 35B model run on 12GB VRAM? The explanation starts with the model’s architecture Qwen3.8-35B-A3B uses a Mixture-of-Experts (MoE) design Although it contains approximately 35 billion parameters, only around 3 billion are activated for each token Instead of running every part of the model during every generation step, the routing system selects particular experts to perform the computation This reduces the amount of computation required per token compared with a dense model of similar total size However, there’s an important distinction: 3B active parameters does not mean the remaining 32B parameters disappear The full model weights still need to be stored and accessed. That’s where hybrid inference becomes important The CPU and GPU work together The setup uses llama.cpp to distribute the model across GPU and system memory According to the reported configuration, 26 MoE layers are offloaded to the CPU This allows system RAM to accommodate parts of the model that cannot fit entirely within the RTX 3060’s 12GB VRAM The GPU handles the portions assigned to it, while the CPU and system memory take care of the offloaded components Three optimisations help make this arrangement practical: 1. Q4_K_M quantization The model weights are stored in a 4-bit quantized format, significantly reducing their memory footprint compared with higher-precision versions The trade-off is that quantization can affect model quality, so coding performance still needs to be evaluated 2. Flash Attention Flash Attention improves how attention operations are computed by reducing unnecessary memory movement It can also help control memory requirements, particularly when processing longer sequences 3. Q8 KV cache The KV cache stores attention keys and values from previously processed tokens Using Q8 stores this information at 8-bit precision rather than a higher-precision format, reducing memory consumption as the context grows Together, these techniques allow the system to run a model that would otherwise be difficult to accommodate entirely in GPU memory What about the 262K context? The reported configuration supports a context window of up to 262K tokens But a configured context limit doesn’t mean the system can process that much text at the same speed or without memory pressure The KV cache grows as more context is processed. With only 16GB of system RAM and 12GB of VRAM, longer prompts could introduce substantial memory pressure and reduce performance. The actual usable context will depend on the runtime configuration, cache allocation and available memory The real test: coding agents Getting 50 tokens/s from a local model is encouraging, but generation speed alone doesn’t tell us how useful it is for software development A coding agent needs to: Inspect files and understand an existing codebase Identify dependencies and trace how components interact Modify multiple files Execute commands and tests Diagnose errors Recover from failed attempts Verify that the final changes actually work

FHILY👑

52,308 Aufrufe • vor 12 Tagen

I had to test it myself to believe this unreal inference speed. 3,000 tokens/s for 1 user on standard datacenter GPUs. They leveraged a hidden efficiency gap in how GPUs generate tokens. Kog just achieved 3,000 tokens/s on 8× AMD MI300X GPUs and 2,100 on 8× NVIDIA H200 (FP16, no speculative decoding). Their tech preview is on a 2B model, and they show how their techniques will scale to large frontier MoE models at similar speeds. That's a huge number because normal low-batch GPU decoding for 2B to 8B models is usually closer to 100 to 300 tokens/s per request, so Kog is claiming something like a 10X to 30X jump in the speed one user actually feels. Their trick: they are getting the speed by treating LLM decoding as a memory streaming problem, not mainly a math problem. For 1 user at batch size 1, the GPU is not doing big, efficient matrix-matrix work like in training or large-batch serving; it is repeatedly pulling the model’s active weights from high-bandwidth memory for each new token, so speed depends on how smoothly those weights keep flowing. Normal inference stacks keep breaking that flow. They run many separate GPU programs for different parts of the model, move intermediate results through memory, wait at synchronization points, talk back to the CPU for scheduling or sampling, and then repeat this token after token. Kog’s answer is to co-design 3 things that are usually tuned separately: the runtime, the low-level GPU code, and the model architecture. The biggest engineering move is the monokernel, where the whole decode pass runs as 1 persistent GPU-resident program, including sampling, so the system does not keep stopping for kernel launches, CPU scheduling, and intermediate memory round trips. They also rebuilt synchronization, because their own measurements say grid sync was eating around 35% of token-generation time; instead of making every compute unit wait at a broad barrier, each unit waits only for the exact data it needs. On AMD MI300X, they also map memory access around the chiplet layout, because memory latency changes depending on which die makes the request. Then their Laneformer model uses Delayed Tensor Parallelism, which lets cross-GPU communication happen in the background instead of blocking every layer.

Rohan Paul

13,282 Aufrufe • vor 5 Monaten

UC Berkeley just open-sourced FreeToken. (2–4x faster local LLM inference than Ollama) the results are wild: - Qwen3.6-35B on an 8GB GPU at 39.3 tokens/s - DeepSeek-V4-Flash 284B on a 32GB GPU at 22 tokens/s - GLM-5.2 753B on a 96GB GPU at 14.9 tokens/s a 35B model at 16-bit precision needs about 70GB just for its weights. even at 4 bits it is close to 18GB, and FreeToken serves it on an 8GB GPU. let me explain how: all three models mentioned above are Mixture-of-Experts, and that is what FreeToken takes advantage of. each layer holds hundreds of separate experts plus a small router that picks a few of them per token. Qwen3.6-35B activates roughly 3B of its 35B parameters per token. DeepSeek-V4-Flash picks 6 of 256 experts per layer, so 13B of its 284B run at a time. so compute was never the bottleneck. the weights a single step touches fit comfortably on a consumer GPU. every expert the router might pick still has to exist somewhere. they sit in system RAM, and the GPU keeps a cache of the ones the model has been using recently. so everything comes down to what happens when the router picks an expert that is not on the GPU. there are two ways to serve that miss: 1. copy it over PCIe and run it on the GPU 2. run it on the CPU, where it already lives both read from the same system memory, so they compete for one pool of bandwidth instead of adding to each other. existing engines pick one option and freeze it when the model loads. but routing changes on every token, so a fixed choice misses most of what the model asks for. FreeToken measures both bandwidths on your machine and splits each step's misses between the two paths in proportion. the GPU and CPU results then merge exactly, with no approximation. two machines with the same GPU can end up wanting opposite strategies, which I did not expect. a 5090 in a gaming desktop should push nearly everything over PCIe, while an 8GB laptop is better off computing most misses on the CPU. none of that is readable off a spec sheet, so the engine profiles it once per machine. the second half of the design is about agents. coding agents constantly rewrite their own history, and every edit normally forces thousands of tokens back through prefill. FreeToken saves its checkpoints at the exact boundaries agent frameworks cut on, so it only reprocesses the new part. its slowest first token stays under 44 seconds, while llama.cpp peaks at 232 and KTransformers at 946. it serves the OpenAI and Anthropic APIs under Apache 2.0, so Claude Code and Codex can point at it directly. releasing weights publicly decides who can download a model, not who can afford to run one. frontier open models keep shipping, and running them still assumes a rented cluster. meanwhile there are over a hundred million consumer machines with discrete GPUs sitting mostly idle. closing that gap was never a hardware problem, and work like this is what turns open weights into something you can actually use. paper: repo: almost every idea in this post, from why memory bandwidth decides the outcome to why moving weights costs more than computing on them, comes straight out of how a GPU is built. I wrote a detailed primer on that. the article is quoted below.

Akshay 🚀

346,057 Aufrufe • vor 2 Monaten

Big win for local LLM inference! This new inference engine runs LLMs 4x faster than llama.cpp: I ran Qwen3.5 9B on a base M5 MacBook Pro with three engines: - llama.cpp: 22.0 tokens/s - MLX: 25.1 tokens/s - uzu: 92.1 tokens/s The video below shows all three runs side by side. The first two numbers don't mean llama.cpp or MLX are badly built. But both are sitting right under a hard limit of local decoding. When an LLM generates text, every new token needs one full pass through the model, and that pass reads all of the model's weights from memory. A base M5 reads memory at about 153 GB/s. A 4-bit 9B model weighs about 5.2 GB. So at one token per pass, the ceiling is roughly 153 ÷ 5.2 ≈ 29 tokens/s, however fast the GPU computes. uzu gets past that ceiling by producing several tokens per pass instead of one: ↳ A small drafter (DFlash) proposes candidates for the next 16 positions at once. ↳ A tiny adapter (Weaver, 56.7M params) picks among them left to right, so the guesses form coherent text, and keeps a few alternative branches as a tree. ↳ The 9B model checks the whole tree in a single pass and keeps the longest path it agrees with. The main model still decides every token that ends up in the output. GitHub repo: (don't forget to star it 🌟) In my run, each pass of the 9B model produced 7.5 tokens on average. Ordinary decoding produces exactly 1. The weights and kernels are designed around this too. uzu ships its own 4-bit checkpoints, and on M5 chips it runs the verification step on the GPU's int8 matrix path. uzu is an open-source inference engine by Mirai Labs, written in Rust with Metal kernels. It has Swift, Python, TypeScript and Rust bindings, so the same engine runs inside a Mac or iOS app. I shared the GitHub repo above. If you want to dive deeper, my co-founder wrote a detailed breakdown of why local inference is memory-bound and how uzu's speculative decoding gets past it. Read it below.

Avi Chawla

127,683 Aufrufe • vor 17 Tagen