taichi-dev / taichi

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

[Opt] Refactor advanced_optimization into optimization_level #2658

Open xumingkuan opened 3 years ago

xumingkuan commented 3 years ago

Concisely describe the proposed feature We need more flexibility on which optimizations to be performed. A simple switch advanced_optimization is probably not sufficient.

See also: https://github.com/taichi-dev/taichi/issues/1416#issuecomment-654379663 https://github.com/taichi-dev/taichi/pull/1403#pullrequestreview-442632149 https://github.com/taichi-dev/taichi/issues/2375#issuecomment-852722639 https://github.com/taichi-dev/taichi/issues/1469#issuecomment-657168352

Describe the solution you'd like (if any)

  1. Implement a new config variable optimization_level with values 0, 1, 2, 3, and deprecate advanced_optimization into setting the optimization_level variable.
  2. Remove advanced_optimization after several releases.
k-ye commented 2 years ago

cfg_optimization and whole_kernel_cse are known to be quite expensive. We can start from these two.