4 ms·
The demo is admittedly a rube goldberg machine, but that's because this was the first time it is possible. It will get more integrated over time. And just like
by LegNeato 1y ago
The demo is admittedly a rube goldberg machine, but that's because this was the first time it is possible. It will get more integrated over time. And just like normal rust code, you can make it as abstract or concrete as you want. But at least you have the tools to do so.
That's one of the nice things about the rust ecosystem, you can drill down and do what you want. There is std::arch, which is platform specific, there is asm support, you can do things like replace the allocator and panic handler, etc. And with features coming like externally implemented items, it will be even more flexible to target what layer of abstraction you want
- 90s_dev 1y ago"It's only complex because it's new, it will get less complex over time." They said the same thing about browser tech. Still not simpler under the hood.
- luxuryballs 1y agonow that is a relevant username
- a99c43f2d565504 1y agoAs far as I understand, there was a similar mess with CPUs some 50 years ago: All computers were different and there was no such thing as portable code. Then problem solvers came up with abstractions like the C programming language, allowing developers to write more or less the same code for different platforms. I suppose GPUs are slowly going through a similar process now that they're useful in many more domains than just graphics. I'm just spitballing.
- Maken 1y agoAnd yet, we are still using handwritten assembly for hot code paths. All these abstraction layers would need to be porous enough to allow per-device specific code.
- pizza234 1y ago> And yet, we are still using handwritten assembly for hot code paths This is actually a win. It implies that abstractions have a negligible (that is, existing but so small that can be ignored) cost for anything other than small parts of the codebase.
- pjmlp 1y agoComputers have been enjoying high level systems languages, a decade predating C.
- dotancohen 1y ago> I suppose GPUs are slowly going through a similar process now that they're useful in many more domains than just graphics. I've been waiting for the G in GPU to be replaced with something else since the first CUDA releases. I honestly think that once we rename this tech, more people will learn to use it.
- ecshafer 1y agoMPU - Matrix Processing Unit LAPU - Linear Algebra Processing Unit
- dotancohen 1y agoLAPU is terrific. It also means paw in Russian.
- lillecarl 1y agoPPU - Parallel processing unit
- jcranmer 1y agoThe first portable programming language was, uh, Fortran. Indeed, by the time the Unix developers are thinking about porting to different platforms, there are already open source Fortran libraries for math routines (the antecedents of LAPACK). And not long afterwards, the developers of those libraries are going to get together and work out the necessary low-level kernel routines to get good performance on the most powerful hardware of the day--i.e., the BLAS interface that is still the foundation of modern HPC software almost 50 years later. (One of the problems of C is that people have effectively erased pre-C programming languages from history.)
- lukan 1y agoWho said that?
- turnsout 1y agoComplexity is not inherently bad. Browsers are more or less exactly as complex as they need to be in order to allow users to browse the web with modern features while remaining competitive with other browsers. This is Tesler's Law [0] at work. If you want to fully abstract away GPU compilation, it probably won't get dramatically simpler than this project. [0]: https://en.wikipedia.org/wiki/Law_of_conservation_of_complexity
- bromantic 1y agoI swear, if I had 2c for every <insert computer guy surname> supposed "law", I would be a millionaire now. Slogans make no law, but programmers sure love "naming things." In all fairness, the obsessive elevating of good-sounding slogans into colloquial "laws" is a uniquely American phenomenon. My pet-theory is that this goes back to old days when computer science wasn't considered a "real" science. That is, in "real" sciences there are laws, so the American computer science guys felt like inventing "laws" to be taken seriously.
- turnsout 1y agoOkay sure, but Larry Tesler was a real one, and whatever you want to call it, his observation is spot-on. If I had 2c for every time I've seen a "Senior" dev push the complexity around on their plate like it's spinach, I'd be a millionaire with you.
- jpc0 1y ago> Complexity is not inherently bad. Browsers are more or less exactly as complex as they need to be in order to allow users to browse the web with modern features while remaining competitive with other browsers. What a sad world we live in. Your statement is technically true, the best kind of true… If work went into standardising a better API than the DOM we might live in a world without hunger, where all our dreams could become reality. But this is what we have, a steaming pile of crap. But hey, at least it’s a standard steaming pile of crap that we can all rally around. I hate it, but I hate it the least of all the options presented.
- Yoric 1y agoWho ever said that?
- flohofwoe 1y ago> but that's because this was the first time it is possible Using SPIRV as abstraction layer for GPU code across all 3D APIs is hardly a new thing (via SPIRVCross, Naga or Tint), and the LLVM SPIRV backend is also well established by now.
- LegNeato 1y agoThose don't include CUDA and don't include the CPU host side AFAIK. SPIR-V isn't the main abstraction layer here, Rust is. This is the first time it is possible for Rust host + device across all these platforms and OSes and device apis. You could make an argument that CubeCL enabled something similar first, but it is more a DSL that looks like Rust rather than the Rust language proper(but still cool).
- socalgal2 1y ago> This is the first time it is possible for Rust host + device across all these platforms and OSes and device apis. I thought wgpu already did that. The new thing here is you code shaders in rust, not WGSL like you do with wgpu
- LegNeato 1y agoCorrect. The new thing is those shaders/kernel also run via CUDA and on CPU unchanged. You could not do that with only wgpu...there is no rust shader input, (and the thing that enables it rust-gpu which is used here) and if you wrote your code in a shader lang it wouldn't run on the CPU (as they are made for GPU only) or via CUDA.
- winocm 1y agoLLVM SPIR-V's backend is a bit... questionable when it comes to code generation.