logoalt Hacker News

k__today at 11:02 AM2 repliesview on HN

I was yesterday years old when I learned that those open weight models need custom code to run.

Somehow I expected inference engines are generic LLM runtimes that can execute any weight.

So, to get this right.

Someone trains a model.

They release the weights and a reference implementation of the model architecture.

Then a provider has to host this model either by running inference via the reference implementation, an open source implementation, or build their own.

Does this mean, providers don't just differ in quantisation and configuration, but also in inference engine implementation?


Replies

philipportnertoday at 11:37 AM

Yes. https://inferencex.semianalysis.com provides some comparisons wrt. certain cost metrics. Some commonly used ones are vLLM, TensorRT-LLM, and SGLang. These three at least are open source, and all come with an Apache 2.0 license.

Some providers also have to implement their own engines, e.g., Cerebras has their own inference serving stack for their wafer-scale chips, as does Google for their TPUs (XLA compiler).

ipietertoday at 11:31 AM

The implementation of a language model is usually good enough for running _a single forward pass_ through the model, but to host it via an inference engine you typically need to convert a few operations. For instance the MLP can be easily split across GPUs (tensor parallelism) and MoEs also have a way of parallelizing.

Most of it is pretty standard, since not that many different layers and primitives are used in LLM architectures, but once in a while something new comes along that needs more effort. MoEs are one example, they are sparse and allow for completely different inference patterns, which takes a while to figure out.

Last year I started a blogpost series about this topic (that I hope to update some time). I start from a minimal gpt implementation by Karpathy and build the engine around it, you might like it: https://pieter.ai/blog/2025/nanogpt-inference/

show 1 reply