Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] pytorch2.0 isntall error: more than one user-defined conversion from "phalf" to "__half" applies: #2605

Closed
2 tasks done
chenrui17 opened this issue Feb 16, 2023 · 2 comments
Assignees

Comments

@chenrui17
Copy link

chenrui17 commented Feb 16, 2023

Prerequisite

Environment

addict 2.4.0
certifi 2022.12.7
charset-normalizer 2.1.1
cmake 3.25.0
filelock 3.9.0
idna 3.4
mmcv-full 1.7.1
mpmath 1.2.1
networkx 3.0rc1
numpy 1.24.1
Pillow 9.3.0
pip 23.0
pytorch-triton 2.0.0+0d7e753227
requests 2.28.1
setuptools 67.1.0
sympy 1.11.1
torch 2.0.0.dev20230213+cu117
torchaudio 2.0.0.dev20230213+cu117
torchvision 0.15.0.dev20230213+cu117
typing_extensions 4.4.0
urllib3 1.26.13
wheel 0.38.4
yapf 0.32.0

Reproduces the problem - code sample

no

Reproduces the problem - command or script

shell script

# create conda env
conda create -n mmcv-test python=3.8 -y
# install pytorch2.0
pip3 install numpy --pre torch torchvision torchaudio --force-reinstall --index-url https://download.pytorch.org/whl/nightly/cu117
# clone github mmcv and install mmcv
MMCV_WITH_OPS=1 python setup.py install

Reproduces the problem - error message

error messages

[37/129] /usr/local/cuda/bin/nvcc  -DMMCV_WITH_CUDA -I/home/users/chenrui17/github/mmcv/mmcv/ops/csrc/pytorch -I/home/users/chenrui17/github/mmcv/mmcv/ops/csrc/common -I/home/users/chenrui17/github/mmcv/mmcv/ops/csrc/common/cuda -I/opt/conda/envs/torch-2.0-inductor-test/lib/python3.8/site-packages/torch/include -I/opt/conda/envs/torch-2.0-inductor-test/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/opt/conda/envs/torch-2.0-inductor-test/lib/python3.8/site-packages/torch/include/TH -I/opt/conda/envs/torch-2.0-inductor-test/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/opt/conda/envs/torch-2.0-inductor-test/include/python3.8 -c -c /home/users/chenrui17/github/mmcv/mmcv/ops/csrc/pytorch/cuda/carafe_cuda.cu -o /home/users/chenrui17/github/mmcv/build/temp.linux-x86_64-cpython-38/mmcv/ops/csrc/pytorch/cuda/carafe_cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -std=c++14 -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_ext -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_52,code=sm_52 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_61,code=sm_61 -gencode=arch=compute_70,code=sm_70 -gencode=arch=compute_75,code=sm_75 -gencode=arch=compute_80,code=sm_80 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86
FAILED: /home/users/chenrui17/github/mmcv/build/temp.linux-x86_64-cpython-38/mmcv/ops/csrc/pytorch/cuda/carafe_cuda.o
/usr/local/cuda/bin/nvcc  -DMMCV_WITH_CUDA -I/home/users/chenrui17/github/mmcv/mmcv/ops/csrc/pytorch -I/home/users/chenrui17/github/mmcv/mmcv/ops/csrc/common -I/home/users/chenrui17/github/mmcv/mmcv/ops/csrc/common/cuda -I/opt/conda/envs/torch-2.0-inductor-test/lib/python3.8/site-packages/torch/include -I/opt/conda/envs/torch-2.0-inductor-test/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/opt/conda/envs/torch-2.0-inductor-test/lib/python3.8/site-packages/torch/include/TH -I/opt/conda/envs/torch-2.0-inductor-test/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/opt/conda/envs/torch-2.0-inductor-test/include/python3.8 -c -c /home/users/chenrui17/github/mmcv/mmcv/ops/csrc/pytorch/cuda/carafe_cuda.cu -o /home/users/chenrui17/github/mmcv/build/temp.linux-x86_64-cpython-38/mmcv/ops/csrc/pytorch/cuda/carafe_cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -std=c++14 -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_ext -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_52,code=sm_52 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_61,code=sm_61 -gencode=arch=compute_70,code=sm_70 -gencode=arch=compute_75,code=sm_75 -gencode=arch=compute_80,code=sm_80 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86
/home/users/chenrui17/github/mmcv/mmcv/ops/csrc/common/cuda/carafe_cuda_kernel.cuh(62): error: more than one user-defined conversion from "phalf" to "__half" applies:
            function "__half::__half(float)"
/usr/local/cuda/include/cuda_fp16.hpp(201): here
            function "__half::__half(__half &&)" (declared implicitly)

/opt/conda/envs/torch-2.0-inductor-test/lib/python3.8/site-packages/torch/include/c10/util/irange.h(54): warning #186-D: pointless comparison of unsigned integer with zero
          detected during:
            instantiation of "__nv_bool c10::detail::integer_iterator<I, one_sided, <unnamed>>::operator==(const c10::detail::integer_iterator<I, one_sided, <unnamed>> &) const [with I=size_t, one_sided=false, <unnamed>=0]"
(61): here
            instantiation of "__nv_bool c10::detail::integer_iterator<I, one_sided, <unnamed>>::operator!=(const c10::detail::integer_iterator<I, one_sided, <unnamed>> &) const [with I=size_t, one_sided=false, <unnamed>=0]"
/opt/conda/envs/torch-2.0-inductor-test/lib/python3.8/site-packages/torch/include/c10/core/TensorImpl.h(77): here

/opt/conda/envs/torch-2.0-inductor-test/lib/python3.8/site-packages/torch/include/c10/util/irange.h(54): warning #186-D: pointless comparison of unsigned integer with zero
          detected during:
            instantiation of "__nv_bool c10::detail::integer_iterator<I, one_sided, <unnamed>>::operator==(const c10::detail::integer_iterator<I, one_sided, <unnamed>> &) const [with I=std::size_t, one_sided=true, <unnamed>=0]"
(61): here
            instantiation of "__nv_bool c10::detail::integer_iterator<I, one_sided, <unnamed>>::operator!=(const c10::detail::integer_iterator<I, one_sided, <unnamed>> &) const [with I=std::size_t, one_sided=true, <unnamed>=0]"
/opt/conda/envs/torch-2.0-inductor-test/lib/python3.8/site-packages/torch/include/ATen/core/qualified_name.h(73): here

1 error detected in the compilation of "/home/users/chenrui17/github/mmcv/mmcv/ops/csrc/pytorch/cuda/carafe_cuda.cu".

Additional information

no

@grimoire
Copy link
Member

#2608 Please have a try.

@chenrui17
Copy link
Author

#2608 Please have a try.

Problem solved, Thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants