News for hackers. Stuff that matters.
Re:What Every Developer Should Know About GPU Computing by permo-w on Saturday October 21, 2023 @02:04PM (#37969131)
>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

Re:What Every Developer Should Know About GPU Computing by PTOB on Saturday October 21, 2023 @02:30PM (#37969305)
Try 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.

Re:What Every Developer Should Know About GPU Computing by smokel on Saturday October 21, 2023 @03:12PM (#37969683)
That'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.

Re:What Every Developer Should Know About GPU Computing by salawat on Saturday October 21, 2023 @04:01PM (#37970015)
The 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.

Re:What Every Developer Should Know About GPU Computing by crooked-v on Saturday October 21, 2023 @04:49PM (#37970310)
The 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.
Re:What Every Developer Should Know About GPU Computing by runlaszlorun on Saturday October 21, 2023 @05:56PM (#37970835)
Aha, nice connection! I'm a fan of the Tao Te Ching but never would've caught that one my own. Thx!
Re:What Every Developer Should Know About GPU Computing by Karrot_Kream on Saturday October 21, 2023 @07:06PM (#37971302)
Philosophy is often called the "Great Conversation" because, as you say, a lot of it is just people "saying things". Some of these things are incredibly insightful others are just babbling, the ones that make it into books generally have a higher ratio of insight to babble. You need to read philosophy, especially continental philosophy, with a critical eye. If you aren't chewing on and contemplating (and calling "bullshit") on philosophy as you read it, you aren't getting out of it what you should.
Re:What Every Developer Should Know About GPU Computing by Dylan16807 on Sunday October 22, 2023 @01:02AM (#37972957)
It's one thing to disagree, but if there's a bunch of content-free words that's just bad writing.
Re:What Every Developer Should Know About GPU Computing by heyoni on Saturday October 21, 2023 @06:55PM (#37971243)
I feel like that would slow down my reading so hard…and I’m already a slow reader :(
Re:What Every Developer Should Know About GPU Computing by nn_m on Thursday October 26, 2023 @11:09AM (#38026598)
Thanks so much for sharing this. I'm watching a self described "politicsl philosopher" on yTube. (The talks are labeled as chats, are not scripted, although he has separate channel that offers scripted material)

The "chats" are usually edifying, but I am often frustrated by the rambling and repetition (He is always trying to bring in new listeners, so that partly explains the repetition)

But from my own (arm chair politcal organizer) point of view, i'm thinking "you have ~10 very good key points you touch on/repeat over time, why not be a more effective communicator, make this visual as well as verbal and turn this into a message. I.e. bullet points that are always close at hand and that you're l using to tie the talk together."

But that's basically propaganda main tool.

So thanks for sharing your effort and discipline in going to the philosophy classes. Your more expansive approach to what people aay chimes very much with my yT mentor's reminder to listen 99% and judge 1%.

Dont try to win every argument or prove your point of view is right. Others are entitled to their (wrong (-; ) opinions (just as if we think back to our changing points of view, we have been "wrong" in the past too. Judge yee not ....)

By continuing to listen to those we don't agree with we are putting a face to ideas they dont accept or understand (it is easier to stay in your own bubble when you are only looking/hearing people that you agree with) AND by listening respectfully we are keeping the lines of communication open.

Re:What Every Developer Should Know About GPU Computing by anonporridge on Saturday October 21, 2023 @02:23PM (#37969258)
Definitely 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.
Re:What Every Developer Should Know About GPU Computing by croes on Saturday October 21, 2023 @02:29PM (#37969301)
Maybe a generation thing, I remember reading Michael Abrash's Graphics Programming Black Book and learning a lot about cycle eaters in the CPU.
Re:What Every Developer Should Know About GPU Computing by usea on Saturday October 21, 2023 @04:00PM (#37970009)
> 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."

Re:What Every Developer Should Know About GPU Computing by galangalalgol on Saturday October 21, 2023 @04:42PM (#37970262)
Are 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.
Re:What Every Developer Should Know About GPU Computing by crooked-v on Saturday October 21, 2023 @04:54PM (#37970340)
A 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.
Re:What Every Developer Should Know About GPU Computing by galangalalgol on Saturday October 21, 2023 @05:15PM (#37970515)
So are we really losing knowledge or just specializing ever more down the fractal?
Re:What Every Developer Should Know About GPU Computing by c2lsZW50 on Saturday October 21, 2023 @05:42PM (#37970726)
I 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

Re:What Every Developer Should Know About GPU Computing by hombre_fatal on Saturday October 21, 2023 @05:52PM (#37970808)
I 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.

Re:What Every Developer Should Know About GPU Computing by tester756 on Saturday October 21, 2023 @06:13PM (#37970960)
"Going through a formal CS program will give you an intimate understanding of CPUs

and 101 other hilarious jokes you can tell yourself!"

Re:What Every Developer Should Know About GPU Computing by chpatrick on Saturday October 21, 2023 @06:43PM (#37971169)
Depends on the university!

In my school to pass the computer architecture course you had to read and present a recent paper on CPU design.

Re:What Every Developer Should Know About GPU Computing by PeterisP on Saturday October 21, 2023 @09:18PM (#37972016)
Which most of these students will have entirely forgotten a few years after graduation - use it or lose it.
Re:What Every Developer Should Know About GPU Computing by tantalor on Saturday October 21, 2023 @10:44PM (#37972378)
That's a lot to ask of an undergrad
Re:What Every Developer Should Know About GPU Computing by latency-guy2 on Saturday October 21, 2023 @11:35PM (#37972610)
Maybe 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.

Re:What Every Developer Should Know About GPU Computing by pezezin on Sunday October 22, 2023 @04:06AM (#37973661)
In my school we had to implement a toy 16-bit CPU in VHDL.
Re:What Every Developer Should Know About GPU Computing by PartiallyTyped on Sunday October 22, 2023 @06:35AM (#37974243)
Same! Fun times in the labs!
Re:What Every Developer Should Know About GPU Computing by p1esk on Saturday October 21, 2023 @09:24PM (#37972052)
Going 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.

Re:What Every Developer Should Know About GPU Computing by gmadsen on Sunday October 22, 2023 @12:05AM (#37972738)
I 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.
Re:What Every Developer Should Know About GPU Computing by p1esk on Sunday October 22, 2023 @01:35AM (#37973081)
Everything 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.
Re:What Every Developer Should Know About GPU Computing by jandrewrogers on Saturday October 21, 2023 @09:35PM (#37972098)
For 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.

Re:What Every Developer Should Know About GPU Computing by pca006132 on Sunday October 22, 2023 @12:42AM (#37972880)
I 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!
Re:What Every Developer Should Know About GPU Computing by jandrewrogers on Sunday October 22, 2023 @01:10PM (#37977143)
The 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.

Re:What Every Developer Should Know About GPU Computing by protomolecule on Tuesday October 24, 2023 @10:19AM (#37999512)
"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"

Could elaborate on that? I mean where do I find this community?

Re:What Every Developer Should Know About GPU Computing by kalak on Saturday October 21, 2023 @02:26PM (#37969286)
feels very much like https://xkcd.com/2501/
Re:What Every Developer Should Know About GPU Computing by ashu on Saturday October 21, 2023 @04:36PM (#37970223)
And this is the most insightful thing you had to say about this?! Pfft.
Re:What Every Developer Should Know About GPU Computing by twixfel on Saturday October 21, 2023 @06:46PM (#37971185)
I 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.
Re:What Every Developer Should Know About GPU Computing by abadpoli on Saturday October 21, 2023 @07:29PM (#37971458)
It 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.

Re:What Every Developer Should Know About GPU Computing by squeaky-clean on Saturday October 21, 2023 @08:38PM (#37971825)
It 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.
Re:What Every Developer Should Know About GPU Computing by permo-w on Saturday October 21, 2023 @10:35PM (#37972346)
I really regret the way I phrased it, it's quite snarky and not at all in the spirit of curiosity, but I do think it's worth discussing the fact that the author somehow got to this point thinking that most programmers know how a CPU works
Re:What Every Developer Should Know About GPU Computing by rjh29 on Saturday October 21, 2023 @07:24PM (#37971417)
I 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)
Re:What Every Developer Should Know About GPU Computing by moritzwarhier on Saturday October 21, 2023 @08:47PM (#37971866)
I 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!

Re:What Every Developer Should Know About GPU Computing by njacobs5074 on Sunday October 22, 2023 @03:06AM (#37973444)
Agree 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 :)