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

kallisto 0.50.1 fails with "Illegal instruction" when built on machines with AVX-512 #424

Open
stianlagstad opened this issue Feb 14, 2024 · 2 comments

Comments

@stianlagstad
Copy link

stianlagstad commented Feb 14, 2024

Similar previous issues:

I thought that the release 0.50.1 should have fixed this, since release notes for 0.50.1 here say:

Fix some compilation issues in Bifrost

and since the issue #399 is closed, but the issue seems to remain.

Here is what I get when I try to use kallisto (built on an AVX-512 machine) on a non-AVX-512 machine:

root@ef47872a024f:/usr/src/app# cat test.fa
>seq0
FQTWEEFSRAAEKLYLADPMKVRVVLKYRHVDGNLCIKVTDDLVCLVYRTDQAQDVKKIEKF
>seq1
KYRTWEEFTRAAEKLYQADPMKVRVVLKYRHCDGNLCIKVTDDVVCLLYRTDQAQDVKKIEKFHSQLMRLME LKVTDNKECLKFKTDQAQEAKKMEKLNNIFFTLM
>seq2
EEYQTWEEFARAAEKLYLTDPMKVRVVLKYRHCDGNLCMKVTDDAVCLQYKTDQAQDVKKVEKLHGK
>seq3
MYQVWEEFSRAVEKLYLTDPMKVRVVLKYRHCDGNLCIKVTDNSVCLQYKTDQAQDVK
>seq4
EEFSRAVEKLYLTDPMKVRVVLKYRHCDGNLCIKVTDNSVVSYEMRLFGVQKDNFALEHSLL
>seq5
SWEEFAKAAEVLYLEDPMKCRMCTKYRHVDHKLVVKLTDNHTVLKYVTDMAQDVKKIEKLTTLLMR
>seq6
FTNWEEFAKAAERLHSANPEKCRFVTKYNHTKGELVLKLTDDVVCLQYSTNQLQDVKKLEKLSSTLLRSI
>seq7
SWEEFVERSVQLFRGDPNATRYVMKYRHCEGKLVLKVTDDRECLKFKTDQAQDAKKMEKLNNIFF
>seq8
SWDEFVDRSVQLFRADPESTRYVMKYRHCDGKLVLKVTDNKECLKFKTDQAQEAKKMEKLNNIFFTLM
>seq9
KNWEDFEIAAENMYMANPQNCRYTMKYVHSKGHILLKMSDNVKCVQYRAENMPDLKK
>seq10
FDSWDEFVSKSVELFRNHPDTTRYVVKYRHCEGKLVLKVTDNHECLKFKTDQAQDAKKMEK

root@ef47872a024f:/usr/src/app# kallisto index test.fa -i test.fa.idx

Illegal instruction (core dumped)

root@ef47872a024f:/usr/src/app# kallisto version
kallisto, version 0.50.1

If I install kallisto on a machine without AVX-512 however, then I get no problems.

Is it possible to build kallisto and somehow feed the argument -DENABLE_AVX2=OFF to bifrost? Ref https://github.com/pmelsted/bifrost#installation.

@stianlagstad
Copy link
Author

I was able to make this work by changing the file CMakeLists.txt and changing this:

ExternalProject_Add(bifrost
    PREFIX ${PROJECT_SOURCE_DIR}/ext/bifrost
    SOURCE_DIR ${PROJECT_SOURCE_DIR}/ext/bifrost
    BUILD_IN_SOURCE 1
    CONFIGURE_COMMAND mkdir -p build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=${PREFIX} -DCMAKE_CXX_FLAGS=${PROJECT_BIFROST_CMAKE_CXX_FLAGS}
    BUILD_COMMAND cd build && make
    INSTALL_COMMAND ""
)

to this:

ExternalProject_Add(bifrost
    PREFIX ${PROJECT_SOURCE_DIR}/ext/bifrost
    SOURCE_DIR ${PROJECT_SOURCE_DIR}/ext/bifrost
    BUILD_IN_SOURCE 1
    CONFIGURE_COMMAND mkdir -p build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=${PREFIX} -DCMAKE_CXX_FLAGS=${PROJECT_BIFROST_CMAKE_CXX_FLAGS} -DENABLE_AVX2=OFF
    BUILD_COMMAND cd build && make
    INSTALL_COMMAND ""
)

The change is to add -DENABLE_AVX2=OFF to CONFIGURE_COMMAND, ref https://github.com/pmelsted/bifrost#installation.

@Yenaled
Copy link
Collaborator

Yenaled commented Feb 14, 2024

Thank you so much! I have been looking into these issues related to these instruction sets. I think we should add an option to disable it directly when 'cmaking' kallisto (and perhaps have the disabled version be in the released precompiled binaries). I'll see what @pmelsted says; he and I have been discussing these issues over the past couple of weeks.

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

2 participants