Open ChrisWhealy opened 6 months ago
Hi @ChrisWhealy,
Thanks for checking out the repo!
I'm using a Mac with an Apple Silicon SoC (Apple's own chip). The error you mentioned is a Metal Kernel Error. Apple provides a low-level, explicit GPU API called Metal and a language (essentially C++ with proprietary extensions) for writing GPU programs (shaders).
These shaders are compiled via the Metal compiler, which involves an intermediate step: programs are converted to AIR form.
So, this seems like a bug with AMD graphics cards. I believe the only solution is to not use the Metal Back-end
with this AMD graphics card. However, I have not verified this.
If the above is true, then we are limited to using the CPU back-end as candle
currently supports 3 back-ends.
Ok, thanks for the update.
I'll have to stick with the much slower Device::Cpu
option then
:-(
I'm following your YT videos on building a transformer (very good, BTW 😃).
I notice that you're running this code on a Mac and it works fine for you. I'm also running on a 16" 2019 MacBook Pro with an AMD Radeon Pro 5500M graphics card and 32Gb of RAM. However,
cargo r
works fine up until the stage of creating the positional embeddings. At this point the code crashes withI'm using Rust version 1.77.2
By changing the
device
declaration toDevice::Cpu
, the code runs - albeit very slowly.I've seen various comments about this error that say it is a bug in the AMD Radeon GPU installed on Macs, but since it runs on your Mac, I was wondering whether you either had to apply a workaround to fix this error, or maybe you have a completely different graphics card installed.