taichi-dev / taichi

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

python api for runtime #6537

Open fangde opened 1 year ago

fangde commented 1 year ago

Python API for runtime I would like to have python api for runtime, this will enable us to load AOT in python.

import ticore, ticolore.load_aot_module("tcm"). runkernel

runtime api enable python to load and run AOT fils We may have some desktop app, using pyqt for ui but using taichi for the computing.but we cant pack taichi. since we are using python anyway, it is possible to have python api to load aot module? I guess current taichi may be possible to do it, at the ti_core leve, maybe and example will be enough

pyinstaller support Many python app using pyinstaller to package the binary. Python runtime api may enable pyinstaller to package taichi into

jim19930609 commented 1 year ago

Hi fangde, Taichi does have a standalone C-API that allows you to compile a Taichi Kernel written in Python, then load and execute it in C++. However, that interface is for C++ only and there's no such interface at the Python level yet.

I think this is more like a feature request to support AOT runtime interfaces in Python, which also benefits C++ users since they can debug the runtime parts in Python.