pytorch / pytorch

Tensors and Dynamic neural networks in Python with strong GPU acceleration
https://pytorch.org
Other
82.13k stars 22.08k forks source link

Improving inductor pattern matcher's replacement graph assumptions #134363

Open zou3519 opened 3 weeks ago

zou3519 commented 3 weeks ago

The pattern matcher assumes by default that it is safe to run functional passes on the replacement graph. The ones it runs are DCE and remove_noop_ops. We should try to change it to be more automatic and determine if those passes are safe to run (or add invariants if this is too hard, see also https://github.com/pytorch/pytorch/issues/133250).

This is non-trivial:

cc @ezyang @chauhang @penguinwu @voznesenskym @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @ColinPeppler @amjames @desertfire

mfbalin commented 3 weeks ago

Is this related to #133942 somehow?