6 ms·
The Missing Nvidia GPU Glossary
- charles_irl 2y agoOh hey, I wrote this! Thanks for sharing it.
- byteknight 2y agoI absolutely love the look. Is it a template or custom?
- charles_irl 2y agoCustom! Took inspiration from lynx, lotus, and other classic terminal programs.
- petermcneeley 2y agoGreat work. Nice aesthetic. "These groups of threads, known as warps , are switched out on a per clock cycle basis — roughly one nanosecond. CPU thread context switches, on the other hand, take few hundred to a few thousand clock cycles" I would note that intels SMT does do something very similar (2 hw threads). Other like the xeon phi would round robin 4 threads on a single core.
- zeusk 2y agoSMT isn't that really is it? SMT allows for concurrent execution of both threads (thus independent front-end for fetch, decode especially) and certain core resources are statically partitioned unlike a warp being scheduled on SM. I'm not a graphics expert but warps seem closer to run-time/dynamic VLIW than SMT.
- petermcneeley 2y agoIn actual implementation they are very much like very wide SIMD on a CPU core. Each HW thread is a different warp as each warp can execute different instructions. This mapping is so close that translation from GPU to CPU relatively easy and performant.
- charles_irl 2y agoThanks! > intels SMT does do something very similar (2 hw threads) Yeah that's a good point. One thing I learned from looking at both hardware stacks more closely was that they aren't as different as they seem at first -- lots of the same ideas or techniques get are used, but in different ways.
- ks2048 2y agoLooks nice. I'm not sure if this is the place for it, but what I am always searching for is a very concise table of the different GPUs available with approximate compute power and costs. Lists such as wikipedia [1] are way to complicated. [1] https://en.wikipedia.org/wiki/List_of_Nvidia_graphics_processing_units https://en.wikipedia.org/wiki/List_of_Nvidia_graphics_proces...
- charles_irl 2y agoYeah, there's a tension between showing enough information to be useful for driving decisions and hiding enough information. For example, "compute capability" sounds like it'd be what you need, but it's actually more of a software versioning index :( Was thinking of splitting the difference by collecting up the quoted arithmetic (FLOP/s) and memory bandwidths from the manufacturer datasheets. But there's caveats there too, e.g. the dreaded "With sparsity" asterisk on the Tensor Core FLOP/s of recent generations.
- shihab 2y agoI was looking for a simple table recently- outlining say how the shared memory or total register size/SM varies between generations (Something like that Wiki table). It was surprisingly hard to find those info.
- MostlyAmiable 2y agoWhat was your method for drawing/generating the SM diagram?
- alberth 2y agoThank you for this. Any chance you could just make it a single long webpage (as opposed to making me click through one page at a time)? For some reason on my iPad the links don’t always work the first time I click them.
- TerraHertz 2y agoThanks! As an old (retired) programmer I was hoping a good intro to GPUs would turn up. Now, I don't suppose you could add 'ink on paper' to the color options? Gray on light gray, with medium gray highlighting, is hard on old eyes. While I never want to see P7 phosphor green again. And I suppose a zipfile of the whole thing, for local reading and archive, would be out of the question?
- K0IN 2y agoIs there a plain text / markdown / html version?
- aithrowawaycomm 2y agoI would also like to see a PDF that has all the text in one place, presented linearly. This looks like a very worthwhile read, but waiting a few seconds for two paragraphs to load is a very frustrating user experience.
- charles_irl 2y agoA few seconds is way longer than we intended! When I click around all pages after the first load in milliseconds. Do you have any script blockers, browser cache settings, or extensions that might mess with navigation? > would also like to see a PDF that has all the text in one place, presented linearly Yeah, good idea! I think a PDF with links so that it's still easy to cross-reference terms would get the best of both worlds.
- swyx 2y agobook time book time
- aithrowawaycomm 2y agoI am using Safari on iOS - I disabled private relay and tested again, still seems oddly slow. No extensions; the settings to periodically delete cookies and block popups are enabled, don't see why those would affect this. Maybe it's just HN traffic, thousands of people flipping through the first dozen or so pages. Edit: I just checked again and it didn't load at all... I also see this is on the front page again, at 5:30pm Eastern US time :) Probably HN hug of death.
- htk 2y agoI'm with you. The theme is cool for a brief blog post, but anything longer and I want out of the AS400 terminal.
- jms55 2y agoThe weird part of the programming model is that threadblocks don't map 1:1 to warps or SMs. A single threadblock executes on a single SM, but each SM has multiple warps, and the threadblock could be the size of a single warp, or larger than the combined thread count of all warps in the SM. So, how large do you make your threadblocks to get optimal SM/warp scheduling? Well it "depends" based on resource usage, divergence, etc. Basically run it, profile, switch the threadblock size, profile again, etc. Repeat on every GPU/platform (if you're programming for multiple GPU platforms and not just CUDA, like games do). It's a huge pain, and very sensitive to code changes. People new to GPU programming ask me "how big do I make the threadblock size?" and I tell them go with 64 or 128 to start, and then profile and adjust as needed. Two articles on the AMD side of things: https://gpuopen.com/learn/occupancy-explained https://gpuopen.com/learn/occupancy-explained https://gpuopen.com/learn/optimizing-gpu-occupancy-resource-usage-large-thread-groups https://gpuopen.com/learn/optimizing-gpu-occupancy-resource-...
- EarlKing 2y agoSounds like the sort of thing that would lend itself to runtime optimization.
- jms55 2y agoI'm not too informed on the details, but iirc drivers _do_ try and optimize shaders in the background, and then when ready swaps in a better version. But I doubt it does stuff like change threadgroup size, the programmer might assume a certain size and their shader would be broken if changed. Also drivers doing background work means unpredictable performance and stuttering, which developers really don't like. Someone correct me if I'm wrong, maybe drivers don't do this anymore.
- EarlKing 2y agoWell, if the user isn't going to be sharing the GPU with another task then you could push things back to install-time. In other words: At install time you conduct a benchmark on the relevant shaders, rewrite as necessary, recompile, and save the results accordingly. Now the user has a version of your shaders optimized to their particular configuration. Since installation times are already somewhat lengthy anyway you can be reasonably certain that no one is going to miss an extra minute or two needed to conduct benchmarks, especially if it results in installing optimized code.
- EarlKing 2y agoFINALLY. Nvidia's always been pretty craptacular when it comes to their documentation. It's really hard to read unless you already know their internal names for, well, just about everything.
- let_me_post_0 2y agoNvidia isn't very big on opensource either. Most CUDA libraries are still closed source. I think this might eventually be their downfall, because people want to know what they are working with. For example with PyTorch, I can profile the library against my use case and then decide to modify the official library to get some bespoke optimization. With CUDA, if I need to do that, I need to start from scratch and guess as to whether the library from the api already has such optimizations.
- einpoklum 2y agoNVIDIA does have a bunch of FOSS libraries - like CUB and Thrust (now part of CCCL). But - they tend to suffer from "not invented here" syndrome [1] ; so they seem to avoid collaboration on FOSS they don't manage/control by themselves. I have a bit of a chip on my shoulder here, since I've been trying to pitch my Modern C++ API wrappers to them for years, and even though I've gotten some appreciative comments from individuals, they have shown zero interest. https://github.com/eyalroz/cuda-api-wrappers/ https://github.com/eyalroz/cuda-api-wrappers/ There is also their driver, which is supposedly "open source", but actually none of the logic is exposed to you. Their runtime library is closed too, their management utility (nvidia-smi), their LLVM-based compiler, their profilers, their OpenCL stack :-( I must say they do have relatively extensive documentation, even if it doesn't cover everything. [1] - https://en.wikipedia.org/wiki/Not_invented_here https://en.wikipedia.org/wiki/Not_invented_here
- TerraHertz 2y agoThere's a deeper reason. Remember 3Dfx? They made the entire source code for their 3D hardware available to developers, all in C and a tiny bit of assembler. It could be easily ported to non-Wintel platforms. (I know, because I did port it to a MIPS based platform that had zero operating system. It was a poker machine.) Then 3Dfx was smashed from the inside and bought out by nVidia. Source code to 3D accellerator hardware drivers never to be seen again. Why? Because if just anybody could port 3D graphics hardware and drivers to any custom hardware and OS platform, then Microsoft, Apple, etc would rapidly be killed by something with a MUCH better GUI (3D) appearing on the market. The powers that be do NOT want capable, unchained computing systems to upset their carefully constructed 'enslavement via enshitification' schemes.
- joshdavham 2y agoIncredible work, thank you so much! This will hopefully break down more barriers to entry for newcomers wanting to work with GPUs!
- charles_irl 2y agoThanks for the kind words! I still feel like one of those newcomers myself :) Now that so many more people are running workloads, including critical ones, on GPUs, it feels much more important that a base level of knowledge and intuition is broadly disseminated -- kinda like how most engineers basically grok database index management, even if they couldn't write a high-performance B+ tree from scratch. Hope this document helps that along!
- weltensturm 2y agothat's pretty
- charles_irl 2y agoThanks! We think that just because something is deeply technical doesn't mean it has to be ugly.
- ttwwmm 2y agoDid you really have to hijack the up and down keys? I can't scroll.
- saagarjha 2y agoIt would be nice if this also included terms that are often used by Nvidia that apparently come from computer architecture (?) but are basically foreign to software engineers, like “scoreboard” or “math pipe”.
- charles_irl 2y agoGreat idea! We'll add some of those in the next round.
- hkgjjgjfjfjfjf 2y ago[dead]
- richwater 2y agocontent is cool; usability and design of the website is awful (although charming)
- germanjoey 2y agoThis is really incredible, thank you!
- einpoklum 2y agoThis has been submitted, like, five times already over the past 5 weeks: https://news.ycombinator.com/from?site=modal.com https://news.ycombinator.com/from?site=modal.com
- d3rockk 2y ago8*! And yet, this latest submission is the one that hits triple digit votes. A small proof of the randomness of virality.
- krackers 2y agoThere's a wonderful correspondence between GPU and more conventional SIMD vector terms in the P&H comp arch book. Slide 13 of https://cse.buffalo.edu/~rsridhar/cse490-590/lec/Chapter04.pdf https://cse.buffalo.edu/~rsridhar/cse490-590/lec/Chapter04.p...
- JeremyMorgan 2y agoThis is incredible. I'm gonna spend some time here. And I love the design/UI.
- 3abiton 2y agoReally great work, suggest for a next post: the VRAM requirements estimation calculation for running models locally. Especially with different architecture and different Quants, it gets always confusing and even online calculators give different answer. I never found a really good deep dive on this yet.
- pythops 2y agoAwesome <3