15 ms·
BarraCUDA Open-source CUDA compiler targeting AMD GPUs
- whizzter 8mo agoNot familiar with CUDA development, but doesn't CUDA support C++ ? Skipping Clang/LLVM and going "pure" C seems to be quite limiting in that case.
- h4kunamata 8mo agoReal developer never depended on AI to write good quality code, in fact, the amount of slope code flying left and right is due to LLM. Open-source projects are being inundated with PR from AIs, not depending on them doesn't limit a project. That project owner seems pretty knowledgeable of what is going on and keeping it free of dependencies is not an easy skill. Many developers would have written the code with tons of dependency and copy/paste from LLM. Some call the later coding :)
- gsora 8mo agoLLVM and LLM are not the same thing
- brookman64k 8mo agoLLVM (Low Level Virtual Machine) != LLM (Large Language Model)
- hackyhacky 8mo agoHonestly I'm not sure how good is LLVM's support for AMD GX11 machine code. It's a pretty niche backend. Even if it exists, it may not produce ideal output. And it's a huge dependency.
- bri3d 8mo agoQuite good, it’s first party supported by AMD (ROCm LLVM, with a lot upstreamed as well) where it’s fairly widely used in production. This project is a super cool hobby/toy project but ZLUDA is the “right” drop in CUDA replacement for almost any practical use case.
- woctordho 8mo agoI'd say it's pretty good on supported GPUs (gfx 9 and 12). Things like hipcc and Triton all work on top of it. But on gfx 11 there is still a lot to optimize.
- deleted 8mo ago[deleted]
- woctordho 8mo agoI'm also wondering this. The compiler itself is written in C99, but looking from the tests, it can parse some C++ features such as templates.
- ZaneHam 8mo agoIm parsing the features of c++ CUDA actually uses, not the full c++ spec as that would take a very large amount of time. The Compiler itself being written in c99 is just because that's how I write my C and is a separate thing.
- tgtweak 8mo agoWhat lift would be required to make a runtime-delayed compilation (like shader compilation in a game/emulator) and have this be the NVRTC component inside ZLUDA?
- phoronixrly 8mo agoPutting a registered trademark in your project's name is quite a brave choice. I hope they don't get a c&d letter when they get traction...
- cadamsdotcom 8mo agoMaybe a rename to Barra. Everyone will still get the pun :)
- Alifatisk 8mo agoAre you thinking of Seagate Barracuda?
- adzm 8mo agoThey mean the CUDA part
- bee_rider 8mo agoI wonder if they could change the name to Barracuda if pressed. The capitalization is all that keeps it from being a normal English word, right?
- battle-racket 8mo agoBarraCUDA is also a bioinformatics toolset? https://www.biocentric.nl/biocentric/nvidia-cuda-bioinformatics-barracuda/ https://www.biocentric.nl/biocentric/nvidia-cuda-bioinformat...
- sam_goody 8mo agoWow!! Congrats to you on launch! Seeing insane investments (in time/effort/knowledge/frustration) like this make me enjoy HN!! (And there is always the hope that someone at AMD will see this and actually pay you to develop the thing.. Who knows)
- piker 8mo ago> # It's C99. It builds with gcc. There are no dependencies. > make Beautiful.
- parlortricks 8mo agoYou gotta love it, simple and straight to the point.
- esafak 8mo agoWouldn't it funny and sad if a bunch of enthusiasts pulled off what AMD couldn't :)
- h4kunamata 8mo agoMany projects turned out to be far better than proprietary because open-source doesn't have to please shareholders. What sucks is that such projects at some point become too big, and make so much noise forcing big techs to buy them and everybody gets fuck all. All it requires to beat proprietary walled garden, is somebody with knowledge and a will to make things happen. Linus with git and Linux is the perfect example of it. Fun fact, BitKeeper said fuck you to the Linux community in 2005, Linus created git within 10 days. BitKeeper make their code opensource in 2016 but by them, nobody knew who they were lol So give it time :)
- throwa356262 8mo agoI think it was the other way around. It was the community that told bitkeeper to fuck off. It all ended up good because of one mans genius but let's not rewrite history.
- bri3d 8mo agoThe lack of CUDA support on AMD is absolutely not that AMD "couldn't" (although I certainly won't deny that their software has generally been lacking), it's clearly a strategic decision. Supporting CUDA on AMD would only build a bigger moat for NVidia; there's no reason to cede the entire GPU programming environment to a competitor and indeed, this was a good gamble; as time goes on CUDA has become less and less essential or relevant. Also, if you want a practical path towards drop-in replacing CUDA, you want ZLUDA; this project is interesting and kind of cool but the limitation to a C subset and no replacement libraries (BLAS, DNN, etc.) makes it not particularly useful in comparison.
- enlyth 8mo agoEven disregarding CUDA, NVidia has had like 80% of the gaming market for years without any signs of this budging any time soon. When it comes to GPUs, AMD just has the vibe of a company that basically shrugged and gave up. It's a shame because some competition would be amazing in this environment.
- bravetraveler 8mo ago> No HIP translation layer. Storage capacity everywhere rejoices
- h4kunamata 8mo ago>Requirements >A will to live (optional but recommended) >LLVM is NOT required. BarraCUDA does its own instruction encoding like an adult. >Open an issue if theres anything you want to discuss. Or don't. I'm not your mum. >Based in New Zealand Oceania sense of humor is like no other haha The project owner strongly emphasize the no LLM dependency, in a world of AI slope this is so refreshing. The cheer amount of knowledge required to even start such project, is really something else, and prove the manual wrong on the machine language level is something else entirely. When it comes to AMD, "no CUDA support" is the biggest "excuse" to join NVIDIA's walled garden. Godspeed to this project, the more competition the less NVIDIA can continue destroying the PC parts pricing.
- querez 8mo ago> The project owner strongly emphasize the no LLM dependency, in a world of AI slope this is so refreshing. The project owner is talking about LLVM,a compiler toolkit, not an LLM.
- kmaitreys 8mo agoIt's actually quite easy to spot if LLMs were used or not. Very few total number of commits, AI like documentation and code comments. But even if LLMs were used, the overall project does feel steered by a human, given some decisions like not using bloated build systems. If this actually works then that's great.
- yodon 8mo ago<checks stock market activity>
- gclawes 8mo agoWhat's the benefit of this over tinygrad?
- bri3d 8mo agoCompletely different layer; tinygrad is a library for performing specific math ops (tensor, nn), this is a compiler for general CUDA C code. If your needs can be expressed as tensor operations or neural network stuff that tinygrad supports, might as well use that (or one of the ten billion other higher order tensor libs).
- latchkey 8mo agoSee also: https://scale-lang.com/ https://scale-lang.com/ Write CUDA code. Run Everywhere. Your CUDA skills are now universal. SCALE compiles your unmodified applications to run natively on any accelerator, ending the nightmare of maintaining multiple codebases.
- latchkey 8mo agoNote that this targets GFX11, which is RDNA3. Great for consumer, but not the enterprise (CDNA) level at all. In other words, not a "cuda moat killer".
- ZaneHam 8mo agoHello, I'm not the one who posted to HN but I am the project author. I'm working my way into doing multiple architectures as well as more modern GPUs too. I only did this because I used LLVM to check my work and I have an AMD GFX 11 card on my partners desktop (Which I use to test on sometimes when its free). If you do have access to this kind of hardware and you're willing to test my implementations on it then I'm all ears! (You don't have too obviously :-) )
- latchkey 8mo agoI can give you access to MI300x. Also, reach out to Anush please. He commented on here.
- gzread 8mo agoNice! It was only a matter of time until someone broke Nvidia's software moat. I hope Nvidia's lawyers don't know where you live.
- saagarjha 8mo agoThis isn't a production grade effort though.
- ByThyGrace 8mo agoHow feasible is it for this to target earlier AMD archs down to even GFX1010, the original RDNA series aka the poorest of GPU poor?
- monster_truck 8mo agoDon't let anyone dissuade you, it's going to be annoying but it can be done. When diffusion was new and rocm was still a mess I was manually patching a lot to get a vii, 1030, then 1200 working well enough. It's a LOT less bad than it used to be, amd deserves serious credit. Codex should be able to crush it once you get the env going
- ZaneHam 8mo agoHey, I am actually working on making this compatible on earlier AMD's as well because I have an old gaming laptop with an RX5700m which is GFX10. I'm reading up on the ISA documentation to see where the differences are, and I'll have to adjust some binary encoding to get it to work. I mean this with respect to the other person though please don't vibe code this if you want to contribute or keep the compiler for yourself. This isn't because I'm against using AI assistance when it makes sense it's because LLMs will really fail in this space. Theres's things in the specs you won't find until you try it and LLMs find it really hard to get things right when literal bits matter.
- deeringc 8mo agoI really like the minimal approach you've taken here - it's refreshing to see this built completely from the ground up and it's clearly readable and for me, very educational. But help me understand something. BarraCuda does its own codegen and therefore has to implement its own optimisation layer? It's increbibly impressive to get "working" binaries, but will it ever become a "viable" alternative to nvidia's CUDA if it has to re-invent decades of optimisation techniques? Is there a performance comparison between the binaries produced by this compiler and the nvidia one? Is this something you working on as an interesting technical project to learn from and prove that this "can be done"? Or are you trying to create something that can make CUDA a realistic option on AMD GPUs?
- 7speter 8mo agoWill this run on cards that don’t have ROCM/latest ROCM support? Because if not, its only gonna be a tiny subset of a tiny subset of cards that this will allow cuda to run on.
- woctordho 8mo agoYes. It outputs a hsaco binary that just runs on the GPU (as long as you have the driver). No ROCm needed.
- skipants 8mo agoPerusing the code, the translation seems quite complex. Shout out to https://github.com/vosen/ZLUDA https://github.com/vosen/ZLUDA which is also in this space and quite popular. I got Zluda to generally work with comfyui well enough.
- ZaneHam 8mo agoThis, this and this! Was really inspired by ZLUDA when I made this.
- freakynit 8mo agoThe first issue created by someone other than the author is from geohot himself.. the goat: https://github.com/Zaneham/BarraCUDA/issues/17 https://github.com/Zaneham/BarraCUDA/issues/17 I would love to see these folks working together on this to break apart nvidia's strangehold on gpu market (which, according to internet, allows them to have an insane 70% profit margins, thereby, raising costs for all users, worldwide).
- BatteryMountain 8mo agoIn the old days we had these kinds of wars with cpu instruction sets & extensions (SSE, MMX, x64,). In a way I feel that CUDA should be opened up & generalized so that other manufacturers can use it too, the same way cpu's equalled out on most intruction sets. That way the whole world won't be beholden to one manufacturer (Big Green) and would calm down the scarcity effect we have now. I'm not an expert on gpu tech, would this be something that is possible? Is CUDA a driver feature or a hardware feature?
- exabrial 8mo agoIs OpenCL a thing anymore? I sorta thought thats what is was supposed to solve. But I digress, just a quick put around... I don't know what I'm looking at. But it's impressive.
- rbanffy 8mo ago> Is OpenCL a thing anymore? I guess CUDA got a lot more traction and there isn't much of a software base written for OpenCL. Kind of what happened with Unix and Windows - You could write code for Unix and it'd (compile and) run on 20 different OSs, or write it for Windows, and it'd run on one second-tier OS that managed to capture almost all of the desktop market. I remember Apple did support OpenCL a long time ago, but I don't think they still do.
- moffkalast 8mo agoNah, it's all Vulkan now. SYCL is the spiritual successor to OpenCL but unfortunately it doesn't work reliably on anything.
- dokyun 8mo agoLove to see just a simple compiler in C with a Makefile instead of some amalgamation of 5 languages 20 libraries and some autotools cmake shit.
- pyuser583 8mo agoI was hoping AMD would keep making gaming cards, now that NVIDIA is an AI company. Somebody has to, right?
- quantumwoke 8mo agoThere's a lot of people in this thread that don't seem to have caught up with the fact that AMD has worked very hard on their cuda translation layer and for the most part it just works now, you can build cuda projects on amd just fine on modern hardware/software.
- jillesvangurp 8mo agoNice repeat of history given that AMD started out emphasizing x86 compatibility with Intel's CPUs. It's a good strategy. And open sourcing it means it might be be adapted to other hardware platforms too.
- numbers_guy 8mo agoAlso in this world of accelerator programming, people are writing very specialized codes that target a specific architecture, datatype, and even input shape. So with that in mind, how useful is it to have a generic kernel? You still need to do all the targetted optimization to make it performant. If you want portablitiy you need a machine learning compiler ala TorchInductor or TinyGrad or OpenXLA.
- Arifcodes 8mo ago[dead]
- kstppd12 8mo agoGreat work!
- whateverboat 8mo agoI think ChipStar is better. less IP issues
- emsign 8mo agoNo, please no! AMD GPUs are still somewhat affordable. Does this mean their cards become compatible with CUDA based AI software? Don't ruin the market for desktop GPUs completely, please don't. AI is costing me hundreds of extra Euros in hardware already. I hate this so much.
- kmm 8mo agoHah, the capitalization of the title of this post only just now made me realize why the GPU farm at my job is called "barracuda". That's pretty funny.
- sreekanth850 8mo agoAMD should sponsor this. World need to get rid of this NVIDIA monopoly.
- qaqqqqaq 8mo ago[dead]
- takeaura25 8mo agoRunning AI inference workloads on Nvidia GPUs , and the cost is a real pain point. Projects like this matter because GPU vendor lock-in directly affects what startups can afford to build. Would love to see how this performs on common inference ops like conv2d and attention layers.
- tgtweak 8mo agoThis is likely supremely naive but I would think the lift in getting coverage for an entire library to a target hardware's native assembly is largely a matter of mapping/translating functions, building acceptance tests and benchmarking/optimization - all three of those feel like they should be greatly assisted by LLM augmented workflows.
- mrdootdoot 8mo agoI don’t understand the elitism about avoiding LLMs. Good luck -
- Cieric 8mo agoHe's avoiding LLVM which is a compiler framework. Not LLMs as has been stated a few times in the comments already.
- mrdootdoot 8mo agoAh I see now. That being said - much hate detected
- hzwanip 8mo ago> No LLVM. No HIP translation layer. No "convert your CUDA to something else first." What is the problem with such approaches?
- MATTEHWHOU 8mo agoThis is one of those projects that sounds impossible until you realize CUDA is basically C++ with some extensions and a runtime library. The hard part isn't the language translation — it's matching NVIDIA's highly optimized libraries (cuBLAS, cuDNN, etc.). If BarraCUDA can hit even 80% of the performance on common ML workloads, that's a game changer for anyone who bought AMD hardware. Curious about the PTX translation layer specifically. That's where most previous attempts (like ZLUDA) hit a wall.