Open MarkKremer opened 3 years ago
I've been thinking about what Vulkan calls to place under which Gorgonia interfaces. I've been looking a lot at Kompute for inspiration. So here's my stream of consciousness:
tensor.Engine
interface does memory allocation. So this will contain CreateBuffer
, AllocateMemory
, BindBufferMemory
and MapMemory
calls. The Engine.Alloc
function will return our Vulkan implementation of the Memory
interface.MatMuler
etc.. But this just executes the matrix multiplication. Dense (implements Tensor
and DenseTensor
) has a MatMul
function too, which checks the shapes and calls the engine to perform the operation.
It would be great if we could use the existing Dense
implementation as-is. I'm not entirely sure if this is possible. Our Vulkan engine will need to implement the MatMuler
interface and the like. I think the Algorithm/OpAlgoBase abstraction is useful to copy. Mostly because it can hold the command buffer. Then we'll be able to cache the ops in the engine at some point. For now I think it's fine to just create and init the op in the MatMul
function and then to run it. Engine will need a function to run an op in a sequence just like Kompute's Manager.
Sidenote: Kompute makes heavy use of constructors and templates so I'll have to figure out how to convert that to somewhat idiomatic Go.
Hi people,
In this issue I will track the progress for the first version of Vulkan support for Gorgonia as proposed by 0x0f0f0f. This is not an exhaustive list. There is a lot to be figured out and I will add items along the way.
My current plan is to see if I can get something of the ground. There will be a lot of work that needs to be done that I won't be able to get around to. If you want to contribute, let me know and we'll figure out what you can do. For casual contributors, I'll try to make some nice low-hanging-fruit tasks available soon-ish.
TODO
tensorEngine
interfaceLow hanging fruit / other free to take tasks
cmd/testing
application on Windows. The docs state thatSetDefaultGetInstanceProcAddr
is only implemented for Linux but the implementation tells a different story.cmd/testing
application on Mac. The docs state thatSetDefaultGetInstanceProcAddr
is only available for Linux. Looking at the implementation, this seems to be true for Mac. Check if there is an issue for this in the vulkan-go repo, create an issue for this or see if we can get this working some other way without needing a windowing library.When you take on a low-hanging-fuit task, please comment below so other contributors know not to work on the same task.
Contributing
For Vulkan you need to install the Vulkan drivers for your specific graphics card. You'll also need to install the Vulkan SDK. Read this tutorial for extra instructions. You can ignore the GLFW/GLM parts.
If you're new to Vulkan, I recommend diving into this tutorial. It is focused a bit more on the graphics side than on the compute but you'll notice that a lot of it works in the same way.