Machine Learning Engineer · LLM Training & Inference Infrastructure
I make LLM training and inference cheaper and more reliable: I measure why large runs fail, hang and spike,
fix it in the kernels, compilers and libraries underneath, and report how sure each answer is.
Merged upstream: DeepSpeed #9124, #9123 · TransformerEngine #3935
Under review: vLLM, Triton, Megatron-LM, TransformerEngine, DeepSpeed, Liger-Kernel, FlashInfer, PhysicsNeMo, Ray, torchao, NVRx
| Project | Pull request | What it fixed |
|---|---|---|
| DeepSpeed | #9124 merged 23 Nov 2026 |
HybridEngineRollout crashed when generating under torch.autocast (#9102). I traced the real cause: rotary embeddings promote keys back to fp32 while values stay bf16, so the KV caches rejected the write. The fix casts incoming keys and values to the cache dtype (a no-op when they already match, so graph capture is unchanged) and prefills full-attention models into a DeepSpeed cache that is sized for tensor-parallel KV heads. Fixes Llama, Qwen2/Qwen3, Mixtral, Phi-3 and GPT-NeoX; 30 rollout scenarios without autocast produce identical tokens to master. New unit tests included |
| #9123 merged 1 Dec 2026 |
Three CPU unit tests hard-coded the same port and collided under parallel CI. Each now gets its own port | |
| TransformerEngine | #3900 → #3935 merged 2 Dec 2026 |
Docs: the installation guide named the wrong environment variable for the CUDA include directory. Maintainers folded it into their batch of community fixes with my authorship kept |
Nineteen more pull requests are open as of 3 December 2026. Code fixes ship with tests.
| Project | Pull request | What it does |
|---|---|---|
| vLLM | #70956 | Speculative decoding gave wrong tokens for Bailing V2.5 models (Ling-2.6-flash, Ring-2.5) on Model Runner V2: a hard-coded builder list had dropped Bailing, so verification rows were built as prefills. Passes the metadata, keeps short prompts on the prefill path, and lets each attention builder declare support so none can be dropped silently. The end-to-end test fails on main and passes with the fix, and full CUDA graphs stay on: 1.5–2.4× lower latency on an A100 than the fallback proposed elsewhere |
| #70958 | With prefix caching on a Mamba or hybrid model and a draft model, a prefill that could not fit a whole Mamba block in one step hung the engine forever. Sizes the block-aligned split by the per-request budget. The end-to-end test times out at 900 s on main and passes in about 2 minutes with the fix (A100 and T1000) | |
| Triton | #12883 | tl.topk and tl.sort changed the dtype of inputs narrower than 32 bits depending on k: uint8 came back as int32 and fp16/bf16 as fp32 (#12861). Casts the result back. Measured on H100 and T1000: PTX identical to main in 36 of 36 configs when the result is stored, timing within 1.5% |
| #12882 | Docs: gives tl.sort a public docstring and documents how NaN and signed zeros behave in its sorting network (#12860) |
|
| Megatron-LM | #9950 | On the native torch.optim fallback, DistributedOptimizer.load_state_dict() gave every parameter the same step tensor, so after a checkpoint load the step advanced once per parameter per optimizer step and Adam's bias correction was silently wrong for the rest of the run. Clones the step per parameter |
| TransformerEngine | #3977 | Grouped NVFP4 Hadamard-transform cast fusion computed member offsets in 32 bits; past 2^31 elements, rows were quantized with the wrong tensor's amax (#3971). Computes the offsets in 64 bits |
| DeepSpeed | #9213 | With transformers main, the kernels-hub decorator wraps apply_rotary_pos_emb in a module, so DeepSpeed's fused-RoPE installer stopped recognizing it and patched nothing; this broke the nightly torch-latest run (#9209). Unwraps the decorated function before matching |
| #9214 | The ZeRO-2 CPU-offload grad-accumulation test never reached an accumulation boundary and only checked that a norm changed, so it passed on wrong gradients. Now compares each boundary against the exact window sum (part of #8957) | |
| #9122 | Warns when save_checkpoint writes into a tag that already has files |
|
| Liger-Kernel | #1657 | cross_entropy=True rebound torch.nn.functional.cross_entropy process-wide and broke unrelated 3-D and soft-target calls (#1639, confirmed on B300 by another user). Scopes the patch to transformers' loss_utils and falls back to PyTorch for unsupported calls |
| #1750 | Fused linear cross-entropy left weight.grad and bias.grad as None when the input was frozen (linear probing, frozen backbone) (#1704). Gates each gradient on its own tensor |
|
| #1751 | PolyNorm crashed in backward with a (1,)-shaped bias (#1709). Returns the bias gradient in the bias's shape |
|
| FlashInfer | #9748 | Opt-in check that checkpoint_cu_starts is given in checkpoint units for GDN prefill |
| PhysicsNeMo | #2353 | DiT built its detokenizer for hidden_size inputs, so any conditioning embedder with a different output size (edm, zero, ...) failed on the first forward pass (#2330) |
| #2355 | Lets the Muon optimizer take parameters that stack several matrices, such as per-head latent queries [H, M, D], by orthogonalizing each matrix in one batched Newton-Schulz call (#2304) |
|
| Ray | #68773 | After ray.shutdown() and a second ray.init() under a chaining signal handler, absl's failure handler was reinstalled and a crash signal looped between handlers forever (#68711) |
| #68772 | Bumps the bundled jackson-databind to 2.18.12 for a CVE (#68765) |
|
| NVRx | #548 | A closed shared-memory checkpoint queue raised an ImportError at interpreter shutdown, and closing an old queue could unregister a newer queue's drain (#423). Offered to fold into a parallel proposal |
| torchao | #5142 | Docs: fixes the remaining documentation build warnings |
Triton layout fix: a chained fp32 division feeding a reduction emitted 4,128 div.full.f32 instructions instead of about 64, because layout resolution picked a fully replicated layout. My fix (#11117, root-cause write-up in triton-10987-layout-fix) went stale with merge conflicts, and I closed it in November 2026 to stay within Triton's limit on open PRs from outside contributors.
vLLM: diagnosed the Aria garbage-output bug at tensor-parallel size > 1 (#49122) as a double all-reduce of shared-expert output and verified a fix on CPU. Upstream resolved it by moving Aria to the Transformers backend (#59767), so my PR #49366 was closed. My MiniCPM-SALA port (#48999) adds a ~9.5B hybrid model (24 linear-attention + 8 GQA layers; +1,630 lines, 34 CPU-only test cases). Its greedy tokens and logprobs match the Hugging Face reference on an A100, including an 8,306-token prompt, and TP=1/2/4 give identical tokens on 4× RTX 4090 (logs). The upstream PR was closed; the port and validation logs are in vLLM-HybridAttn.
| Project | Question | Result |
|---|---|---|
| LLM Training Reliability survival analysis · PyTorch DDP |
How often do large training runs fail, and how often should they checkpoint? | OPT-175B logbook: 50 unplanned interruptions in 56 days on 992 GPUs. Per-job hazards are Weibull with shape about 0.5–0.6, so a per-GPU-hour MTBF is the wrong planning unit. A tuned Daly schedule beats OPT's 80-minute schedule by 0.97 points of goodput at a 10 s checkpoint cost and 2.9 points at 10 min, with bootstrap CIs |
| spikewatch e-processes · conformal p-values |
Can a loss-spike alarm guarantee its false-alarm rate? | On 1.7M steps of AI2 OLMo telemetry: 54 of 71 held-out spikes caught at a 4.7% pooled false-alarm rate, where the common 7σ rule hits 74–97%. The pre-registered target was not met (one series at 5.6%, 13% flagged before onset), and the repo says so |
| Scaling laws with honest uncertainty bootstrap · multiverse analysis |
How many tokens per parameter is compute-optimal, and how sure can we be? | 23 for Pythia (95% CI 6–94), 21 for Chinchilla (15–28). The usual i.i.d. checkpoint bootstrap covers the true value only 64% of the time; resampling whole model sizes covers it 94% |
The pattern across these: write a NumPy or float64 reference first, make it the correctness oracle, gate the kernel against it, and keep the suite runnable on CPU-only CI.
| Project | Result |
|---|---|
| INT4 KV-cache quantization in CUDA, Triton and Pallas CUDA · Triton · JAX/Pallas · H100 |
Llama-2-7B keys compressed 3.56× for +0.29% perplexity, inside a quality gate set before measuring; 0.40 ms decode attention on H100; 154 tests. Found that compiled Pallas kernels race on GPU, so that path is refused by design |
| Certified sparse attention PyTorch · Transformers · 2× H100 |
Detects, without labels, when sparse KV-cache compression silently degrades output (AUC 0.71–0.75 at 7B on Qwen2.5 and Mistral) and turns it into an anytime-valid bound. Hypotheses pre-registered with kill criteria; 88 tests |
| losscolumn Triton · CUDA · NCCL · Blackwell |
A benchmarking standard where every result first prints where the method loses. Block-sparse FlashAttention kernel, NCCL/gloo collective harness at world sizes 2–8. Found a factor-of-world-size error in an all_gather bandwidth formula; 770 tests |
| PagedKV-Fusion CUDA · INT8 paged attention |
KV-cache eviction 1.71 ms → 0.56 ms at 16K blocks (~3×); INT8 paged decode attention at ~50% of FP16 KV memory |
| GPU stall attribution Kineto · CUPTI · fault injection |
Names which of nine causes left a training GPU idle, scored against injected faults as a confusion matrix (0.99 accuracy on synthetic traces; the hardware sweep has not been run yet). 230 tests |
- Real-Time Feature Store — a production-readiness audit that surfaced five real concurrency bugs, each reproduced and given a regression test. Parquet read-modify-write lost 174/200 records under 8 concurrent writers; the online store applied last-write-wins by arrival order instead of
event_time. - Agentic Verification Triage System — regression-failure triage: parses logs into failure signatures, clusters related failures, drafts prioritized bugs, and runs a critic pass to suppress false positives.
- KubeInfer — Helm chart for multi-replica vLLM on Kubernetes: session-affinity routing for KV reuse, queue-depth autoscaling on
vllm:num_requests_waitingrather than CPU, NetworkPolicy, RBAC, 12 Prometheus alert rules. - LLM-HDL-Bench — 46-module SystemVerilog benchmark that requires agreement from two independent tools (Yosys + Icarus) before a result counts. Reports 46/46 after one human edge-case fix and 45/46 with that fix reverted.
Because "seems better" and "is better" are different claims.
- Quasi-Experimental Causal Platform — staggered rollouts: naive TWFE difference-in-differences shows +15.6% GMV but fails the parallel-trends test; cohort-robust estimates with not-yet-treated controls give about +7.2%.
- A/B Test Guardrail Metrics — SRM gating, pre-registered metrics, Holm correction validated against the statsmodels reference, applied to three public experiments.
- Toxic Content Prevalence & Intervention Impact — weighted difference-in-differences on 45.6M Reddit comments. Reports the label-noise sensitivity that exceeds the point estimate rather than burying it.
- Causal Inference Toolkit — DiD, Synthetic Control and BSTS behind one API with ground-truth validation and placebo tests. Surfaces 69% cross-method disagreement instead of averaging incompatible answers.
Every metric on this page comes from a committed artifact in the public repository it links to. Where something is unmeasured or missed its target, the repo says so, and pending work is labeled as pending rather than done.
AI Engineer, Developer Tooling & Semiconductor Automation at SwanTech AI
M.S. Applied Data Science, University of San Diego · GPA 3.9
Open to Machine Learning Engineer, ML Infrastructure and Applied Scientist roles · apatil@sandiego.edu · LinkedIn

