Skip to content
View Prajwal7-2002's full-sized avatar

Block or report Prajwal7-2002

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. 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
Prajwal7-2002/README.md

Prajwal Pujari

AI/ML Systems & High-Performance Inference Engineer

Building continuous-batching LLM runtimes, Paged KV-cache memory allocators, sub-byte bit-packers, and empirical serving benchmarks from first principles.

HuggingFace Profile PyPI Profile Portfolio Engineering Notes LinkedIn WhatsApp Email


Hardware-Measured Runtimes · Honest Benchmarks · Client-Side Interactive Studios
Empirical roofline modeling, zero-copy physical block gathering, and verified cryptographic provenance.
Portfolio Health: 529 tests passed, 0 failed (6 skipped) in CI across 9 core repositories.


🌐 Live Hugging Face Interactive Studios (0ms Cold Start, 100% Client-Side)

All studios are deployed as permanent, zero-cold-start static web applications on Hugging Face Spaces (sdk: static) with interactive client-side execution:

Studio Space Link Interactive Capabilities
streamspec prajwalpujari16/streamspec Speculative Layer-Streaming Studio: Live memory bus Gantt simulator (AirLLM 1-token crawl vs StreamSpec batched GEMM), double-buffered prefetch pipeline inspector, and Williams Roofline capacity CAD.
token-atlas prajwalpujari16/token-atlas Multilingual Token Inflation Tax Explorer: 52-language FLORES-200 inflation matrix & token fertility multipliers (published benchmark: GPT-4 and GPT-4o), multi-domain benchmarks, and cost router.
infersize prajwalpujari16/infersize LLM Capacity Planning CAD: Pre-flight analytical VRAM sizing, multi-GPU comparison matrix, speculative decoding latency sizer, and optional cost calculation when --rate is provided.
quantbench prajwalpujari16/quantbench Sub-Byte Quantization Studio: measured quality-vs-compression Pareto frontier (Qwen2.5-0.5B, RTX 3050), live BitNet 1.58b / INT4 / 2:4 sparsity bit-packing registers, and measured per-layer sensitivity.
sched-sim prajwalpujari16/sched-sim Discrete-Event Serving Scheduler: Animated Gantt player demonstrating Head-of-Line prefill blocking vs. Sarathi Chunked Prefill ($C=512$), SJF, and Disaggregated serving.
mini-infer prajwalpujari16/mini-infer PagedAttention GPU Memory Pool: Interactive virtual block table allocator, copy-on-write radix prefix caching simulator, and speculative decoding acceptance verifier.
runsonmine prajwalpujari16/runsonmine Measured Consumer Silicon LLM Registry: 8 validated result files (24 concurrency rows) on Dual Tesla T4 & RTX 3050 Laptop, concurrency scaling curves ($c=1 \to 8$), and contributor PR workflow.

📦 Hugging Face Benchmark Datasets

Dataset Hub Link Verified Contents
token-atlas-benchmark prajwalpujari16/token-atlas-benchmark 52-language FLORES-200 benchmark & token inflation metrics for GPT-4 and GPT-4o.
quantbench-pareto prajwalpujari16/quantbench-pareto 7 configurations measured on Qwen2.5-0.5B (RTX 3050): SQNR, size, VRAM, perplexity and decode speed, plus 28 per-layer sensitivity rows.
llm-serving-traces prajwalpujari16/llm-serving-traces 165 workload traces (synthetic + hand-written samples), 15 simulated scheduler comparisons, and 15 real-vs-simulated validation rows (RTX 3050).
consumer-silicon-benchmarks prajwalpujari16/consumer-silicon-benchmarks 8 validated result files (24 concurrency rows) on Dual Tesla T4 & RTX 3050 Laptop.

⚡ 1-Line Quick Verification

# 1. Profile local server capacity (Ollama, vLLM, llama.cpp) with automated roofline tuning
pip install servebench && servebench quick

# 2. Pre-flight analytical capacity planning & multi-GPU matrix (no GPU needed)
pip install infersize && infersize compare --model qwen2.5-7b --quant fp16

# 3. Continuous-batching inference runtime with Paged KV-cache (pure PyTorch, zero C++ build steps)
pip install mini-infer

# 4. Discrete-event serving simulator with Radix prefix caching & chunked prefill
pip install sched-sim && sched-sim run --scheduler chunked --token-budget 512

# 5. From-scratch quantization engine & Pareto evaluation benchmark (INT4/INT8/FP8/BitNet 1.58b)
pip install quantbench-engine && quantbench pack-inspect --format int4

# 6. Multilingual token inflation tax analyzer across 52 languages
pip install token-atlas-engine && token-atlas compare --text "Hello world"

# 7. Asynchronous Speculative Layer-Streaming for 70B & DeepSeek-R1 on consumer VRAM
pip install streamspec && streamspec demo

📌 Systems Engineering Flagship Matrix

