4 ms·
>Most programmers have an intimate understanding of CPUs maybe this article is brilliant, but when the first line is something so blatantly untrue it really ma
by permo-w 3y ago
>Most programmers have an intimate understanding of CPUs
maybe this article is brilliant, but when the first line is something so blatantly untrue it really makes it hard to take the rest seriously
- anonporridge 3y agoDefinitely not true about most programmers, but maybe the author meant CS educated engineers. Going through a formal CS program will give you an intimate understanding of CPUs, especially when compared to the very light coverage of GPUs.
- croes 3y agoMaybe a generation thing, I remember reading Michael Abrash's Graphics Programming Black Book and learning a lot about cycle eaters in the CPU.
- usea 3y ago> Going through a formal CS program will give you an intimate understanding of CPUs I did an undergrad in CS, where I did well. I don't feel like I understand CPUs very well. Certainly not anywhere in the realm of "intimate."
- galangalalgol 3y agoAre most programmers self trained now? I can see if someone self trains for fe or even full stack with an eye on compensation, they wouldn't understand program counters and the like. But so many people seem motivated by video games to get into the industry that I'd expect them to be reading about things like the fast inverse square root or similar.
- crooked-v 3y agoA lot of game dev now happens in high-level engines, often with their own extra layer of scripting engine. Even working on the nitty-gritty of spatial logic rather than using engine-based colliders/detection would be pretty rare.
- galangalalgol 3y agoSo are we really losing knowledge or just specializing ever more down the fractal?
- c2lsZW50 3y agoI believe the answer is depends, but there were some interesting discussions today under an article which relates to this. https://news.ycombinator.com/item?id=37965142 https://news.ycombinator.com/item?id=37965142
- hombre_fatal 3y agoI think it's just that you don't need to be intimate with lower level details to deliver more value at higher levels like game and application dev. If your day to day involves "intimate knowledge with the CPU" and bumping program counters, I can rule out a lot of things that you probably aren't building, like a compelling iOS app or forum HTTP server, for example. Maybe you're doing impressive work on emulators or something though. But it's nothing to get pompous about just because other people don't share that interest. We too easily go off careening into a circlejerk.
- tester756 3y ago"Going through a formal CS program will give you an intimate understanding of CPUs and 101 other hilarious jokes you can tell yourself!"
- chpatrick 3y agoDepends on the university! In my school to pass the computer architecture course you had to read and present a recent paper on CPU design.
- PeterisP 3y agoWhich most of these students will have entirely forgotten a few years after graduation - use it or lose it.
- tantalor 3y agoThat's a lot to ask of an undergrad
- latency-guy2 3y agoMaybe a modern one for a degree mill that cares not for breadth or depth. It really shouldn't be otherwise. I'm very confident in people having the ability to read by the time they are in college. And considering that summarizing a research paper doesn't even have to be perfect, plus very little need to scrutinize the experiment itself, undergrads should be able to do that. Otherwise they don't belong in college.
- pezezin 3y agoIn my school we had to implement a toy 16-bit CPU in VHDL.
- PartiallyTyped 3y agoSame! Fun times in the labs!
- p1esk 3y agoGoing through a formal CS program will give you an intimate understanding of CPUs Please tell me you forgot the /s. I have a PhD in computer engineering from a top-20 school in US. Took a bunch of grad level classes, passed the quals (my specialty was ML accelerators). I do NOT have an “intimate understanding of CPUs”. I probably know a little bit more about CPUs than an average programmer. Which is very little. Modern CPUs are extremely complex. Almost as much of impenetrable black boxes as modern neural networks.
- gmadsen 3y agoI think the intention of the phrase, is that most cs programs include a systems course. you will learn von neumann arch, with cpu including {registers, clock, ALUs, etc}. Obviously modern CPUs have a lot more complexity, but even the basic coverage of CPUs is more coverage than GPUS.
- p1esk 3y agoEverything you learn about CPUs in your CS undergrad program is applicable to GPUs. Both are examples of von Neumann architecture, both have registers, ALUs, ISA, instruction schedulers, cache hierarchy, external DRAM, etc. The main difference is how they are being used - GPU, while a general purpose computer, is typically used as an accelerator for specific workloads, and it needs CPU to function. The distinction between the two is getting blurred as GPUs get better at executing control flows, and CPUs get more cores and wider vector operations.
- jandrewrogers 3y agoFor anyone that needs to know how a CPU works for performance engineering similar to a GPU, the details of the microarchitecture matter a lot even within the same ISA. I am not aware of any formal CS program that teaches anyone the nuanced internals of various microarchitecture designs. Everyone I know with this knowledge appears to be self-taught regardless of where they went to school. I think the descriptor “intimate” is overstating the case if you don’t know how to optimize code on different implementations of the same ISA. Most formal CS programs give you a generic understanding of CPUs, more like a survey course, not enough information to do serious optimization.
- pca006132 3y agoI am really curious about what kind of optimizations are enabled when you know the microarchitectural design of various CPUs, but without writing assembly by hand. I only know the basics such as optimizing data structure for better cache locality, add some fast paths, manual unrolling, but have no idea about how to work around things like pipeline stalls. It would be really helpful if you can point to some materials about this!
- jandrewrogers 3y agoThe basic principle is that a CPU core is a complex distributed system with varying degrees of parallelism, concurrency, and latency as all of these components communicate with each other. The design of this distributed system varies across microarchitectures as do the available features. Analyzing the optimal codegen is similar to analyzing optimal algorithm design in higher level distributed systems with a fixed hardware specification. Compilers are good at finding very local optimizations targeting specific microarchitectures. If you use godbolt and switch out the architecture flags you can see how the codegen changes. However, as with higher level code, the compiler can’t rewrite your data structures or see patterns spread across too much code. As a simple example, modern cores have 4+ concurrent ALUs with different capabilities. Some of those ALUs are usually idle if there are not enough independent instructions or independent instructions are too far away from the current instruction. You can see large performance improvements simply by reorganizing your C code so that the compiler and CPU can see more opportunities to use more ALUs in parallel. Interestingly, a lot of these code changes are trivial no-ops at the code semantics level, but they bring the ALU concurrency opportunity within view of the CPU. There is an active niche community on the Internet that studies how various instruction sequences interact with various microarchitectures. This is probably the best resource because a lot of detail is not well documented by the CPU companies themselves. It requires a fair amount of experimentation to develop an intuition for how code will run on a given CPU at this level of detail.
- kalak 3y agofeels very much like https://xkcd.com/2501/ https://xkcd.com/2501/
- PTOB 3y agoTry this on: "A non-trivial number of Computer Scientists, Computer Engineers, Electrical Engineers, and hobbyists have ..." Took some philosophy courses for fun in college. I developed a reading skill there that lets me forgive certain statements by improving them instead of dismissing them. My brain now automatically translates over-generalizations and even outright falsehoods into rationally-nearby true statements. As the argument unfolds, those ideas are reconfigured until the entire piece can be evaluated as logically coherent. The upshot is that any time I read a crappy article, I'm left with a new batch of true and false premises or claims about topics I'm interested in. And thus my mental world expands.
- smokel 3y agoThat's a refreshing take. I tried real hard to understand what some continental philosophers, such as Latour, Deleuze, and Žižek are on about, giving some of their texts quite some benefit of the doubt. After about ten years of doing so, I am more and more returning to my previous opinion that some of these just like to talk, and even though they have lots to say, they say so much, that I still have to do all the actual philosophizing myself.
- salawat 3y agoThe Ur subject of philosophy is not the writing and reading of philosophy, but to exercise the mind in coming to grips with that which we have no conception of yet. Language is it's medium, and the IO is those texts. However the nugget at the center is figuring out that magic blackbox that lets you take all the dead ends in those texts and divine a reasonable guiding principle or recognition of an end to the space of tread discourse. To that end, you have to approach philosophical reading with a degree of hypothetical detachment that not everyone is immediately comfortable with.
- crooked-v 3y agoThe Tao Te Ching opens with almost exactly that subject... though, of course, it also makes you think about it a while first to understand what it's getting at.
- ashu 3y agoAnd this is the most insightful thing you had to say about this?! Pfft.
- twixfel 3y agoI don't understand why every other submission on the internet has to have at least one "stopped reading at X" comment relating to it. It adds absolutely nothing.
- abadpoli 3y agoIt provides feedback to the author, and it also has generated quite a significant discussion here about the topic. It could have been worded more constructively sure, but given that the entire point of this website is to have discussions about the material posted, I think it’s added quite a bit.
- squeaky-clean 3y agoIt hasn't really generated any discussion about the topic at hand though. Just people discussing what they learned or didn't learn about CPUs in school.
- deleted 3y ago[deleted]
- permo-w 3y agoI regret the way I phrased it. it's snarky and not in the spirit of curiosity, but I do think it's worth discussing that the author thinks that most programmers know how a CPU works
- rjh29 3y agoI learned it both in my degree and the Structure and Interpretation of Computer Programs course (which I recommend to anyone interested in low level computing)
- moritzwarhier 3y agoI think at least 50% of the answers of this would depend on how one defines "intimate understanding"... I learned basic facts about CPU architectures at university, know in a very basic way the landscape of things and occasionaly stumble upon updates to my limited knowledge... but by no means would I say that, rather like "a basic understanding of how CPUs work / are designed / are to be used" (?) If I were proficient in assembler, maybe I'd claim to have an "intimate understanding" of how to use CPUs at a low level (still sounds a bit braggy) It still is not the same though as being an expert in CPU/GPU design. So yeah I agree. Article is interesting though, esp. the diagram!
- njacobs5074 3y agoAgree that saying "intimate understanding" is a bit off the mark. Had the author written "intuitive understanding", it would have made a bit more sense. However, given the prevalence of the von Neumann computing architecture, I don't think it's completely off the mark - even if people don't know von Neumann's name :)