<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Arunav Pathak</title>
    <description>The latest articles on DEV Community by Arunav Pathak (@pathakarunav123).</description>
    <link>https://dev.to/pathakarunav123</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4190239%2F3bf843d3-0cf2-4f72-8730-aae986e6a08d.png</url>
      <title>DEV Community: Arunav Pathak</title>
      <link>https://dev.to/pathakarunav123</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pathakarunav123"/>
    <language>en</language>
    <item>
      <title>Project EREN: My Journey to Building a CUDA-Powered LLM Inference Engine</title>
      <dc:creator>Arunav Pathak</dc:creator>
      <pubDate>Thu, 22 Oct 2026 15:30:55 +0000</pubDate>
      <link>https://dev.to/pathakarunav123/project-eren-my-journey-to-building-a-cuda-powered-llm-inference-engine-h24</link>
      <guid>https://dev.to/pathakarunav123/project-eren-my-journey-to-building-a-cuda-powered-llm-inference-engine-h24</guid>
      <description>&lt;p&gt;Hey DEV Community! 👋&lt;/p&gt;

&lt;p&gt;This is my first post here, and I'm excited to share a project I've recently started working on.&lt;/p&gt;

&lt;p&gt;I'm a Computer Science undergraduate interested in GPU programming, high-performance computing, and the systems behind large language models.&lt;/p&gt;

&lt;p&gt;Over the past few months, I've been learning CUDA and exploring how GPUs execute parallel workloads. Eventually, that curiosity led me to a bigger question:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What would it take to build an LLM inference engine from scratch?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Not just load a model through an existing inference framework, but actually understand and implement the components responsible for running it.&lt;/p&gt;

&lt;p&gt;That's how Project EREN started.&lt;/p&gt;

&lt;p&gt;What is Project EREN?&lt;/p&gt;

&lt;p&gt;EREN is my attempt to build a CUDA-accelerated LLM inference engine from the ground up, using C++ and CUDA.&lt;/p&gt;

&lt;p&gt;The initial development target is my NVIDIA RTX 4060 Laptop GPU with 8 GB of VRAM.&lt;/p&gt;

&lt;p&gt;I'll start with a small decoder-only transformer such as GPT-2, establish correctness, and gradually work toward more capable models and efficient inference.&lt;/p&gt;

&lt;p&gt;My long-term goal is to support multiple concurrent inference requests with high throughput, while understanding the underlying GPU kernels, memory management, scheduling, and execution strategies.&lt;/p&gt;

&lt;p&gt;Eventually, I want EREN to serve as the inference backend for a RAG-based AI agent.&lt;/p&gt;

&lt;p&gt;This isn't about competing with mature inference engines right away. It's about learning how these systems work by building one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why build an inference engine from scratch?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Libraries like PyTorch and established inference runtimes make running language models surprisingly accessible.&lt;/p&gt;

&lt;p&gt;But I wanted to understand what happens underneath those abstractions.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;How are transformer operations mapped onto GPU kernels?&lt;/p&gt;

&lt;p&gt;What happens to model weights and intermediate activations in GPU memory?&lt;/p&gt;

&lt;p&gt;How does autoregressive token generation work internally?&lt;/p&gt;

&lt;p&gt;Why do memory bandwidth and kernel launch overhead matter during inference?&lt;/p&gt;

&lt;p&gt;How can an engine efficiently serve multiple requests on a resource-constrained GPU?&lt;/p&gt;

&lt;p&gt;Instead of only reading about these concepts, I want to implement, test, benchmark, and optimize them myself.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Technology stack&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;My current development environment includes:&lt;/p&gt;

&lt;p&gt;Language: C++17 and CUDA C++&lt;/p&gt;

&lt;p&gt;GPU: NVIDIA GeForce RTX 4060 Laptop GPU (8 GB)&lt;/p&gt;

&lt;p&gt;Environment: Ubuntu on WSL2&lt;/p&gt;

&lt;p&gt;Build system: CMake&lt;/p&gt;

&lt;p&gt;Testing: CTest&lt;/p&gt;

&lt;p&gt;Reference implementation (upcoming): Python, PyTorch, and Hugging Face Transformers&lt;/p&gt;

&lt;p&gt;The core inference runtime will be implemented in C++ and CUDA. Python and PyTorch will initially help validate correctness against a trusted reference.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Progress so far: Phase 0&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;My first milestone was establishing a reliable C++/CUDA development foundation.&lt;/p&gt;