Flagship Core Architecture Empirical Silicon Numbers Release & Provenance
streamspec Asynchronous Speculative Layer-Streaming engine for 70B & DeepSeek-R1 models on consumer VRAM (8–16 GB). Fast in-memory draft scout (0.5B), double-buffered async prefetcher (>90% bus overlap), zero-extra-sweep round optimization, online dynamic adaptive K controller, single-pass batched GEMM sweeps, Multi-Head Latent Attention (MLA) latent KV compression, and exact Leviathan distribution verification. • 1.85x fewer weight sweeps (Qwen2.5 1.5B + 0.5B draft, measured)
• 93.9% prefetch overlap (measured, CUDA)
• ~7x MLA KV reduction (test config)
• 14/14 tests pass (100%)
PyPI
HF Space
Open In Colab
CI
mini-infer Lightweight continuous-batching LLM runtime in pure PyTorch for Qwen2.5. Iteration-level dynamic scheduler, Paged KV-cache with sub-byte INT4/FP8 compression, radix prefix caching, and Leviathan speculative verifier. • 27.0 tok/s at c=4 vs 11.7 before batching (RTX 3050, 12 requests/level)
• 2.04 Tok/Joule (13.2 W)
• -72.7% KV-cache size with INT4 (calculated)
• 70/70 tests pass (100%)
PyPI
HF Space
Docs
servebench LLM serving capacity load-tester, auto-tuning harness (servebench tune), and RunsOnMine result collector (servebench submit). Multi-trial repeats with 95% CIs and synchronized NVML GPU telemetry. • Warns when p99 rests on <100 samples
• MBU roofline profiling
• Slot/Queue/Bandwidth diagnostics
• 170/170 tests pass
PyPI
Sigstore
Docs
quantbench Unified from-scratch quantization engine (INT4/INT8/FP8/BitNet 1.58b), vectorized sub-byte packing, Ampere 2:4 structured sparsity, dynamic QuantLinear layers, and dual-metric Pareto evaluation benchmark. • INT4: 2.08x smaller on Qwen2.5-0.5B (+21% perplexity, measured)
• 3.5x INT4 per layer (theoretical)
• 47 pass · 6 skipped (95% cov)
PyPI
HF Space
HF Dataset
Docs
sched-sim Discrete-event LLM serving simulator with first-principles roofline latency models, SGLang-style Radix prefix caching, Sarathi chunked prefill, and Perfetto trace visualizer. • Held-out validation on real runs: TPOT within ±12% on 6/7 Ollama rows
• TTFT prediction still off for larger models (results)
• 45/45 tests pass (87% cov)
PyPI
HF Space
HF Dataset
Docs
infersize Pre-flight analytical performance modeling, multi-GPU comparison matrix, speculative decoding sizer, and optional unit cost with explicit --rate input. Interactive Web Studio, NVML hardware fit verifier, and dynamic Hugging Face Hub ingestion. • ~10–20 ms per comparison on a laptop CPU
• Leave-one-out error < 15% on 3 RTX 3050 Ollama models
• 60/60 tests pass (89% cov)
• No GPU required
PyPI
HF Space
Docs
token-atlas Universal multilingual tokenizer efficiency benchmark & global linguistic inflation atlas. Analyzes 52 languages, multi-domain benchmarks (Code, Indentation, Tool Schemas), cost router, and prompt minifier. • 52 languages analyzed
• GPT-4 & GPT-4o in published benchmark
• 43/43 tests pass (94% cov)
• 0ms interactive playground
PyPI
HF Space
HF Dataset
Docs
runsonmine Community database of measured (not estimated) LLM inference speeds on real consumer silicon (laptops, desktops, Macs). • 8 result files (24 concurrency rows) across 2 GPUs
• 26/26 tests pass
HF Space
HF Dataset
GitHub
EdgeSLM Air-gapped document sensitivity classifier and Tier-1 DLP secret scanner for edge CPU inference. • 26 HF downloads (v3, all-time)
• 6.7× dynamic batching
• 51/51 tests pass (100%)
HF Model
Docs

🧩 Upstream Contributions (Merged)

Production bugfixes and architectural patches merged into leading LLM SDKs, inference engines, and quantization runtimes:

  • ModelCloud/GPTQModel:
    • #5175 — Bounded token-row activation capture and streaming reservoir for AWQ & ParoQuant, eliminating linear host RAM explosion during calibration (#5137).
    • #4399 — Omitted forced offload_state_dict to prevent unintended TMPDIR disk copies during model loading (#4385).
    • #4145 — Preserved Bloom AWQ module forward replay inputs (residual, alibi, mask) and reject unsafe norm folds.
    • #4142 — Scoped deterministic PyTorch algorithms in GPU weighted k-means (VPTQ).
    • #4096 — Repaired hf_repack_layer and hf_pack_layer GPTQ v1 qzero bit-packing alignment.
    • #4029 — Standardized multi-EOS stop lists, tokenizer output unpacking, and OpenAI/vLLM request parsing.
  • mozilla-ai/any-llm:
    • #1650 — Replaced @abstractmethod completion/embedding converter stubs on AnyLLM with non-abstract NotImplementedError defaults, eliminating boilerplate stubs across capability-restricted providers (#1486).

