apex icon indicating copy to clipboard operation
apex copied to clipboard

Could not find permutation search CUDA kernels, falling back to CPU path

Open te-shi opened this issue 4 years ago • 5 comments

When I follow the command below to import the ASP module, it appears 'Could not find permutation search CUDA kernels, falling back to CPU path'.

from apex.contrib.sparsity import ASP Could not find permutation search CUDA kernels, falling back to CPU path [ASP][Info] permutation_search_kernels can be imported.

Environment OS: Ubuntu Python: 3.8 CUDA: 11.3 PyTorch: 1.12

te-shi avatar Jul 12 '22 03:07 te-shi

pip install -v --disable-pip-version-check --no-cache-dir --global-option="--permutation_search" ./

lfs119 avatar Sep 22 '22 09:09 lfs119

@lfs119 did this command help you fix this error?

gcunhase avatar Oct 11 '22 22:10 gcunhase

I have encountered the same problem. Did you get ways to solve this ?

Shan2L avatar Aug 04 '23 07:08 Shan2L

i found --global-option="--permutation_search" is not work,maybe you can modify setup.py and open permutation_search build by set as flows:

    # if "--permutation_search" in sys.argv:
if True:
    # sys.argv.remove("--permutation_search")
    if CUDA_HOME is None:
        raise RuntimeError("--permutation_search was requested, but nvcc was not found.  Are you sure your environment has nvcc available?  If you're installing within a container from https://hub.docker.com/r/pytorch/pytorch, only images whose names contain 'devel' will provide nvcc.")
    else:
        cc_flag = ['-Xcompiler', '-fPIC', '-shared']
        ext_modules.append(
            CUDAExtension(name='permutation_search_cuda',
                          sources=['apex/contrib/sparsity/permutation_search_kernels/CUDA_kernels/permutation_search_kernels.cu'],
                          include_dirs=[os.path.join(this_dir, 'apex', 'contrib', 'sparsity', 'permutation_search_kernels', 'CUDA_kernels')],
                          extra_compile_args={'cxx': ['-O3'] + version_dependent_macros,
                                              'nvcc':['-O3'] + version_dependent_macros + cc_flag}))

TangAL0203 avatar Dec 07 '23 08:12 TangAL0203

Because the cuda ext not compiled.

lix19937 avatar Oct 23 '24 02:10 lix19937