Open ivanbaldo opened 8 months ago
That seems more like a generic cuda issue than something candle specific. Quickly googling about the error message, I got this issue which suggested adding --compiler-options -fPIC
to CUDA_NVCC_FLAGS
(this environment variable makes it easy to add flags to the nvcc
calls that are made when cargo builds the flash attn kernels). Did you already try something like this?
Tried compiling like this but same error still:
CUDA_NVCC_FLAGS='--compiler-options -fPIC' cargo build --features cuda,cudnn,flash-attn,nccl
Maybe try -fPIE
rather than -fPIC
as per the error message. Besides this you should probably try to google about it as I doubt it's actually candle specific.
This didn't work neither:
CUDA_NVCC_FLAGS='--compiler-options -fPIE' cargo build --features cuda,cudnn,flash-attn,nccl
candle-flash-attn use build.rs to compile cuda code, but it did not use any env like CUDA_NVCC_FLAGS; currently, u have to add the flags --compiler-options -fPIC
at https://github.com/huggingface/candle/blob/main/candle-flash-attn/build.rs#L63
Thanks @yinqiwen! As you suggested, adding the following to that file, the compilation works:
.arg("--compiler-options")
.arg("-fPIC")
Maybe these options could be added by default?
Hello. This was reported wrongly here https://github.com/EricLBuehler/candle-vllm/issues/25 but it's actually an issue with candle-core. Here is a Dockerfile reproducing the problem:
And here is partial output of the error:
Thanks!!!