🔬 Engineering Approach & Systems Insights

I believe that engineering credibility is built by documenting trade-offs, architectural failures, and hardware bounds alongside performance gains:

  • Naive KV-Allocation Fails Under Dynamic Lengths:
    Pre-allocating contiguous buffers for a 2,048-token worst case reserves 24 MB of KV cache per request on Qwen2.5-0.5B (bf16), even for a 48-token reply. Fixed 16-token physical block pools with virtual-to-physical block tables in pure PyTorch allocate memory as sequences grow: about 0.56 MB for that reply, 97.7% less (calculated from tensor sizes).
  • Unbatched Iteration Bottlenecks on DRAM Memory Bandwidth:
    Stepping concurrent sequences through serial model calls forced the GPU to stream model weights from DRAM 4 separate times per step (capping decode at 11.7 tok/s on an RTX 3050). Switching to zero-copy physical block gathering streams weights exactly once per step across all sequences, jumping throughput to 27.0 tok/s (+130.8%) and delivering 2.04 Tok/Joule.
  • Head-of-Line Prefill Starvation Under Continuous Batching:
    In FCFS continuous batching, a long prompt's prefill takes over whole steps, so active decoding streams stall. In a sched-sim simulation (A100 preset, RAG workload), Sarathi-style Chunked Prefill ($C=512$) cut worst-case decode latency (TPOT p99) from 131.7 ms to 51.7 ms versus FCFS, while the median rose from 39.2 to 49.6 ms: smoother decoding, not faster decoding (simulated, not measured).
  • Memory Savings Are Not Speed Savings Without Fused Kernels:
    On Qwen2.5-0.5B (RTX 3050), quantbench INT4 shrank the model from 958 MB to 461 MB but raised perplexity +21% and ran at 0.18x bf16 speed, because the reference runtime dequantizes full weights every forward pass. Post-hoc ternary quantization destroyed the model entirely. Bandwidth savings need fused dequant-matmul kernels.
  • No Cherry-Picked Latency Metrics:
    Single-run p99 latency spikes are statistically deceptive without sufficient sample size. servebench warns when a p99 rests on fewer than 100 requests (it then approximates the sample maximum), and reports 95% confidence intervals across multi-trial repeats.

📝 Engineering Notes & Deep Dives


🛠️ Technical Competencies & Systems Stack

Runtime Systems   : Paged KV-Cache Allocators · Continuous Batching · Radix Prefix Caching · Speculative Decoding · Discrete-Event Simulation
Silicon Profiling : Roofline MBU Modeling · NVML Telemetry · Saturation Knee Detection · TTFT / ITL / TPOT Analysis
Core Stack        : PyTorch (SDPA, Tensor Gathers) · Python 3.10+ · CUDA / NVML · ONNX Runtime INT4 · Hugging Face
Quantization      : Symmetric AbsMax · INT4 Blockwise · BitNet 1.58b Ternary · Ampere 2:4 Structured Sparsity · SmoothQuant · AWQ / GPTQ
Serving & Infra   : FastAPI · Asyncio / Aiohttp · SSE Streaming · vLLM · Ollama · Docker · GitHub Actions CI/CD
Security & Trust  : PyPI Trusted Publishers (OIDC) · Sigstore Cryptographic Attestation · Zero-Secret Airgap DLP

📫 Connect & Collaborate

Pinned Loading

  1. servebench servebench Public

    Benchmark your local LLM server (Ollama, vLLM, any OpenAI-compatible API) in one command: how many users your GPU can serve, time to first token, tokens/s, p99.

    HTML 5

  2. mini-infer mini-infer Public

    Minimal, educational continuous-batching LLM inference engine with Paged KV-cache, prefix caching, and speculative decoding for Qwen2.5 in pure PyTorch.

    Python 5

  3. sched-sim sched-sim Public

    High-fidelity discrete-event simulator for LLM serving schedulers with first-principles roofline models, SGLang-style Radix prefix caching, and Perfetto trace export.

    Python 3

  4. EdgeSLM EdgeSLM Public

    Document-sensitivity classifier (PUBLIC / INTERNAL / CONFIDENTIAL / RESTRICTED): LoRA-tuned Qwen2.5-0.5B, 4-bit ONNX for laptop CPUs, measured honestly with baselines, contrast sets and significanc…

    Python 4

  5. menmo-frontend menmo-frontend Public

    Chat with your documents and get answers that cite their sources. Next.js + TypeScript + Tailwind frontend for Menmo.

    TypeScript 3

  6. menmo-backend menmo-backend Public

    Menmo backend: Django REST API for chatting with your documents. RAG with Pinecone, hybrid search and a Groq LLM, deployed with Docker on Hugging Face Spaces.

    Python 3