apex icon indicating copy to clipboard operation
apex copied to clipboard

build Apex latest version failed with pytorch 1.4.0 due to missing ATen/cuda/DeviceUtils.cuh

Open miko-cn opened this issue 4 years ago • 9 comments

While i try to build the apex for my new pytorch env, there is a error says:

csrc/layer_norm_cuda_kernel.cu:4:37: fatal error: ATen/cuda/DeviceUtils.cuh: No such file or directory

Actually, I could not find the file in the dir(Pytorch 1.4.0 just do not include this file), and I also found that the include dependency for DeviceUtils.cuh just added 1 month ago in the commit : cleanup missing THCDeviceUtils.cuh header

#include "ATen/ATen.h"
#include <THC/THCDeviceUtils.cuh> <----
#include "ATen/cuda/DeviceUtils.cuh" <----

#include <cuda.h>
#include <cuda_runtime.h>

So I can only build with an old-version-donwload-before apex to use (no bug in this time)

Is there something wrong with the recent commit?

miko-cn avatar Oct 23 '21 14:10 miko-cn

PyTorch recently removed THCDeviceUtils.cuh recently thus we needed the change you mentioned.

crcrpar avatar Oct 25 '21 23:10 crcrpar

PyTorch recently removed THCDeviceUtils.cuh recently thus we needed the change you mentioned.

Would you pls to provide a method to install apex on previous Pytorch?

DAVIDNEWGATE avatar Nov 02 '21 10:11 DAVIDNEWGATE

picking up a commit before #1191 may work -- https://github.com/NVIDIA/apex/commits/master

crcrpar avatar Nov 03 '21 00:11 crcrpar

picking up a commit before #1191 may work -- https://github.com/NVIDIA/apex/commits/master

maybe before #1171, commit between #1171 and #1191 doesn't work.

AndyYuan96 avatar Nov 03 '21 02:11 AndyYuan96

Have you solved the problem? I am faced with this problem now. @AndyYuan96

zyl1336110861 avatar Nov 03 '21 08:11 zyl1336110861

Hi, I just solved my problem by rolling back the version of apex like this: git checkout f3a960f80244cf9e80558ab30f7f7e8cbf03c0a0

zyl1336110861 avatar Nov 03 '21 09:11 zyl1336110861

een #1171 and #1191 doesn't work.

yes, code changes commited at #1171, so, a little early version should work.

A usable version zip: Download old version apex

miko-cn avatar Nov 03 '21 09:11 miko-cn

@crcrpar I think maybe apex should add something info into README.md file, which about these changes may affect some old version torch.

miko-cn avatar Nov 03 '21 09:11 miko-cn

git checkout f3a960f80244cf9e80558ab30f7f7e8cbf03c0a0

git checkout -b f3a960f80244cf9e80558ab30f7f7e8cbf03c0a0

hszhoushen avatar Nov 27 '21 09:11 hszhoushen