Keras on PyTorch: compiled generation 11.6x faster
Traced why Keras on PyTorch ran about 9x slower than plain PyTorch, and merged the fixes upstream, one root cause each.
Experience
Each role, then the work from it. Cards are the projects worth opening; the rest is listed below them.
Now on XProf, the open-source profiling tool for machine learning. Before that, on Keras and KerasHub.
Traced why Keras on PyTorch ran about 9x slower than plain PyTorch, and merged the fixes upstream, one root cause each.
Built the LiteRT export path in Keras and KerasHub: a trained model to a phone-ready file in one call, on TensorFlow and PyTorch.
Wrote the end-to-end UI test suite for XProf, the open-source ML profiler, with 107 browser tests and a side-by-side check of two builds.
Implemented Llama 3.1 in KerasHub and fixed Gemma 3 bugs, including a preprocessor crash across Gemma 3, 3n and 4.
Built the benchmarking system for all Keras and KerasHub models: automated weekly runs across GPU and TPU, the TensorFlow, JAX and PyTorch backends, presets and batch sizes, to catch performance regressions.
Fixed TPU attention, N-D attention inputs, nested weight saving, masks, call-context leaks and ONNX export of models over 1.5 GB. · Merged
Designed model-parallel layout maps for KerasHub LLMs, from Gemma and Qwen to Llama and Mixtral; proposed upstream, not merged. · Proposed, not merged
Led the migration of a major internal customer from legacy Keras to Keras 3, with backward compatibility and performance parity. · Built
Fixed the layers that kept KerasHub models such as ESM, PARSeq and Flux from exporting to LiteRT. · Merged
Built one call from a KerasHub LLM to a LiteRT-LM bundle with tokenizer and prefill and decode signatures; proposed upstream, not merged. · Proposed, not merged
Qualcomm
On-device AI for Snapdragon phones.
Redesigned a generative inpainting feature, object removal and image completion, so its models fit NPU and DSP latency budgets for the Snapdragon Summit demo.
Made deep-learning models run 3x faster on the Snapdragon NPU and DSP, and cut memory bandwidth 75% with quantization-aware training.
Detection, tracking and segmentation pipelines in C++ with INT8 quantization and pruning, and ML inside the native camera stack for a voice-controlled camera assistant. · Built
Samsung R&D Institute India
Computer vision, biometrics and on-device AI, plus the apps, portals and servers around them.
Read 90%+ of damaged barcodes correctly on its damaged test set, where a commercial scanning SDK read 70%, with models trained on 10M+ synthetic images.
A multi-face recognition engine at 99.2% accuracy and 30+ FPS on edge devices, with face search cut from 1,200 ms to 87 ms.
Replaced a deep-learning drop detector of millions of parameters with sensor features and a model of under 22, saving over 95% of the power.
Told which hand holds a phone, right 90%+ of the time over 30+ seconds, and who holds it, without deep learning.
A phone that detects a car crash from its sensors and sends an SOS to chosen contacts.
Detects whether a person at a screen is attentive or distracted, at 87% accuracy; checks across frames cut false alarms by 40%.
An anti-cheat exam platform used for 2,000+ employees across 100+ tests, with 60% less administrative overhead.
Prototyped shadow removal and noise reduction for document scanning on phones. · Research
Optimized models for the Exynos NPU with TensorFlow Lite, for 2.5x faster inference. · Built
Samsung R&D Institute India
Learned Android in Java and Kotlin, and joined full time in July 2022.
A prototype that shifts the eyes toward the camera in video calls, using facial landmarks and geometric transforms. · Prototype
Real-time classification and detection on Android at 25+ FPS with quantized MobileNet and EfficientNet models through NNAPI. · Built
Trained CycleGAN models in PyTorch for image-to-image translation and avatars, deployed with TFLite, and generative face models with StyleGAN and StarGAN. · Built
An independent research lab, an LLM served from one GPU, and the tools built along the way.
Served a 181 GiB mixture-of-experts LLM from one 96 GiB GPU and took decoding from 10.8 to 15.0 tokens/s shipped, 16.5 at peak.
An Android app and guide that run KerasHub models on the phone with LiteRT, from one export call to six working screens.
Automated trading on Indian stocks, where a strategy counts only if it beats an index fund after real costs and tax.
Shows which open-source projects reply to, review and merge a stranger's pull request, so contributors spend their effort where it will land.
Runs local LLMs on one GPU workstation, switching models with one command behind one OpenAI-compatible endpoint, with a live dashboard.
Education, certificates and awards are on their own page.