Skip to content
View amankarki151's full-sized avatar

Block or report amankarki151

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Content in all repositories owned by your account will be closed.
Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. Markdown is supported. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
amankarki151/README.md

Aman Karki

Software Engineer · C++ / CUDA · LLM Inference · Systems

Portfolio LinkedIn Resume Email Blog



C++20 CUDA Python CMake Linux Docker GitHub Actions FastAPI SQLite PyPI

I write C++ and CUDA, mostly for LLM inference. I build systems from the ground up, check them against a trusted reference, and publish the numbers, including the ones that don't flatter me.


2 merged PRs

CUDA backend of
llama.cpp (100K+ ★)

28 tok/s

decode on a T4 from
my own CUDA kernels

3e-5

max logit error
vs HuggingFace

583 µs

p50 at 95.4% recall,
my own HNSW index

Note

Three systems built from scratch (an LLM inference engine, a vector database and a code analyzer) and two CUDA kernels merged into llama.cpp, one merged by the project's creator, Georgi Gerganov.


🔧 Open source

llama.cpp 2 PRs merged ongoing

Contributing to the CUDA backend since Aug 2026.

PR What it does How it was verified Status
#27573 New CUDA kernel for POOL_1D (average and max), closing a gap in GPU operator coverage Every kernel size, stride and padding combination: 216 cases on two T4s ✅ Merged by Georgi Gerganov
#28897 i16/i32 for GGML_OP_DUP on CUDA. Both were silently falling back to the CPU: fixed the capability check and added the missing i16 path Full backend suite: 16,097/16,097 passing, zero regressions ✅ Approved by Georgi Gerganov, merged by am17an

🚀 Projects

#ProjectWhat it isHeadline result
01verbum.cppLLM inference engine in C++20 & CUDA, from scratch28 tok/s on T4 · 3e-5 vs HF
02LatticeEmbedded vector database with a hand-written HNSW index583 µs p50 @ 95.4% recall
03RAAGParallel C++ code analyzer with AI refactoring guardrails3.69x on 8 cores · 1.1M AST nodes

01 · verbum.cpp

LLM inference engine, from scratch  ·  C++20 CUDA Python

Runs Qwen3-0.6B end to end in C++20 and CUDA, with no PyTorch and no existing runtime. The safetensors loader, BPE tokenizer, grouped-query attention, RoPE, SwiGLU, KV cache and sampling are all hand-written.

flowchart LR
    A[safetensors<br/>weights] --> B[BPE<br/>tokenizer]
    B --> C[Embedding]
    C --> D["28 x decoder layer<br/>RMSNorm · GQA attention · RoPE<br/>KV cache · SwiGLU"]
    D --> E[LM head]
    E --> F[Sampling]
    F -->|next token| B
    D -.->|CUDA kernels| G[(T4 GPU)]
Loading

verbum.cpp demo

Result
Correctness Logits match HuggingFace to 3e-5. Diffing against that reference caught 5 silent bugs (RoPE convention, GQA mapping, KV-cache offsets) that gave wrong output without crashing
Speed CUDA kernels (tiled matmul, RMSNorm, RoPE, SwiGLU, attention decode) decode at 28 tok/s on a T4, 38x over CPU on the same machine, ~25% of the memory-bandwidth roofline
Memory Per-row INT8: 3.99x smaller weight matrices, all 196 tensors under 1.3% error, identical greedy output. Also found a duplicate lm_head wasting 622 MB

Repo Demo Writeup


02 · Lattice

Embedded vector database  ·  C++20 HNSW Python

A vector database you link against, closer to SQLite than to a service. HNSW index, WAL storage engine, crash recovery and quantization, all written from scratch in C++20.

Result
Search 583 µs p50 at 95.4% recall on SIFT10K, 1.3 ms p50 on SIFT1M. HNSW is 9.4x faster than brute force at 50K vectors
Storage WAL with crash recovery, mmap segment files, atomic checkpoints. Concurrent path clean under ThreadSanitizer
Honesty Benchmarked against Qdrant and Chroma, with the losses published too (build time is the big one)
Shipping On PyPI as pylattice-db. 30 GoogleTest cases, CI that fails on benchmark regressions

Repo Demo Writeup PyPI


03 · RAAG

Architectural analytics platform  ·  C++20 Python GraphRAG

Parses a codebase, builds its real dependency graph, and limits AI-assisted refactoring to the code a change can actually reach.

RAAG CI gate blocking a pull request

Result
Parsing Parallel C++20 Tree-sitter parser on a std::jthread pool: 3.69x on 8 cores, 1.1M AST nodes from 579 files, zero failures
Analysis Coupling, instability and cohesion across 913 dependency edges in nlohmann/json and fmt. Found a class in fmt with an LCOM4 of 55
Guardrails GraphRAG scoped to a change's blast radius. A GitHub Actions gate blocks risky PRs (above: a real one it blocked). 307 tests, 86% coverage
Shipping VS Code extension that wraps the same CLI, so the editor and CI always agree

Repo Demo Writeup VS Code extension


🧰 Skills

Languages C++20 · CUDA · Python · SQL
GPU & performance CUDA kernels · shared-memory tiling · roofline analysis · INT8 quantization · benchmarking · multithreading (std::jthread, std::atomic)
LLM inference KV cache · grouped-query attention · RoPE · RMSNorm · SwiGLU · BPE tokenization · sampling · safetensors · llama.cpp/ggml · HuggingFace Transformers
Vector search & RAG HNSW · scalar quantization · write-ahead logging · mmap storage · Qdrant · Chroma · RAG · GraphRAG
Backend & tools CMake · Linux · Git · Docker · GitHub Actions · pybind11 · GoogleTest · ThreadSanitizer · Tree-sitter · FastAPI · SQLite · PyPI
CS fundamentals Data structures & algorithms · OOP · SOLID · design patterns · low-level design

✍️ Writing

Nine articles on Hashnode, also republished on Medium via Stackademic. Each one covers a real bug or a real measurement.

Show all articles

verbum.cpp

Lattice

RAAG


🧭 How I work

Tip

  • Diff against a reference. If there's a trusted implementation, I compare against it number for number before I believe my own output.
  • Measure on the same machine. A speedup across two different computers isn't a speedup.
  • Publish the honest number. If my system loses a benchmark, the loss goes in the README next to the win.

Currently: GPU performance work in open-source LLM inference engines.

Software Engineer (Independent) since Dec 2025 · B.Tech CSE, UPES (2024) · Before engineering, a year making music full-time.

itsamankarki@gmail.com · LinkedIn · Portfolio

Pinned Loading

  1. llama.cpp llama.cpp Public

    Forked from ggml-org/llama.cpp

    LLM inference in C/C++

    C++

  2. verbum.cpp verbum.cpp Public

    LLM inference engine written from scratch in C++ and CUDA -- verified against real HuggingFace output, with INT8 quantization, a CUDA backend, and a demo NPC whose memory is backed by Lattice, a ve…

    C++

  3. lattice lattice Public

    An embedded vector database written from scratch in C++ — HNSW index, WAL-backed storage, benchmarked against Qdrant and Chroma

    C++ 1

  4. RAAG RAAG Public

    Parses a codebase, measures its coupling and cohesion, and scopes AI refactoring suggestions to exactly what a change can reach. C++ extraction, Python analytics, GraphRAG retrieval, CI-gated.

    Python