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

Export Python kernels to taichi.js? #14

Open
ringohoffman opened this issue Feb 11, 2024 · 0 comments
Open

Export Python kernels to taichi.js? #14

ringohoffman opened this issue Feb 11, 2024 · 0 comments

Comments

@ringohoffman
Copy link

ringohoffman commented Feb 11, 2024

I have kernels already written and developed in taichi Python that I want to export to use in a web app.

I really would like to be able to create the canvas in taichi.js like:

  let htmlCanvas = document.getElementById('result_canvas');
  htmlCanvas.width = 512;
  htmlCanvas.height = 512;
  let renderTarget = ti.canvasTexture(htmlCanvas);

and pass the renderTarget to the exported taichi Python kernels running on a WebGPU backend.

In your post announcing your plan for taichi.js, you said

I have hacked up a WebGPU Taichi runtime and used Taichi AOT and Tint to generate some WGSL kernels

When I look at the taichi-aot-demo, I see that you need to select a specific taichi arch for your AOT runtime:

    runtime_ = ti::Runtime(arch_);

I don't see WebGPU as an officially supported architecture: https://docs.taichi-lang.org/docs/taichi_core#enumeration-tiarch

How can I make my taichi Python code interoperable with taichi.js? Is it possible with existing tooling? Would you consider exposing a Python API for orchestrating this exporting?

cc: @kurtisdavid @CandiedCode

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