-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
How does taichi speed up python code include numpy? #7272
Comments
Correct, Taichi compiles the functions decorated by @ti.kernel and @ti.func into machine code and runs outside of the Python virtual machine.
No. Taichi does not accelerate numpy functions: one cannot call numpy functions inside Taichi kernels.
This doc might be helpful: https://docs.taichi-lang.org/docs/accelerate_python If you implement an algorithm in both Taichi and NumPy, the Taichi version would be faster. But this performance gain may not be worth the effort of reinventing the wheel, especially if you have many numpy functions to rewrite, or the code of the function is too complex. |
Thank you. yes i had read this doc. but i don't know that why Taichi can be accelerate your operation. Thank you very much. |
@sanbuphy I have updated my answer. |
Thank you for your answer, the last question I am curious about, |
I think NO. |
OK,I get it ,Thank you for your reply |
【The following are all CPU-based scenarios】
Can I understand that taichi compiles the python code in advance and puts it in memory for use by hardware devices?
Then numpy just gave him the operator for high-performance computing?
I want to know whether it is faster to use taichi alone or can it be faster in combination with taichi and numpy?
Thank you very much.
The text was updated successfully, but these errors were encountered: