
BITS Pilani, Goa • making models fast and tiny @c_engines • cloud architecture @deepforestsci • ex computational biologist
Bangalore
Joined December 2020
- Tweets3.4K
- Following1.5K
- Followers1.3K
- Likes4.3K
Pinned Tweet
The fresher urge to start learning Web Development, Competitive Programming, DSA and Machine Learning all in the same week! 😭😂
Rishikesh retweeted
When we started building on-device AI, we found ourselves in an odd spot.
Almost everyone we spoke to agreed with us. Models would run locally, the phone in your pocket is a serious computer, this is where things are headed.
But when we asked who was actually building it, the list got very short. Plenty of people believed in it. Very few were doing it.
So we started an MLX community, honestly just to find the others. It was a few of us comparing notes at first. Then people kept joining, and kept bringing more people.
This time around we set up a booth at @swiftbharat, and @sabeshbharathi gave a talk on our research work. His co-speaker was Finn the Finder Guy: a model running on an iPhone, driving a LeRobot SO-101 arm.
The talk was amazing, but the booth is what stayed with me. Nobody needed convincing that on-device AI matters. They wanted to know how it works and what they could build with it.
That shift is the whole story. When we started, this was a thesis we kept defending. Now it's a problem a lot of people are working on together.
If you're building on Apple silicon, come say hi. It's a lot less lonely now.
At Swift Bharat? Go ask Finn for a selfie!!
Gave a presentation about on-device AI @swiftbharat with my very exciting co-speaker - Finn the Finder Guy!
If you’re around come check us out at our booth - and when you’re there, ask Finn to take a selfie so you can take back home a fun souvenir!
We wanted an empirical look at what reasoning effort actually buys, in accuracy and in cost. We ran four Claude models at all five effort levels on HMMT, CMIMC, HLE and GPQA (~8,500 answers).
Our picks: Fable 5.2 at low, Haiku 5.5 at high, Opus 5.5 at xhigh, Sonnet 5.5 at high.
Notably, Fable at low outscores both Opus and Sonnet at every effort level.
3
12
481
The cost-accuracy tradeoff is stark. Fable at low averages 86.3% for $4.75 per 100 questions; at max it reaches 87.3% for $39.57, an 8× increase for one point. Haiku is more striking: 78.5% at high for $0.47, but only 73.6% at max for $1.80.
Opus follows the same pattern, peaking at xhigh (86.0%, $10.93) and declining at max (84.6%, $24.30). Sonnet is the exception: max lifts it from 77.1% to 83.7%, though at 4× the cost.
1
64
1527 Tokens per second on an RTX 5090.
I’m very happy to announce one of the fastest single-user inference setups on a GPU today. The numbers below are from a single stream on one consumer GPU.
It is fully lossless. The model runs at full precision with no quantization.
It is also remarkably efficient. A million tokens use about as much energy as a light bulb does in an hour.
We’ve already taken the approach well beyond a single model. Alongside language models we’ve added support for speech recognition with OpenAI’s Whisper and Kinetic Velox, our own Indian speech model. We’re seeing promising results across Chinese, American and Indian models, with Qwen, Whisper, Gemma and Kinetic Velox, and across modalities including text, speech-to-text, text-to-speech and OCR.
We’d love to work with even more companies serving models to make their inference faster, more efficient and less expensive to run. Please reach out to me or @Kautukkundan. A full report with the complete results is next.
I loved working on this project!
The notion of a scheduler inside the kernel is something I think has great potential implications.
Once one persistent kernel pulls multiple tasks off a device-side queue, the host stops being in the loop. Now we don't have to deal with launch overhead, inter-kernel bubbles and sync round-trips.
Even CUDA graphs still leave gaps between kernels and PDL does overlap kernel setup but there's still a dependency wait. I think megakernels are the cleaner option here.
Where I think this is actually useful:
- batch-1 decode for small models, which should be memory-bound but in practice loses a big chunk to launch and sync overhead
- real-time loops with hard frame or control deadlines (robotics, games, streaming audio)
- mixed workloads like inference alongside test-time training, scheduled on the same SMs instead of fighting over the GPU
Megakernels probably won't replace big-batch serving. But there's a lot to gain in latency-critical, small-model, on-device situations.
We wanted to know how much one GPU kernel can hold.
So we built a megakernel to find out: a single CUDA kernel, launched once, running
- a game
- a smoke simulation
- a video editor
- molecular docking
- a training run
- an LLM
- the dashboard you’re seeing
60 fps, 0 late frames out of 8,631.
It shows that one GPU kernel can run many different jobs at once and decide among them itself, which keeps the urgent ones on time when the GPU is overloaded; it is a demonstration of control, not of speed.
11
386
Seriously? Preaching binary to the needs?
01010111 01100101 00100000 01100011 01101111 01110101 01101100 01100100 00100000 01101110 01100101 01110110 01100101 01110010 00100000 01110100 01110010 01110101 01101100 01111001 00100000 01101100 01100101 01100001 01110110 01100101 00100000 01100101 01100001 01100011 01101000 00100000 01101111 01110100 01101000 01100101 01110010 00101100 00100000 01100101 01110110 01100101 01101110 00100000 01101001 01100110 00100000 01110111 01100101 00100000 01110100 01110010 01101001 01100101 01100100
2
260
Rishikesh retweeted
A GPU program is normally thousands of small kernels, launched one after another by the CPU. A megakernel is launched once and stays resident. Its 340 workers take jobs from a scheduler that lives on the GPU itself. The host only sends input and copies finished frames out.
The four 60 fps jobs each have a 16.7 ms deadline, and not one frame missed it. The LLM (343 tokens/s), the training run (1,585 steps/s) and the docking search use the time left over.
We wanted to know how much one GPU kernel can hold.
So we built a megakernel to find out: a single CUDA kernel, launched once, running
- a game
- a smoke simulation
- a video editor
- molecular docking
- a training run
- an LLM
- the dashboard you’re seeing
60 fps, 0 late frames out of 8,631.
It shows that one GPU kernel can run many different jobs at once and decide among them itself, which keeps the urgent ones on time when the GPU is overloaded; it is a demonstration of control, not of speed.
A GPU program is normally thousands of small kernels, launched one after another by the CPU. A megakernel is launched once and stays resident. Its 340 workers take jobs from a scheduler that lives on the GPU itself. The host only sends input and copies finished frames out.
The four 60 fps jobs each have a 16.7 ms deadline, and not one frame missed it. The LLM (343 tokens/s), the training run (1,585 steps/s) and the docking search use the time left over.
Can an AI Agent directly edit program binaries in some sort of useful way? (HexSpace Programming: A fun experiment)
We ran 5 different experiments with positive results
Claude fixed an SQLite bug without seeing a single line of SQLite’s source code. It edited 6 bytes of raw machine code.
SQLite's developers fixed this same bug on Oct 27, 2026, after the model's training data ends. Their one-line C fix and the agent's 3 instructions compute the same condition, and their regression test fails on the original binary and passes on the patched one.
Here’s how 🧵
It got a 2 MB compiled binary, no source, no function names, and one query SQLite answers wrong.
The bug: for a one-item list, SQLite takes a shortcut and turns x IN (A) into x = A. It's meant to skip that shortcut when A carries its own "ignore case" label. But it only checked A's outer layer, so wrapping A in a harmless + hid the label, and 'abc' suddenly matched 'ABC'.
The agent read the query plan, traced the problem to 3 instructions in the parser, and rewrote them to check "is there a COLLATE anywhere inside?" instead of "is the outer layer a COLLATE?". 6 bytes changed.
I ran 4 more tasks the same way, with a fresh agent each time:
• Lua: t[1<2] threw an error. The compiler left the comparison as a jump instead of turning it into true/false before using it as a key. The agent added the missing check in spare space in the file header. 18 bytes, same check as Lua 5.4.8’s fix.
• jq: --indent 0 crammed everything onto one line, because the code treated 0 as “off”. The whole bug was one instruction, and the agent replaced it with a no-op. 4 bytes, same change as jq 1.8.0.
• jq: raise the nesting limit from 256 to 10,000. Not a bug, a deliberate limit. 9,999 doesn’t fit in a single ARM compare instruction, so the agent wrote a 3-instruction helper. 20 bytes, and it behaves identically to jq 1.8.1 on 19/19 held-out inputs.
• zstd: “make it faster, without changing the output”. It found zstd uses only 3 worker threads by default on this 15-core Mac, and made it use all of them. 2.1× faster, byte-identical output. 46 bytes.
All 5 passed tests they had never seen, with no regressions in our checks.
1
89
How it worked: each agent got the stripped binary, a short description of the change, disassemblers (otool, objdump, lldb), Python to write the bytes by hand, and 40–60 runs of the program. No source, no internet, no compiler, no automated patch search. Grading came afterwards, on held-out tests.
Some caveats in my experiment design:
• One run per task, so no success rate.
• Agents weren’t sandboxed. That they followed the rules rests on their logs, which we audited.
• The zstd speedup costs 37% more CPU time and equals the existing -T0 flag.
This is not how anyone should fix software. If you have the source, use it. It’s a probe of how well models read machine code, and on these 5 tasks the answer was: well enough to find the few instructions that matter and rewrite them correctly.
1
39
Here's more about our Speech-to-Text Megakernel that’s faster than vLLM.
A Whisper-large-v3 decode step is hundreds of kernels. CUDA graphs remove the CPU launch cost, but the GPU still runs them back to back. Each kernel drains before the next starts, and this leaves the memory bandwidth sitting idle at every boundary.
We fuse the whole step into one kernel. The latest version also ships with continuous batching.
2.21 ms per token vs 2.83 for vLLM. 295 ms vs 384 ms end to end. 🧵
With one user, decoding is limited by memory, not compute. Every step streams about 1.85 GB of weights.
As we know, CUDA graphs remove the CPU overhead, but memory still sits idle at every kernel boundary, and there are hundreds per step. In one kernel there’s no stop-and-start between layers. Blocks sync at a cheap barrier, and the ones that finish early prefetch the next weights into cache.
1
2
382
The fun part: once the whole step is your own code, you can add work inside it almost for free. We put a drafter in the kernel that guesses the next tokens, and the model checks them in the same pass. Output stays bit-for-bit identical because every reduction runs in a fixed order.
We would like to cite AlpinDale’s 5090 megakernel and Hazy Research’s “No Bubbles” as inspiration here.
blog.alpindale.net/posts/509…
hazyresearch.stanford.edu/bl…
Megakernels also have huge energy implications that our team is now benchmarking, more on that soon.
4
316














