A reproduction of llm.c by @karpathy using Vulkan compute shaders.
Install vulkan-sdk following https://vulkan.lunarg.com/sdk/home#linux.
wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add -
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-{RELEASE}-{CODENAME}.list https://packages.lunarg.com/vulkan/{RELEASE}/lunarg-vulkan-{RELEASE}-{CODENAME}.list
sudo apt update
sudo apt install vulkan-sdkAnd don't forget to install GPU driver.
I only added a few layers for now, and you can test those by running bazel rules like:
bazel run :matmul_forward -- 1If you see llvmpipe in stdout when running, your GPU is not being used correctly.