pytorch
8c332ff8 - [JIT] EliminateDeadCode shouldn't remove custom operator node that has untracked mutation (#34635)

Commit
4 years ago
[JIT] EliminateDeadCode shouldn't remove custom operator node that has untracked mutation (#34635) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/34635 For custom op, it's removed in EliminateDeadCode IR optimization step, causing wrong training result. EliminateDeadCode decides to remove it, because it has no output, so output is used. Also, it has no side effect, and has no untracked mutation, which is not true, custom op can have untracked mutation. The if statement here only allows aten and prim operator to have untracked mutation, which should be removed. ghstack-source-id: 100001319 Test Plan: ``` buck test mode/dev-nosan //caffe2/torch/fb/distributed/pytorch/tests:test_jit buck build mode/dev-nosan //caffe2/torch/fb/distributed/pytorch/tests:test_jit \ && buck-out/gen/caffe2/torch/fb/distributed/pytorch/tests/test_jit\#binary.par -r test_use_dense_adagrad_step ``` Reviewed By: wanchaol Differential Revision: D7440221 fbshipit-source-id: e424417ab397d90075884c7050c59dfc5c84cf77
Author
Parents
Loading