Don't create FusionGroups for known-CPU producer values (#19342)
authorJames Reed <jamesreed@fb.com>
Mon, 22 Apr 2019 23:54:19 +0000 (16:54 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Mon, 22 Apr 2019 23:57:18 +0000 (16:57 -0700)
commit5be4bee4ff58d04c8ee73163e2cb2e06bd69b2a5
tree88a18b63b945eb952199e65caa28b3e6e258160b
parent969af4315a30e96205e125a16e67bd6e3c03e218
Don't create FusionGroups for known-CPU producer values (#19342)

Summary:
I believe the existing check in FuseGraph was only `false` if PyTorch was built with NO_CUDA=1. Otherwise, we would create fusion groups even if we're on a CPU-only machine running CPU code. This is confusing. Instead I've made it so that the decision to fuse or not is dependent on if the producer Value is a known CPU tensor. If it is, we skip fusion.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19342

Differential Revision: D15038351

Pulled By: jamesr66a

fbshipit-source-id: fce9d83929309a7bf14346833f84b996f3e7f6db
test/test_jit.py
test/test_jit_fuser.py
torch/csrc/jit/init.cpp
torch/csrc/jit/passes/graph_fuser.cpp