taichi-dev / taichi

Productive, portable, and performant GPU programming in Python.
https://taichi-lang.org
Apache License 2.0
25.34k stars 2.27k forks source link

[RFC] Roadmap to a smaller, faster, and cleaner Unified Device API #6832

Open bobcao3 opened 1 year ago

bobcao3 commented 1 year ago

The long term goal for the Unified Device API, or the RHI, is to be isolated into its own repo and maintained separately from Taichi. Where we will create its own unit tests and integration tests to improve robustness and maintain strong isolation boundary between them.

In the end, we want to achieve these goals for the future RHI:

  1. RHI can be trimmed down through discarding unused modules. We should make RHI per-backend dynamically linked and optionally statically linked.
  2. RHI contains its own full functional specification and tests that uphold these specifications
  3. Provide a zero-overhead C-API
  4. Do not leak symbols to linked libraries & support different drivers and external dependencies robustly
  5. Able to use shared library if the client of RHI already uses them
  6. Being a fully functioned RHI that we can build other non-taichi applications on top of it
  7. Make it smaller in size and complexity

To achieve this goal while not hugely breaking the workflow and goals within Taichi, we will start by progressively trimming away dependencies of RHI. This hopefully will eventually lead to a clean separation when we move RHI outside of Taichi repo. Here are the first steps:

bobcao3 commented 1 year ago

Here to track the progress on the API surface (adding return status, adding documentation & specs, removing STL, or other changes):

bobcao3 commented 1 year ago

DX11 Impl tracker: #6879 Vulkan Impl tracker: #6880 OpenGL Impl tracker: #6881 Metal Impl tracker: #6882