meillaya
ESSAYS NOTES ARCHIVE ABOUT

Explore

QUICK ACTIONS

Search→Browse Tags→

NAVIGATION

EssaysNotesArchiveAbout

Technical Writings and Posts

Collection of all my blog articles related to computer science

Constructing a Lox Interpreter in Rust

March 31, 2025

Read article →

Reward Hacking in Reinforcement Learning

February 2, 2025

Reward shaping in RL is challenging. Reward hacking occurs when an RL agent exploits flaws or ambiguities in the reward function to obtain high rewards without genuinely learning the intended behaviors or completing the task as designed. In recent years, several related concepts have been proposed, all referring to some form of reward hacking

Read article →

Constructing and Optimizing a C Compiler in Rust

November 2, 2024

Building a compiler in Rust involves parsing source code into an AST, performing semantic analysis, and generating optimized machine code through techniques like constant folding, dead code elimination, and loop unrolling. The optimization phase transforms the intermediate representation to produce faster executables while preserving program behavior

Read article →

How to Optimize a CUDA Matmul Kernel for cuBLAS-like Performance: a Worklog

September 2, 2024

In this post, I’ll iteratively optimize an implementation of matrix multiplication written in CUDA. My goal is not to build a cuBLAS replacement, but to deeply understand the most important performance characteristics of the GPUs that are used for modern deep learning. This includes coalescing global memory accesses, shared memory caching and occupancy optimizations, among others.

Read article →

Optimizing Neural Network Performance

August 2, 2024

Numpy can multiply two 1024x1024 matrices on a 4-core Intel CPU in ~8ms. This is incredibly fast, considering this boils down to 18 FLOPs / core / cycle, with a cycle taking a third of a nanosecond. Numpy does this using a highly optimized BLAS implementation.

Read article →