Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible SpirV compilation pipeline #91

Open
4 tasks
leios opened this issue Oct 27, 2023 · 2 comments
Open
4 tasks

Possible SpirV compilation pipeline #91

leios opened this issue Oct 27, 2023 · 2 comments

Comments

@leios
Copy link
Owner

leios commented Oct 27, 2023

Ok, this is an info dump, but I think this is the ideal path forward for Fable performance and also fixes #66 .

Ideally we...

  • Use the @fum macro to siphon out the function bodies and create large function bodies like before the Hutchinson and FractalUserMethod overhaul #64 update; however, we will also allow for configurable keyword arguments so we do not need to recompile the function too many times for dynamic scenes.
  • Compile this to SpirV using some form of compute shader (note that we want to use the graphics pipeline if possible)
  • Pass that SpirV to Vulkan(.jl)
  • Find a way to wrap a window library (whatever Makie / Plots use or maybe GLFW) for dynamic / realtime output.

Note that this will remove the dependencies on KernelAbstractions and any GPU vendor because we can rely on Vulkan for these steps, which would greatly reduce precompile time and hopefully speed up the process for PkgCompiler so we could make executables (games?) with this application.

@leios
Copy link
Owner Author

leios commented Apr 22, 2024

It might be interesting to look at what OneAPI.jl does already for the OpenCL -> SPIRV compiler. Then pass that to vulkan(.jl)?

Keep in mind that this is essentially LLVM -> SPIRV, which means you still need to go through LLVM, which is currently part of the issue.

The only real way would be to find a way to create SPIRV IR in Julia (emit_spirv, similar to emit_llvm)

@leios
Copy link
Owner Author

leios commented Jul 9, 2024

Note that by switching to vulkan / spirv, we lose Enzyme AD, which could be a really important step.

Instead, it might be better to do interop for realtime visualizations:

  1. https://github.com/ROCm/rocm-examples/tree/develop/HIP-Basic/vulkan_interop
  2. https://github.com/NVIDIA/cuda-samples/tree/master/Samples/5_Domain_Specific/vulkanImageCUDA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant