DEV Community

Cover image for Certified kernels, guaranteed at install time
Hocine Benkelaya
Hocine Benkelaya

Posted on

Certified kernels, guaranteed at install time

Most GPU inference stacks find their kernel settings on your machine: the first time a new shape shows up, they stop, try block sizes, warp counts and pipeline stages, time them and keep the fastest. The result depends on your machine's mood at that moment.

NeuroBrix took the other road. Kernel settings are certified once per GPU class, checked against a float64 reference, and shipped inside the package. The fast path you get is the one we measured.

That raises a question few projects ask: how do you guarantee that what reaches a user's machine is complete? With the newest NeuroBrix, the answer is a release gate.

The build refuses an incomplete package

Every file the certified kernel tables need is tracked. When a release is built, the build checks the package against that list, and a package missing a single tracked file is refused. It never reaches PyPI. A pip install neurobrix therefore carries the certified tables, by construction, not by luck.

The engine refuses to guess

The second half of the guarantee lives at run time. If a table the engine expects is not there, NeuroBrix refuses to run on it and names what is missing, instead of silently falling back to guesswork. You either get the certified path or a clear message, never a quiet downgrade.

The same family as the V100 tensor cores

This is the same spirit as our work on the 2017 V100: its tensor cores sat unused on the Triton path, and NeuroBrix brought them back to life with its own kernels (the full story). On those V100s, our Triton engine beat the same model through PyTorch's kernels in 30 of 36 model-and-card pairs, up to 3.64x, every run reading its settings from the certified directory, none tuned during the measurement.

Fast kernels are half the work. Making sure every install gets them is the other half.

Try it

pip install neurobrix
neurobrix doctor
neurobrix import TinyLlama/TinyLlama-1.1B-Chat-v1.0 --accept-license
neurobrix run --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 --prompt "Write a haiku about GPUs."
Enter fullscreen mode Exit fullscreen mode

Have a GPU class we haven't certified yet? Certify it and share it: every class certified is a class nobody autotunes again.

If this is the kind of engineering you want to see more of, a ⭐ on GitHub is the signal we read.

Top comments (0)