3 ms·
I wonder if we could train an LLM to port CUDA to Metal, OpenCL, etc? Seems like the lock in here actually isn’t that powerful. Fundamentally it’s math impleme
by api 2y ago
I wonder if we could train an LLM to port CUDA to Metal, OpenCL, etc?
Seems like the lock in here actually isn’t that powerful. Fundamentally it’s math implemented in a C-like language.
- arghwhat 2y agoThe lock-in is mostly in libraries and tooling. It's not really your CUDA code that is the issue.
- WithinReason 2y agoYou would need to translate CUDA already compiled for an Nvidia GPU to e.g. OpenCL that runs fast on an AMD GPU, which is close AGI level in difficulty.
- pjmlp 2y agoPeople keep forgetting CUDA is polyglot, and then there is the graphical tooling, IDE integration, and libraries ecosystem.
- Lockal 2y agoThis has already been done multiple times without using LLMs. For HIP, there are tools like hipify-clang, hipify-perl, and hipify (the Python-based tool in PyTorch). For SYCL, there is SYCLomatic. The devil is in the details, though; at some point, all projects encounter non-portable code due to different instruction sets. For example, if the hardware does not support Warpgroup Level Multiply-and-Accumulate or a specific minifloat format, it is actively harmful to translate the code 'as is.' These platforms require software redesign, which is not something that LLMs are currently capable of handling.