I also ran into problems when installing pytorch 0.5.0a0 with the setup script and cuda 8.0. Like above,  caffe2 causes problems.
For future reference: Is it official that pytorch 0.5.0a0 does not support cuda 8.0?