max fu

96 posts

max fu banner
max fu

max fu

@maxxfuu

learning model perf one epoch at a time…

san francisco, ca Katılım Mayıs 2024
559 Takip Edilen1K Takipçiler
max fu
max fu@maxxfuu·
@jaygala223 1. I use your app by the way! I'm trying to learn Telegu on the side with it! 2. I haven't thought about triton. I was thinking of PTX instead. But yes, go for a PR!
English
1
0
1
24
Jay | Indilingo
Jay | Indilingo@jaygala223·
@maxxfuu This is so cool 😍 Are you planning to add dsl support? Happy to open a PR for adding triton support
English
1
0
1
40
max fu
max fu@maxxfuu·
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 visualkernels.com 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 visualkernels.com, 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 visualkernels.com. 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 .
English
6
4
107
3.1K
max fu
max fu@maxxfuu·
Yes there's vim
English
0
0
1
140
max fu
max fu@maxxfuu·
@0xluffy you’re gonna have the most anabolic protein farts🤯
English
0
0
0
120
luffy
luffy@0xluffy·
4 american dollars for 365kcal 55g protein
luffy tweet media
English
5
0
65
5.3K
Adel Bucetta
Adel Bucetta@adelbucetta·
@maxxfuu that's still just scratching the surface of what's possible with gpu-accelerated simulations
English
1
0
0
109
max fu
max fu@maxxfuu·
Day 8/90 of Inference Engineering I built a visual interactive simulation of warp scheduling on a GPU SM. It models one SM with 8 resident warps, and all context is held within the 256 KB register file. You can click to inject a cache miss and then watch the stalled warp park with a live countdown. The scheduler moves to the next ready warp on the same tick. Showing that nothing is saved or restored. I'm pretty sure it's roughly 400 cycles measured on Volta. I built this to show how warp switching is free, which is how GPUs hide memory latency with parallelism instead of large caches. I am also struggling really hard to write the backward pass for the MNIST classifier in C. It's easy to understand math. But when it comes to implementing the matmul where each of the matrices is represented as a 1D vector; the implementation becomes so much more difficult. I starred at the for-loop and traced the code while visualizing each step in my head. I want to finish this properly so I can write CUDA again!
English
5
15
183
7.8K
max fu
max fu@maxxfuu·
@okwilkins I’m taking your advice! Will update you when I succeed 💯😤
English
1
0
1
163
Oli Wilkins
Oli Wilkins@okwilkins·
@maxxfuu Cool stuff! I also struggled with flattening matrices/tensors too. Going through the first 6 chapters of PPMP and doing the exercises there helped me to build the mental model needed. It becomes much easier.
English
1
0
0
182
max fu
max fu@maxxfuu·
Day 7/90 of Inference Engineering I built a PyTorch MNIST classifier so that I can practice going through the stages of benchmarking, profiling, and optimizing in CUDA. Anyways, check out this animation that I made. It resembles the H100 SXM5 Module with 132 SM, 8 GPC, and 5 HBM3! For the next 7 days, I want to:  - Finish this mini MNIST CUDA project  - Build a Transformer with CUDA kernel for inference, with CUDA-Python binding pipeline - Go through chapters 1-6 within PMPP Cheers to the first week!
max fu tweet mediamax fu tweet media
English
7
5
124
5K
max fu retweetledi
Joshua Hill
Joshua Hill@the_joshua_hill·
Some teaser results for a new quantization method we've been cooking up🧑‍🍳 GLM 5.2 is getting even faster
Joshua Hill tweet mediaJoshua Hill tweet media
English
34
25
525
270.5K
max fu
max fu@maxxfuu·
Day 6/90 of Inference Engineering I wrote a CUDA kernel for 1D Convolution, just getting the reps in for writing unoptimized boring but correct CUDA! I also read PagedAttention (2312.07104), watched 1 short lecture on GPU Memory, and hack squatted 455lb x6 and 495lb x3 as a top set! Heres what I've learned about PagedAttention: PagedAttention reduces internal fragmentation and solves external fragmentation. During the decode phase, the KV cache manager actually hands out one cache block at a time to store output tokens. If the output tokens overflows the cache block, the KV cache manager assigns a new cache block to hold the remaining tokens that didn't fit into the previous cache block. What ends up happening is that the VRAM is used effectively such that each cache block is filled before new cache block is allocated on the VRAM. In a naive KV cache implementation, memory is reserved up front for the maximum sequence length, which might not ever be used, meaning there is just a massive chunk of VRAM that's not touched. PagedAttention reduces internal fragmentation by ensuring memory is never wasted between each decode sequence. To make usage of memory even more efficient, any unique prompts that share the same prefix tokens, the KV cache manager allows them to share the same cache block, however, it writes to a new cache block starting from where the new tokens differ within the two prompts. While each decode phase effectively writes to random parts of the VRAM, the Block table is able to provide an abstraction that makes KV cache seem like a contiguous memory to the model. Making the allocation process as simple as checking if a cache block is full or not. This continuous practice of using cache blocks to allocate just enough memory and using a block table to allocate non-contiguous free scattered memory on the VRAM reduces internal fragmentation and solves external fragmentation. --- Watched a video on GPU Memory: youtube.com/watch?v=Zrbw0z… I read this blog that made absolutely cemented everything, written by (@hamzaelshafie): hamzaelshafie.bearblog.dev/paged-attentio…
YouTube video
YouTube
max fu tweet mediamax fu tweet media
English
10
6
216
7.7K
max fu
max fu@maxxfuu·
@highperfcache @skydotcs @pangram haha, i was sad at first because i thought that he thought my writing sounded too robotic. but then again, each reflection takes about 1 hour, so it’s high quality human slop. this is the best yall are gonna get 😌
English
0
0
1
19
pdawg
pdawg@prathamgrv·
career update: my time at my dream job, Microsoft, has come to an end. i'm going full time as founder at @tensortonic. started as a pet project for myself in a private repo. now it powers thousands of people writing ML and GPU code daily, closing in on 50K users. i went all in because the ceiling kept moving. inbounds from universities, edtech platforms, companies wanting it for their engineers. people proudly sharing on linkedin, X, instagram. none of which i sought out, which made the decision feel easy. is it a kaggle competitor? leetcode for ML? a cloud IDE? it's been called all three, and i'm not in a hurry to explain it. more soon.
pdawg tweet media
English
135
17
1.6K
48.9K
maharshi
maharshi@maharshii·
i have nothing to post, i think i fell off deleting my account in 3…. 2….
English
13
1
59
6.2K
max fu
max fu@maxxfuu·
@SzymonOzog_ oh my god i didn’t know you’re simon oz on yt!
English
0
0
0
116
SzymonOzog
SzymonOzog@SzymonOzog_·
Saturday reading: "What happens when you run a CUDA kernel" - very cool blogpost on the details about the CPU<->GPU communications required for lauching a kernel
SzymonOzog tweet media
English
10
67
712
63.9K
max fu
max fu@maxxfuu·
@skydotcs @pangram im putting my reputation on the line and documenting everything. theres a higher chance of you seeing human slop than AI slop LOL
English
1
0
1
36