-
Notifications
You must be signed in to change notification settings - Fork 12
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
ncnnqat的环境问题 #1
Comments
您好: 您的邮件我已收到,我会尽快回复。 刘洪宇
|
修改fake_quantize.cu,如下: #include "fake_quantize.h" global void max_reduce(float* restrict data, float* out_ptr, int width, int lg_n)
} global void fake_quantize_layer_google(float* restrict a,
} global void fake_quantize_layer_aciq(float* restrict a,
} global void fake_quantize_channel_aciq(float* restrict a,
}
} std::vector fake_quantize_weight_cuda(Tensor a, int bit_width,int c ,int aciq)
} std::vector fake_quantize_cuda(Tensor a, int bit_width,int type,int c,int aciq) |
全贴上就行了,不用管中间那个可以拷贝的区域还是别的 |
requirements.txt我写了: 配套的python版本是3.7 |
如上是安装成功的标志 |
在使用pip install ncnnqat的时候会产生如下报错:
File "setup.py", line 3, in
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
ModuleNotFoundError: No module named 'torch'
但log上的显示的python地址和版本里面确有安装torch
若直接对该版本进行编译,则会出现下述问题:
make[1]: Entering directory '/root/ncnnqat'
NVCC src/fake_quantize.cu
nvcc -std=c++14 -ccbin=g++ -Xcompiler -fPIC -use_fast_math -DNDEBUG -O3 -I./ -I/usr/local/cuda/include -I/opt/conda/include/python3.7m -I/opt/conda/lib/python3.7/site-packages/torch/include -I/opt/conda/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/opt/conda/lib/python3.7/site-packages/torch/include/TH -I/opt/conda/lib/python3.7/site-packages/torch/include/THC -DTORCH_API_INCLUDE_EXTENSION_H -D_GLIBCXX_USE_CXX11_ABI=0 -gencode arch=compute_50,code=sm_50 -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_75,code=compute_75 -M src/fake_quantize.cu -o obj/cuda/fake_quantize.d
-odir obj/cuda
nvcc -std=c++14 -ccbin=g++ -Xcompiler -fPIC -use_fast_math -DNDEBUG -O3 -I./ -I/usr/local/cuda/include -I/opt/conda/include/python3.7m -I/opt/conda/lib/python3.7/site-packages/torch/include -I/opt/conda/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/opt/conda/lib/python3.7/site-packages/torch/include/TH -I/opt/conda/lib/python3.7/site-packages/torch/include/THC -DTORCH_API_INCLUDE_EXTENSION_H -D_GLIBCXX_USE_CXX11_ABI=0 -gencode arch=compute_50,code=sm_50 -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_75,code=compute_75 -c src/fake_quantize.cu -o obj/cuda/fake_quantize.o
/opt/conda/lib/python3.7/site-packages/torch/include/ATen/record_function.h(18): warning: attribute "visibility" does not apply here
/opt/conda/lib/python3.7/site-packages/torch/include/torch/csrc/autograd/profiler.h(97): warning: attribute "visibility" does not apply here
/opt/conda/lib/python3.7/site-packages/torch/include/torch/csrc/autograd/profiler.h(126): warning: attribute "visibility" does not apply here
src/fake_quantize.cu(15): error: a value of type "const float *" cannot be assigned to an entity of type "float *"
src/fake_quantize.cu(21): error: identifier "Row" is undefined
src/fake_quantize.cu(88): warning: variable "momenta" was declared but never referenced
/opt/conda/lib/python3.7/site-packages/torch/include/c10/util/TypeCast.h(27): warning: calling a constexpr host function("real") from a host device function("apply") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.
detected during:
instantiation of "decltype(auto) c10::maybe_real<true, src_t>::apply(src_t) [with src_t=c10::complex]"
(57): here
instantiation of "uint8_t c10::static_cast_with_inter_type<uint8_t, src_t>::apply(src_t) [with src_t=c10::complex]"
(166): here
instantiation of "To c10::convert<To,From>(From) [with To=uint8_t, From=c10::complex]"
(178): here
instantiation of "To c10::checked_convert<To,From>(From, const char *) [with To=uint8_t, From=c10::complex]"
/opt/conda/lib/python3.7/site-packages/torch/include/c10/core/Scalar.h(66): here
2 errors detected in the compilation of "/tmp/tmpxft_00000066_00000000-11_fake_quantize.compute_75.cpp1.ii".
Makefile:70: recipe for target 'obj/cuda/fake_quantize.o' failed
make[1]: *** [obj/cuda/fake_quantize.o] Error 1
make[1]: Leaving directory '/root/ncnnqat'
running install
running bdist_egg
running egg_info
writing ncnnqat.egg-info/PKG-INFO
writing dependency_links to ncnnqat.egg-info/dependency_links.txt
writing requirements to ncnnqat.egg-info/requires.txt
writing top-level names to ncnnqat.egg-info/top_level.txt
reading manifest file 'ncnnqat.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'ncnnqat.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
building 'quant_cuda' extension
Emitting ninja build file /root/ncnnqat/build/temp.linux-x86_64-3.7/build.ninja...
Compiling objects...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
ninja: no work to do.
g++ -pthread -shared -B /opt/conda/compiler_compat -L/opt/conda/lib -Wl,-rpath=/opt/conda/lib -Wl,--no-as-needed -Wl,--sysroot=/ /root/ncnnqat/build/temp.linux-x86_64-3.7/./src/fake_quantize.o -Lobj -L/opt/conda/lib/python3.7/site-packages/torch/lib -L/usr/local/cuda/lib64 -lquant_cuda -lc10 -ltorch -ltorch_cpu -ltorch_python -lcudart -lc10_cuda -ltorch_cuda -o build/lib.linux-x86_64-3.7/quant_cuda.cpython-37m-x86_64-linux-gnu.so
/opt/conda/compiler_compat/ld: cannot find -lquant_cuda
collect2: error: ld returned 1 exit status
error: command 'g++' failed with exit status 1
Makefile:106: recipe for target 'install' failed
make: *** [install] Error 1
系统中安装的torch版本为1.6.0,cuda版本是10.1,也尝试了torch1.9.0,cuda10.2,均出现了同样的问题,请帮忙看看安装环境是否有存在问题的地方,感谢!
The text was updated successfully, but these errors were encountered: