
max fu
@maxxfuu • 3,399 subscribers
writing gpu kernels…
Shorts
Videos

Day 14/90 of Inference Engineering I didn't finish the MNIST in CUDA project today, which made me hesitant to post since I didn't want to put out some slop. But in the spirit of being consistent and showing up, here's a concept I've revisited today now that I've started writing CUDA again. This is an animation on the CUDA memory life cycle. Generally speaking, when writing CUDA, memory management goes through the following stages: 1. Allocate memory on the host 2.Initialize / populate the memory 3.Allocate device memory 4.Copy host data to the device 5. Launch the kernel 6. Copy device data back to the host 7. Free the memory - On a brief reflection, I'm starting to write the matmul kernels in CUDA instead of in C. So this in itself is another paradigm shift in thinking. Excited to hone my technique over the coming week. I'll update you guys when I've completed the project; otherwise I'll just make a post like usual on what I've learned during the day!
max fu42,808 просмотров • 1 месяц назад

Day 9/90 of Inference Engineering I built a visualization tool for CUDA kernels and C code to view the buffers for each step through. Check out Yesterday, I was terramogged by a simple implementation of a basic matmul between three matrices in 1D vector form. There were essentially three 1D vectors, each vector representing a corresponding matrix (A, B, C). In the implementation, each matrix is just just a pointer to the first element of a 1D array. You are to compute the output matrix through A^T @ B and store it in C. This morning I built a visualizer to help me see and understand why the triple for-loops work the way they do. In the coming days, I’m confident I can make sense as well as backpropagation! As for it does not include a built-in compiler. It's just an interpreter; the visualization shows exactly what the code does, bugs included. The main thing I wanted to visualize is matmul with a triple for-loop between a sequential program to that of a parallel one. Expect bugs and other inconsistencies within I’ll polish this mini-project in the coming days. As for the rest of today, I’ll be trying to understand backpropagation in C and CUDA .
max fu12,746 просмотров • 1 месяц назад
Больше нет контента для загрузки