Why we write our own C and C++ inference engines

Posted by eatonphil 2 days ago

Counter78Comment33OpenOriginal

Comments

Comment by stephbook 9 hours ago

Should have started with writing your own blog posts.

Comment by lelanthran 6 hours ago

> Should have started with writing your own blog posts.

While the page looks vibe-coded[1], the content itself does not have any AI tells. What are the tells you are seeing?

[1] Too many sites I find on HN frontpage these days slow my PC to a crawl. I assume they are all using the same autogenerated HTML, Javascrip and CSS to make animated backgrounds :-( On this specific site scrolling is laggy.

Comment by cataphract 1 hour ago

Just from the subtitle, you can already tell it's likely AI-generated. Maybe you're lucky enough not to be exposed to claude/codex output your whole working day.

Comment by sylware 2 hours ago

Use lynx, links or netsurf. Or vibe code your noscript/basic HTML web engine?

Comment by interpol_p 5 hours ago

I stopped reading almost immediately. The stylistic choices in the writing just felt like LLM to me. Examples:

"depth estimation that beats PyTorch on CPU in half the memory" — "…beats X in Y…"

"Most LocalAI backends wrap somebody else’s engine, and that is the right default." — "…and that is the right"

"MLX and the rest are maintained by people who are better at those models than we are" — "better at those models than we are" — it's this thing that LLMs do where they are kind of weirdly confident but overly deferential

"This post is about what those ports buy" — "…buy" used in this context

"Same model, 1.31x the speed" — "Same X, something Y" — it's this overconfident yet deferential writing style

The further I read, the more tells there are. I find it incredibly tiring to read LLM generated prose and I'm not sure why. Is it because I'm aware it's not human written and have an unconscious bias? Or is it because the style is just full-on, "Not X but Y. Those performance gains are bought, not earned. This stops, that starts. Read on, or don't, that's the follow-up"

Comment by sasaf5 25 minutes ago

"Parity is what makes the replacement a drop-in rather than a migration."

It always reads like a 14 year old arguing.

Comment by MattPalmer1086 5 hours ago

For me, it's that AI writing is always trying to be clever for every single point it makes (and constantly uses the same language patterns when doing so).

Its like listening to an insufferable clever dick, who is not as bright as they think they are. You would also find it incredibly irritating if a human talked like that

Comment by layer8 5 hours ago

Also, “honest reading” — without any context explaining why one would contemplate a dishonest reading.

Comment by lelanthran 5 hours ago

Now that you point it out, there are quite a few tells, still not as many as most of the slop that gets posted here.

I think it's because of the laggy scrolling that I didn't read the whole thing anyway, just the first few screens.

Comment by nnevatie 4 hours ago

[dead]

Comment by PatronBernard 4 hours ago

Why are you using an em-dash though?

Comment by interpol_p 43 minutes ago

I've always used em-dash. I got familiar with the hotkeys when I started using Mac OS X in 2002. Option+Hyphen for en-dash, Option+Shift+Hyphen for em-dash. It's unfortunate that it's an LLM tell. I'm glad the LLMs haven't subsumed proper ellipses yet…

Comment by wonnage 6 hours ago

[flagged]

Comment by winter_blue 7 hours ago

I found the post insightful and interesting. I'm not sure it was written with AI assistance, but even if it was, I don't see that as a reason to dismiss it. For what it's worth, I spend hours everyday reading AI output and summaries.

Comment by pjmlp 6 hours ago

Same could be said for all that talk about having Claude do their work.

Comment by xienze 5 hours ago

I've had this debate before on HN. The excuses are generally "well it can write better code than most developers, but an LLM can't write better prose than most people" (I strongly disagree with this) and, what I think is at the heart of the matter, "text is for the reader to read directly, code is hidden." Or in other words, "as long as I can't tell it's AI, it's fine."

Comment by nnevatie 4 hours ago

I would rather read faulty English, succinct sentences and getting to the point, than the generic filler LLMs produce.

Comment by pjmlp 3 hours ago

I would also code review code that people actually put some effort learning on how to write it, even if it had one bug or two.

Comment by nnevatie 8 hours ago

Came here to say the same. Really tiring to read these slop-infested posts, where everything has the “right shape”.

Comment by polotics 5 hours ago

The thing is... although the writing is unmistakably full of LLMisms, I can't fault the `author` for having produced a slop readme. The content earns its keep, it only grates because of the robotic personality. We need another word than "slop" for this.

"blland", "llame",... ?

Comment by pjmlp 2 hours ago

While I am tired to see slop-infested pull requests being celebrated.

Comment by altmanaltman 8 hours ago

I went through the post because of your comment but it really doesn't look like AI slop. Can you please share why you feel like its slop and not written by a human? I can also say "should have started writing your own comments" to you and its unfalsifiable. Blanket accusations with no proof is not a good move really.

Comment by dreeseaw 36 minutes ago

"This post is about what those ports buy, measured, and what they cost."

if you've done any amount of optimizaation or hill-climbing work (kernel optimization, autoresearch type shit), you would know that these models LOVE the terms "buy" and "cost" in this sense. they use them nearly constantly (along with "budget", and even "credit" (even when working with RL/credit assignment!))

Comment by nnevatie 7 hours ago

The post is full of signs. Here's only a couple of examples:

> The method, the measurements, and what it costs us.

> That is the general shape of these wins.

> Parity is the gate, speed is the follow-up

I could go on and on, but you probably get the point. If you don't find anything funny with the above, you might have not been enough-exposed to slop.

Comment by wannabe44 7 hours ago

It's always hyping up something and throwing punch lines in every sentence. Normies love this shit.

Comment by nnevatie 6 hours ago

Yes, it’s basically business-as-usual but on speed.

Comment by altmanaltman 6 hours ago

What do you mean you could go on and on? Why do you think those sentences are AI written.

And okay, your second argument is that I just don't know slop because I am not exposed to it? But you don't know anything about me or what I am exposed.

You're just making random claims and stating they are correct without any evidence or arguments.

Comment by bendmorris 5 hours ago

What kind of evidence do you expect beyond "random claims" here?

This post is incredibly obviously AI generated, to the extent that I doubt a human author edited it at all. Not "written with AI assistance" but full on "give Claude some bullets and hit publish." It contains tons of tropes that show up in all AI writing and which people are highlighting here.

What would convince you of that?

Comment by rcarmo 5 hours ago

They follow the tropes I get when I ask AI to do docs or summaries. Very Opus style, this one.

Comment by tovlier 2 hours ago

[dead]

Comment by dennis16384 8 hours ago

I had a similar success with Model2Vec static embedder and NER inference (both GGUF, compiled for WASM), ported to plain C from ONNX Runtime.

Wasm size from 30Mb to 300kb and 1.5x speedup. It's definitely worth it for performance or distribution size.

Comment by aabdi 3 hours ago

I don’t think it would be surprising that people want to write their own kernels.

A big problem with the existing engines like llama or sd is that they don’t support optimal graph compilation. Usually this means about a real 2 or 3x multiplier loss relative to optimal. Cuda graphs do okay but they still leave a lot on the floor

It’s usually worth it to optimize in that context if you are willing to peer into the mechanics.

Of course that’s expensive. You need to know how to appropriately pipeline and merge your kernels.

Comment by scottcodie 8 hours ago

I did took a native c++ approach when writing a relational transformers engine (RelativeDB). My journey was pytorch -> c++ -> Triton (lang). While C++ was more performant than Triton, I couldn't afford to optimize on every gpu. I just accepted the ~15% throughput loss for my cloud service, which honestly wasn't bad for the amount of flexibility I got out of it.

But the cpp port of vllm looks great, that'd be great if you'll maintain that. I hit the same limitations with vllm.

Comment by piterrro 6 hours ago

Could this vllm port be faster to install? Im starting gpu machine multiple times a day and it takes 5 minutes to set vllm up. If Inise this port that time is minimized?

Comment by adithyassekhar 8 hours ago

What you get: X is the A, Y is the B.

Comment by BedVibe_Studios 1 hour ago

[flagged]

Comment by federicoTXTS 1 day ago

[flagged]

Comment by openrockets 5 hours ago

[dead]