taichi-dev / taichi

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

Support autodiff for ndarray #4267

Open erizmr opened 2 years ago

erizmr commented 2 years ago

Concisely describe the proposed feature Currently, the autodiff system only supports Taichi field. However, there are some limitations of field such as the number of snode trees is limited which blocks the scalability of the applications. While Ndarray is a container that has more flexibility and is currently supported by multiple backends of Taichi. Support autodiff for Ndarray will broad the application of the autodiff system.

Describe the solution you'd like (if any)

  1. Add grad for ndarray (include an adjoint array etc. )
  2. Include ExternalPtrStmt in source code transformation of autodiff.
chenzhekl commented 11 months ago

It seems that the taichi-nerfs codebase is already using some sort of autodiff for ndarray. Does that imply that this functionality is already working in the nightly version?