&lt;p&gt;So far, I've worked on the following components.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Project structure and build system&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Organized the repository into components for kernels, source code, headers, tests, benchmarks, and documentation.&lt;/p&gt;

&lt;p&gt;Configured CMake to build the C++ and CUDA targets.&lt;/p&gt;

&lt;p&gt;Here's a look at the current EREN project structure in VS Code:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;CUDA vector addition&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Implemented a basic vector addition kernel to validate device memory allocation, host-to-device transfers, kernel launches, and result verification.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;GPU reduction&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Implemented a shared-memory, multi-stage reduction baseline.&lt;/p&gt;

&lt;p&gt;This was an important exercise in understanding parallel reduction and coordinating work across thread blocks.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;CUDA error handling&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Created a reusable CUDA error-checking helper to make runtime failures easier to identify and debug.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Testing and benchmark foundation&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Added smoke tests using CTest and an initial reduction benchmark target.&lt;/p&gt;

&lt;p&gt;A clean build succeeded, and all four configured tests passed.&lt;/p&gt;

&lt;p&gt;Here's the actual Ubuntu terminal output from the EREN development environment, showing the build and test results:&lt;/p&gt;

&lt;p&gt;The inference engine itself isn't operational yet. This milestone establishes the foundation for the next stage.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What's next?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I'm developing EREN in phases rather than jumping straight into optimized kernels.&lt;/p&gt;

&lt;p&gt;Phase 1 — Python/PyTorch reference implementation&lt;/p&gt;

&lt;p&gt;I'll begin with GPT-2, study its forward pass, inspect its weights and tensor shapes, and generate reference outputs for correctness testing.&lt;/p&gt;

&lt;p&gt;Phase 2 — First CUDA inference implementation&lt;/p&gt;

&lt;p&gt;Implement the initial CUDA operators and connect them into a complete GPT-2 forward pass.&lt;/p&gt;

&lt;p&gt;Later phases — Optimization and serving&lt;/p&gt;

&lt;p&gt;Explore optimized matrix multiplication, quantization, GPU profiling, memory management, batching, concurrent requests, and inference scheduling.&lt;/p&gt;

&lt;p&gt;The aim is to progress from a correct implementation toward a measurable, efficient inference runtime.&lt;/p&gt;

&lt;p&gt;Why I'm documenting this publicly&lt;/p&gt;

&lt;p&gt;I want this series to be more than a collection of project announcements.&lt;/p&gt;

&lt;p&gt;As I progress, I'll share:&lt;/p&gt;

&lt;p&gt;What I'm implementing and why&lt;/p&gt;

&lt;p&gt;CUDA concepts and engineering decisions&lt;/p&gt;

&lt;p&gt;Bugs, failed experiments, and lessons learned&lt;/p&gt;

&lt;p&gt;Benchmarks and performance comparisons&lt;/p&gt;

&lt;p&gt;Design tradeoffs and improvements&lt;/p&gt;

&lt;p&gt;I'll also try to distinguish between what works, what I've measured, and what I'm still experimenting with.&lt;/p&gt;

&lt;p&gt;Final thoughts&lt;/p&gt;

&lt;p&gt;EREN is still at an early stage, and there's a lot left to learn.&lt;/p&gt;

&lt;p&gt;But that's exactly why I want to document the process from the beginning.&lt;/p&gt;

&lt;p&gt;If you're interested in CUDA, GPU computing, LLM inference, or systems programming, I'd love to exchange ideas and learn from your experiences.&lt;/p&gt;

&lt;p&gt;Next up: Building a GPT-2 reference implementation in PyTorch before moving into CUDA inference.&lt;/p&gt;

&lt;p&gt;Thanks for reading! &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub Repository:&lt;/strong&gt; &lt;a href="https://github.com/pathakarunav123/Eren" rel="noopener noreferrer"&gt;Project EREN&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr4nq9lbae2kkntpmcxbq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr4nq9lbae2kkntpmcxbq.png" alt="Ubuntu terminal showing EREN build and test results" width="799" height="398"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpbqy1sr4gy4krz4dvy5y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpbqy1sr4gy4krz4dvy5y.png" alt="EREN C++ and CUDA project structure in VS Code" width="800" height="502"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>cuda</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
