Skip to content

Commit 02487f2

Browse files
Pull latest Foldseek and other misc changes (#22)
* Squashed 'lib/foldseek/' changes from 0dd4b7f27..fbf7df071 fbf7df071 Remove outdated --report-mode override 09ce330d5 Merge commit 'e02ab8599c7837d1ab937c69cac43ed7f7fa25cf' e02ab8599 Squashed 'lib/corrosion/' changes from dc1e4e5ae..b1fab7216 e86a3e829 Make CI uploads fail correctly 1790c72e9 Fix duplicate parameter issue 56b6aae87 Merge commit '4b863f851c26f4e8c0d3b8d99b360f5c2252ce1d' 4b863f851 Squashed 'lib/mmseqs/' changes from 3b32df1af..e49a41dd0 07e05d321 Move workflow parameter lists to the end and add result2structprofile to search 373aa3ecd Merge pull request #432 from sooyoung-cha/master 1164bb7e7 typo 4e2c415ec minor f45e2113e added teddb to prebuilt databases 2dd135b37 Squashed 'lib/mmseqs/' changes from 983349dfe..3b32df1af f90da3f45 Merge commit '2dd135b37658bdb87be123d6047af9e0e21ae49a' 63a32e3b1 Squashed 'lib/mmseqs/' changes from b804fbe38..983349dfe f1bc14ac5 Merge commit '63a32e3b1e3321ab19588df7f867b71f7224d8b3' e5ff64d43 Int32 SW to fix overflow issues with long inputs 6cfb8805b Merge pull request #423 from steineggerlab/Woosub-Kim-patch-1 dc53f73d1 update citations c771fced2 Update LocalParameters.cpp 3a4e9c8e2 Update README.md 98cce76ef Merge pull request #420 from sooyoung-cha/master 69b74dcd3 createsubdb can get penguin as input 87fd24b03 Fix LDDT becoming NaN for residues with very large distances #419 9c31b42b4 Remove check for _seq_ca in cluster search to make prostt5-based cluster search work f2dfbb532 minor 33b42b017 filename error solved for the interface mode during createdb 284d732b9 Not merging filtermultimer's result 19de12852 not merging the result of scoremultimer(multimersearch) c0404f876 Update expandmultimer.cpp 07932751e Reduce ProstT5 memory requirements 1013c94f4 Squashed 'lib/mmseqs/' changes from 0898eb9012..b804fbe384 941cd33ff Merge commit '1013c94f45b354432a8b0bbf107daf4945824052' 4a1a2892b Merge pull request #411 from rachelse/PR_master 4aba8c341 Fix structureto3didescriptor returning uninitialized values for masked positions #410 b03e21cd1 Hide the old *complex* modules/workflows that remain for compatibility f2eede7e1 Add licenses for kerasify and tmalign 9323f5520 Update glibc requirements in readme to 2.17 4c2092a4b Rework result2structprofile to work correctly with precomputed index 4c1d03671 Move azure to macos-latest and add check that MACOSX_DEPLOYMENT_TARGET was set correctly in osx build script b903391eb Merge branch 'master' of https://github.com/steineggerlab/foldseek 657a00818 Adjust mask-n parameter 9d2386ae0 Update regression c438b917f Rework masking parameter to solve steineggerlab/foldseek#408 5ee02608e Squashed 'lib/mmseqs/' changes from 9a7c68d2f..0898eb901 00adfe425 Merge commit '5ee02608ebca0d9133d3cc3533b9dbe6066bed75' 0404da93c Squashed 'lib/mmseqs/' changes from 73b2244de..9a7c68d2f fe4a89ace Merge commit '0404da93c107839b45f2bc4578df5dcd72cc3d70' f740aa676 Squashed 'lib/mmseqs/' changes from a53cf9159..73b2244de 68388e28d Merge commit 'f740aa67620f53e482a3575d5c2b1e488c78c968' 3cc96afdd Squashed 'lib/mmseqs/' changes from 4766f92dd..a53cf9159 109429a42 Merge commit '3cc96afdd18be79ca283994b608dca471bdc8db3' 8ee648162 Squashed 'lib/mmseqs/' changes from 934db4f98..4766f92dd dd6e29f86 Merge commit '8ee648162dae5986ac074249ef43d0bcc49353d0' 591cd2ccb Merge commit 'ea47a9229d9c37c223209767085d1bdde19099d6' ea47a9229 Squashed 'lib/mmseqs/' changes from 416fc728..934db4f9 12b76f35b Update README.md 6f52e8c57 Fix build without fork runner 1ccc8eeed Improve progress in fork runner a1323281e Squashed 'lib/mmseqs/' changes from 35537c46a..416fc7283 8b90b98be Merge commit 'a1323281ec50373d7982096bf47d49254b7ca498' 7d84f0dc5 Fork runner for more reliable CPU ProstT5 758d3e32c cleanup shell space 87f091375 make sub tmp in easy-multumercluster and erase it 076550087 clean up easy multimercluster createdb 3b7660119 Try to fix issue with scoring matrix name init e4524f055 Cleanup dc8b092c5 Make sure LocalParameters are initialized as early as possible 5b5d04444 Don't start more ProstT5 models than inputs 77f3b8a12 revert multimercluster fake db. will change this when multimersearch supports subdb c6bfb9523 Fix invalid yaml 151760854 Merge commit 'bb03fed8f93b81795a9b033eb68e3bc976355b83' bb03fed8f Squashed 'lib/prostt5/' changes from 2848bc37..21c1b248 82e42bb02 Use docker based builder to make gpu binaries with glibc 2.17 dep 0125d5888 Add verbosity to more module calls 4ebaa30e9 Shellcheck cleanup f2644a648 Add existence checks around _ca accesses in scripts 79cd4b5f6 Script cleanup b2e41c189 use getRealPathFromSymLink 4fbaaaa89 result2profile, createsubdb, makepaddeddb work without file path given 630486fb9 change code in fake multimer db in multimercluster so that subdbs can be used too 84ccdb470 Sync back mmseqs build system changes 2fa7419bd Squashed 'lib/mmseqs/' changes from 17cd5c09..35537c46 8d6fca989 Merge commit '2fa7419bd3dcdf49374832f0bd53f60be9b84f3f' 2a7d68284 Fix azure GPU checks and deps d17589dad Next try for (mostly) static builds bcefc67ab Try patching find cudatoolkit to find cudart_static 44d92d522 Fix missing cuda lib versions 97d5fe8c6 Next try for GPU builds 369cca618 Try to build GPU binaries 736304124 missing CMAKE_LINK_SEARCH_START_STATIC added in cmake 3.4 was likely breaking static builds 658b2b717 Another try 75fa82d51 Hardcode openmp paths in CI 16b7f4636 Try to force static deps through cmake 94710cee2 Reenable static, replace sse2 with sse41 8c59c3d56 Typo f946a3bdf Ignore metal in CI 7da7b9bfe Show ggml debug output with -v 4 7bf582077 Improve llama device handling 128abe405 Merge branch 'master' of https://github.com/steineggerlab/foldseek 9fc6426e8 gpu for easymultimersearch, easymultimercluster 7374812b7 Update Foldseek's masking and fix result2profile 8442e4827 Update regression 10ad673b5 circumvent ggml's host CPU detection 0f212fc79 Update mac universal binary build script, drop sse support c621f8bce Squashed 'lib/mmseqs/' changes from 7f5c0003a9..17cd5c098d 9fbf02e19 Merge commit 'c621f8bceb8d879263c1249b2939bab7af4f3e57' 85b3dcb3d Try to set asm flags for cross compiling mac arm build 8b3db4a9e Fix shell check 457f6b7ad typo, result2profile should not use tmp path 46bb6b604 remove tmp paths in createsubdb e173ef89f lookup should be in multimer order for expandmultimer fb2b4ac27 Merge pull request #391 from rachelse/gpu_sooyoung ef927dbd6 Allow linking against accelerate ca260387a Next try to disable pt5 test in regression 3dbda7920 Merge branch 'master' of https://github.com/steineggerlab/foldseek 55fc20124 Add GPU to static downloads df2c3ee7d Disable Metal on intel macs 58ee1f373 Try to fix gcc_s compile issue on CI 18a9934f3 Skip prostt5 regression for sse2 ead545101 Raise minimum macos version to 10.15 for precompiled binaries d4d5c10c2 Update README 5c4f87c54 Merge branch 'master' of https://github.com/steineggerlab/foldseek 1484ab0a2 Improve README 69678d7e5 remove dynamic backend load from pt5 967c52f44 Merge branch 'master' of https://github.com/steineggerlab/foldseek 0ed12c486 Update README dea79066d Merge remote-tracking branch 'refs/remotes/origin/master' b35bf1e4e Squashed 'lib/prostt5/' changes from 112c06f2fe..2848bc370d 71157f9eb Merge commit 'b35bf1e4e766b07bee12e5bef9aa117e4bb16b04' 96ca8ed08 Merge branch 'master' of https://github.com/steineggerlab/foldseek 1683c385a Add iterative search to README e5b103e3d Hide ggml submodule from git submodule 358a4dcb6 Move --gpu parameter to search a018abf14 Explain GPU search and fasta based search 6b894530f Edit readme bc801c70c Merge remote-tracking branch 'foldseek/prostt5-llama.cpp' 04b11689b Update pt5 model url and fail on old weights 705657154 Merge remote-tracking branch 'foldseek/prostt5-llama.cpp' 6fa85a925 Set ggml options for SIMD settings 28086e334 Error if prostt5 is requested but fs was compiled without it 64948fe9e Squashed 'lib/prostt5/' changes from e86c46d1..112c06f2 28dd3cced Merge commit '64948fe9e37744c55c348b05ce5adc5d52f3e04d' into prostt5-llama.cpp 8f28d5267 Force cublas since we don't use mmq f179dea24 Merge commit 'e683ec9b1cdcc1d438457801c21d642e6847312b' into prostt5-llama.cpp e683ec9b1 Squashed 'lib/prostt5/' changes from 5c00d640..e86c46d1 0e6d0fd61 Merge commit '53d17c9ffd9636e8d8125908f3fd1d3843dcf723' into prostt5-llama.cpp 53d17c9ff Squashed 'lib/prostt5/' changes from de28a139..5c00d640 f03db7280 Better model path detection a329ee56c Squashed 'lib/prostt5/' changes from 46fd9774..de28a139 4f4e4b5f6 Merge commit 'a329ee56c326d0364f027128d436a8ebdb29d841' into prostt5-llama.cpp a5a9f8175 Initialize backends and ggml only once 479d97c18 Squashed 'lib/prostt5/' changes from bb8b3922..46fd9774 62ead8da5 Merge commit '479d97c182f0fd8e63da4367faab9579dcaed0b5' into prostt5-llama.cpp 0c6bc8fc9 Add multi-gpu, Metal and seq. splitting 243624405 createsubdb should not touch header file 624eac668 Merge remote-tracking branch 'refs/remotes/mine/prostt5-llama.cpp' into prostt5-llama.cpp ac71ee080 Squashed 'lib/prostt5/' changes from afc98a8624..bb8b3922bf bc29418e4 Merge commit 'ac71ee0801ebaf8af1e65895bb3c8ed67bc790cc' into prostt5-llama.cpp 568b9b1aa Initial GPU support 9c5b16212 Merge commit '3d8ea2ba3969be97ddffe780b08a1a92d5f31a56' into prostt5-llama.cpp 3d8ea2ba3 Squashed 'lib/prostt5/' changes from afc98a86..8c3c88a3 0d8d966cf Fix issue steineggerlab/foldseek#399 2d94c4c5b rename header index too in makepaddedseqdb 50e5b81a0 Fixes to compile cuda bd6e60f22 lookup file in makepaddedseqdb f36199501 rename multimer index of lookup 4b70f859e minor d9d681042 minor 5c6664a34 no tmp dir for makepaddedseqdb 8b7abfff1 remove base: in easymultimercluster.sh 159042cbc Initial version of new llama.cpp based prostt5 integration 717031a00 Squashed 'lib/prostt5/' content from commit afc98a8624 71ba1e6b9 Merge commit '717031a006153d13c9590cc7fb68956188743c17' as 'lib/prostt5' 1557b6824 Remove candle prostt5 a33ad06cf minor b5eed9b5f avoid tmpdir in createsubdb, result2structprofile. also if-then used in sh 19c3a9fbe Update README.md 7d9b9fb3f Merge pull request #392 from jaebeom-kim/master c28fdb8c4 Merge branch 'master' into master 87a7387c8 seq.0 should not be padded 3d04f6316 add mmseqs in front of rmdb 3d33fc7b3 adding filterdv to change _gpu_clu's content bb3d9862f clustersearch not done yet fed7127b3 makepaddedseqdb for cluster search b1af838d1 set maskProb to 0.999995 912983451 milot's changes are back d85550e96 STATIC:0 aa6f262d0 for azure check dc097ac58 minor 69bde0e9b to check why azure pipleline failing for two models c0623f59b change setStructureSearchWorkflowDefaults maskNrepeats 53079be70 Squashed 'lib/mmseqs/' changes from ddc19be5..7f5c0003 fa4c7af10 Merge commit '53079be70ac8852fb1fd65725abfef780cb46530' into gpu_sooyoung ba8bd921c minor 854230798 iterative search using foldseek result2profile 8b575afb3 parameters for result2profile 95c4b868b base in iterativesearch 44ebb9798 leave iterative search's result2profile as it is 2b4741d37 result2profile _h tpp a81c09a13 fi included 2889c08b5 Merge branch 'gpu_sooyoung' of https://github.com/rachelse/foldseek into gpu_sooyoung 898c4ecdd distinguish foldseek and base result2profile, createsubdb in other workflows 81b8a7a07 Merge branch 'steineggerlab:master' into gpu_sooyoung dd579d9e6 Fix issue steineggerlab/foldseek#393 076e7ff62 Merge pull request #1 from steineggerlab/master b2fb16d3b createsubdb for _h too eadd19a8c result2profile in one module, supporting aa and 3di 09b5283e2 createsubdb in one module 23033169c createsubdb in one module bb56d00d2 rm only if gpu 1715e56cb Merge branch 'gpu_sooyoung' of https://github.com/rachelse/foldseek into gpu_sooyoung 0101eb45a make makepaddedseqdb workflow b7aa04580 Compile with verbose edce93486 Add new prefer static cmake flag a10500d0e Squashed 'lib/mmseqs/' changes from 59016d25a..ddc19be54 c1334bdef Merge commit 'a10500d0e969db3f9e089d0957425b65c90b0836' into gpu_sooyoung d830666af Squashed 'lib/mmseqs/' changes from 9c102e13..59016d25 a09df258d Merge commit 'd830666afb8e3e196876d7747ef6e5df02e4d61d' into gpu_sooyoung e93ff18aa remove prefmode const int 1b5302ddc remove Prefmode in foldseek LocalParameter.h be1a259ad remove Prefmode in foldseek 33fe7455c Initial monomersearch GPU 96c5b8136 compatible with pre-indexed db a4b0a4984 Merge commit '57f76979da0a2d6ebe767a53f265494dadfc225c' 57f76979d Squashed 'lib/mmseqs/' changes from ffb05619..9c102e13 6bb7b20ff Revert mmseqs changes in subtree 4e2eec254 Add parameters to make a taxonomy report in easy-search git-subtree-dir: lib/foldseek git-subtree-split: fbf7df0710e901e62e9d140060209eafac81e862 * remove old includes * disable tmalign * reenable tmalign * Fix uninitialized memory in comp bias * set default params --------- Co-authored-by: Milot Mirdita <milot@mirdita.de>
1 parent 139567d commit 02487f2

File tree

2,322 files changed

+248460
-523594
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,322 files changed

+248460
-523594
lines changed
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
ARG APP=foldseek
2+
FROM quay.io/pypa/manylinux2014_x86_64
3+
ARG APP
4+
ARG VER="12-6"
5+
ARG ARCH="x86_64"
6+
7+
# CUDA
8+
RUN yum install -y yum-utils
9+
RUN yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo
10+
RUN yum -y install cuda-nvcc-${VER}.${ARCH} cuda-cudart-devel-${VER}.${ARCH} libcublas-devel-${VER}.${ARCH}
11+
RUN echo "/usr/local/cuda/lib64" >> /etc/ld.so.conf.d/999_nvidia_cuda.conf
12+
ENV PATH="/usr/local/cuda/bin:${PATH}"
13+
ENV LD_LIBRARY_PATH="/usr/local/cuda/lib64:${LD_LIBRARY_PATH}"
14+
ENV CUDA_HOME=/usr/local/cuda
15+
ENV CUDA_ROOT=/usr/local/cuda
16+
ENV CUDA_PATH=/usr/local/cuda
17+
ENV CUDADIR=/usr/local/cuda
18+
19+
# Build system
20+
RUN yum install -y git curl wget vim zlib-devel bzip2-devel ninja-build centos-release-scl
21+
RUN mv /etc/yum.repos.d/CentOS-SCLo-scl.repo /etc/yum.repos.d/CentOS-SCLo-scl.repo.disabled
22+
RUN yum install -y devtoolset-11-gcc devtoolset-11-gcc-c++ devtoolset-11-libatomic-devel
23+
ENV CC=/opt/rh/devtoolset-11/root/bin/gcc
24+
ENV CXX=/opt/rh/devtoolset-11/root/bin/g++
25+
ENV CUDAHOSTCXX=/opt/rh/devtoolset-11/root/bin/g++
26+
ENV CUDACXX=/usr/local/cuda/bin/nvcc
27+
ENV LIBGCC=/opt/rh/devtoolset-11/root/usr/lib/gcc/x86_64-redhat-linux/11
28+
29+
# cmake
30+
RUN wget https://github.com/Kitware/CMake/releases/download/v3.31.0/cmake-3.31.0-linux-x86_64.sh; \
31+
chmod +x cmake-3.31.0-linux-x86_64.sh; \
32+
./cmake-3.31.0-linux-x86_64.sh --skip-license --prefix=/usr/local;
33+
34+
RUN mkdir /deps; \
35+
cd /deps; \
36+
wget https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz; \
37+
tar xzvf bzip2-1.0.8.tar.gz; \
38+
cd bzip2-1.0.8; \
39+
make install PREFIX=/deps;
40+
41+
RUN cd /deps; \
42+
wget https://www.zlib.net/zlib-1.3.1.tar.gz; \
43+
tar xzvf zlib-1.3.1.tar.gz; \
44+
cd zlib-1.3.1; \
45+
./configure --prefix=/deps --static; \
46+
make install;
47+
48+
# install toolchain
49+
RUN curl https://sh.rustup.rs -sSf | \
50+
sh -s -- --default-toolchain stable -y
51+
ENV PATH=/root/.cargo/bin:$PATH
52+
53+
# compile
54+
WORKDIR /work
55+
ADD . .
56+
RUN mkdir -p /work/build && cd /work/build; \
57+
if [ -e "${LIBGCC}/libgomp.so" ]; then \
58+
mv -f -- "${LIBGCC}/libgomp.so" "${LIBGCC}/libgomp.so.disabled"; \
59+
fi; \
60+
/usr/local/bin/cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DHAVE_TESTS=1 -DENABLE_WERROR=1 -DHAVE_AVX2=1 \
61+
-DOpenMP_C_FLAGS="-fopenmp -I${LIBGCC} -L${LIBGCC}" -DOpenMP_C_LIB_NAMES=gomp -DOpenMP_CXX_FLAGS="-fopenmp -I${LIBGCC} -L${LIBGCC}" -DOpenMP_CXX_LIB_NAMES=gomp -DOpenMP_gomp_LIBRARY="${LIBGCC}/libgomp.a" \
62+
-DATOMIC_LIB_OVERRIDE="${LIBGCC}/libatomic.a" \
63+
-DCMAKE_POLICY_DEFAULT_CMP0074=NEW -DCMAKE_POLICY_DEFAULT_CMP0144=NEW \
64+
-DZLIB_ROOT=/deps -DBZIP2_ROOT=/deps \
65+
-DFORCE_STATIC_DEPS=1 -DENABLE_CUDA=1 -DCMAKE_CUDA_ARCHITECTURES="75-real;80-real;86-real;89-real;90" ..; \
66+
cmake --build . -j$(nproc --all) -v;
67+
68+
RUN if ldd /work/build/src/${APP} | grep -P -v "linux-vdso.so|/lib64/(ld-linux-x86-64|libc|libm|libdl|librt|libpthread|libutil).so" | grep -q .; then \
69+
echo "Error: unwanted libraries found"; \
70+
ldd /work/build/src/${APP}; \
71+
exit 1; \
72+
fi; \
73+
if readelf -Ws /work/build/src/${APP} | grep -q GLIBC_PRIVATE; then \
74+
echo "Error: binary contains private glibc symbols"; \
75+
readelf -Ws /work/build/src/${APP}; \
76+
exit 1; \
77+
fi; \
78+
LIBC_V=$(readelf -V /work/build/src/${APP} | awk '$3 ~ /^GLIBC_/ { print $3 }' | sort -V | tail -n1); \
79+
if [[ "$LIBC_V" > "GLIBC_2.17" ]]; then \
80+
echo "Error: glibc too new"; \
81+
readelf -V /work/build/src/${APP}; \
82+
exit 1; \
83+
fi;

lib/foldseek/.github/workflows/docker.yml

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ on:
1111
tag:
1212
required: true
1313
type: string
14+
description: "Docker tag"
1415
latest:
1516
default: false
1617
type: boolean
18+
description: "Mark as latest"
1719

1820

1921
env:
@@ -45,7 +47,7 @@ jobs:
4547

4648
- name: Extract metadata (tags, labels) for Docker
4749
id: meta
48-
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
50+
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81
4951
with:
5052
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
5153

@@ -77,4 +79,63 @@ jobs:
7779
${{ steps.dispatch_tag.outputs.tag }}
7880
${{ steps.dispatch_tag.outputs.latest }}
7981
labels: ${{ steps.meta.outputs.labels }}
82+
build-and-push-gpu-image:
83+
runs-on: ubuntu-latest
84+
permissions:
85+
contents: read
86+
packages: write
87+
steps:
88+
- name: Checkout repository
89+
uses: actions/checkout@v3
90+
91+
# - name: Set up QEMU
92+
# uses: docker/setup-qemu-action@v2
93+
94+
- name: Set up Docker Buildx
95+
uses: docker/setup-buildx-action@v2
96+
97+
- name: Log in to the Container registry
98+
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
99+
with:
100+
registry: ${{ env.REGISTRY }}
101+
username: ${{ github.actor }}
102+
password: ${{ secrets.GITHUB_TOKEN }}
103+
104+
- name: Extract metadata (tags, labels) for Docker
105+
id: meta
106+
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81
107+
with:
108+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
109+
flavor: |
110+
suffix=-cuda12,onlatest=true
111+
112+
- name: Tag for workflow_dispatch
113+
id: dispatch_tag
114+
run: |
115+
if [ x"$TAG" != x"" ];then
116+
echo "::set-output name=tag::${FULL_TAG}"
117+
fi
118+
if [ x"$LATEST" = x"true" ]; then
119+
echo "::set-output name=latest::${LATEST_TAG}"
120+
fi
121+
env:
122+
FULL_TAG: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.event.inputs.tag }}
123+
LATEST_TAG: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
124+
TAG: ${{ github.event.inputs.tag }}
125+
LATEST: ${{ github.event.inputs.latest }}
80126

127+
- name: Build and push Docker image
128+
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
129+
with:
130+
context: .
131+
platforms: linux/amd64
132+
push: true
133+
cache-from: type=gha
134+
cache-to: type=gha,mode=max
135+
build-args: |
136+
GPU=1
137+
tags: |
138+
${{ steps.meta.outputs.tags }}
139+
${{ steps.dispatch_tag.outputs.tag }}
140+
${{ steps.dispatch_tag.outputs.latest }}
141+
labels: ${{ steps.meta.outputs.labels }}

lib/foldseek/.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
path = lib/mmseqs/util/regression
33
url = https://github.com/soedinglab/MMseqs2-Regression.git
44
update = none
5+
[submodule "lib/prostt5/ggml/src/ggml-kompute/kompute"]
6+
path = lib/prostt5/ggml/src/ggml-kompute/kompute
7+
url =
8+
update = none
59
[submodule "regression"]
610
path = regression
711
url = https://github.com/steineggerlab/foldseek-regression

lib/foldseek/CMakeLists.txt

Lines changed: 61 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,31 @@ cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
22
# keep old policy for setting implicit link libraries
33
# zlib causes issues in static builds otherwise
44
cmake_policy(SET CMP0060 OLD)
5+
cmake_policy(SET CMP0074 NEW)
56
project(foldseek C CXX)
6-
#set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
7-
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/lib/mmseqs/cmake")
7+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/lib/mmseqs/cmake")
88

99
set(ENABLE_PROSTT5 1 CACHE BOOL "Enable ProstT5")
1010
set(ENABLE_CUDA 0 CACHE BOOL "Enable CUDA")
1111
set(IGNORE_RUST_VERSION 0 CACHE BOOL "Ignore Rust version check")
12+
set(FORCE_STATIC_DEPS 0 CACHE BOOL "Force static linking of deps")
1213

13-
if (NOT CMAKE_BUILD_TYPE)
14-
set(CMAKE_BUILD_TYPE Release)
15-
endif ()
14+
if(FORCE_STATIC_DEPS)
15+
if(ENABLE_CUDA)
16+
set(CMAKE_FIND_LIBRARY_SUFFIXES .a .so CACHE INTERNAL "" FORCE)
17+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++")
18+
else()
19+
set(CMAKE_FIND_LIBRARY_SUFFIXES .a CACHE INTERNAL "" FORCE)
20+
set(CMAKE_LINK_SEARCH_START_STATIC ON CACHE INTERNAL "" FORCE)
21+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static -static-libgcc -static-libstdc++")
22+
endif()
23+
set(BUILD_SHARED_LIBS OFF CACHE INTERNAL "" FORCE)
24+
endif()
25+
26+
if(NOT XCODE AND NOT MSVC AND NOT CMAKE_BUILD_TYPE)
27+
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
28+
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
29+
endif()
1630

1731
set(FRAMEWORK_ONLY 1 CACHE INTERNAL "" FORCE)
1832
include(MMseqsSetupDerivedTarget)
@@ -38,6 +52,7 @@ set(ENV{CARGO_NET_OFFLINE} true)
3852
add_subdirectory(lib/corrosion)
3953
# don't try to link to gcc_s, its not needed anyway
4054
list(REMOVE_ITEM Rust_CARGO_TARGET_LINK_NATIVE_LIBS "gcc_s")
55+
set(Rust_CARGO_TARGET_LINK_NATIVE_LIBS ${Rust_CARGO_TARGET_LINK_NATIVE_LIBS} CACHE INTERNAL "")
4156

4257
if(Rust_VERSION VERSION_LESS "1.68.0" AND NOT IGNORE_RUST_VERSION)
4358
message(FATAL_ERROR "Rust >= 1.68.0 is required")
@@ -80,27 +95,52 @@ if(EMSCRIPTEN)
8095
corrosion_add_target_local_rustflags(block_aligner_c "-Clink-args=--no-entry -sRELOCATABLE=1")
8196
endif()
8297

83-
set(CANDLE_FEATURE "")
84-
if(ENABLE_CUDA)
85-
if(NOT DEFINED CUDAToolkit_ROOT)
86-
message(FATAL_ERROR "please set -DCUDAToolkit_ROOT=path-to-cuda")
87-
endif()
88-
set(CANDLE_FEATURE cuda)
98+
if(HAVE_SSE2)
99+
message(WARNING "ProstT5 support requires at least SSE4.1, disabling ProstT5")
100+
set(ENABLE_PROSTT5 OFF)
89101
endif()
90102

91103
if(ENABLE_PROSTT5)
92-
corrosion_import_crate(
93-
MANIFEST_PATH lib/prostt5/c/Cargo.toml
94-
CRATE_TYPES staticlib
95-
FEATURES "${CANDLE_FEATURE}"
96-
)
97-
if(ENABLE_CUDA)
98-
corrosion_set_env_vars(cprostt5 CUDA_ROOT=${CUDAToolkit_ROOT})
104+
set(CMAKE_SYSTEM_PROCESSOR_TMP ${CMAKE_SYSTEM_PROCESSOR})
105+
# circumvent ggml's host CPU detection
106+
if(ARM)
107+
set(CMAKE_SYSTEM_PROCESSOR aarch64)
99108
endif()
100-
include_directories(lib/prostt5/c)
101-
if(EMSCRIPTEN)
102-
corrosion_add_target_local_rustflags(cprostt5 "-Clink-args=--no-entry -sRELOCATABLE=1")
109+
if(X86 OR X64)
110+
set(CMAKE_SYSTEM_PROCESSOR x86_64)
111+
endif()
112+
if(PPC64)
113+
set(CMAKE_SYSTEM_PROCESSOR ppc64)
114+
endif()
115+
set(GGML_STATIC ON)
116+
set(BUILD_SHARED_LIBS OFF)
117+
set(GGML_BLAS OFF)
118+
set(GGML_OPENMP OFF)
119+
if (NOT NATIVE_ARCH)
120+
set(GGML_NATIVE OFF)
121+
if (HAVE_AVX2)
122+
set(GGML_AVX2 ON)
123+
set(GGML_AVX ON)
124+
set(GGML_FMA ON)
125+
set(GGML_F16C ON)
126+
elseif(HAVE_SSE4_1)
127+
set(GGML_AVX2 OFF)
128+
set(GGML_AVX OFF)
129+
set(GGML_FMA OFF)
130+
set(GGML_F16C OFF)
131+
endif()
132+
endif()
133+
if (ENABLE_CUDA)
134+
set(GGML_CUDA ON)
135+
set(GGML_CUDA_F16 ON)
136+
set(GGML_CUDA_FORCE_CUBLAS ON)
137+
set(GGML_CUDA_NO_VMM ON)
138+
endif()
139+
if (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
140+
set(GGML_METAL OFF)
103141
endif()
142+
add_subdirectory(lib/prostt5 EXCLUDE_FROM_ALL)
143+
set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR_TMP})
104144
endif()
105145

106146
add_subdirectory(src)

lib/foldseek/Dockerfile

Lines changed: 45 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
ARG APP=foldseek
2-
FROM --platform=$BUILDPLATFORM debian:stable-backports as builder
2+
FROM --platform=$BUILDPLATFORM debian:bookworm-slim AS builder
33
ARG TARGETARCH
44
ARG APP
5+
ARG GPU
56

67
RUN dpkg --add-architecture $TARGETARCH \
78
&& apt-get update \
89
&& apt-get install -y \
910
build-essential curl xxd git cmake \
1011
zlib1g-dev libbz2-dev libatomic1 \
11-
crossbuild-essential-$TARGETARCH zlib1g-dev:$TARGETARCH libbz2-dev:$TARGETARCH \
12-
&& rm -rf /var/lib/apt/lists/*
12+
crossbuild-essential-$TARGETARCH zlib1g-dev:$TARGETARCH libbz2-dev:$TARGETARCH; \
13+
if [ "$GPU" = "1" ]; then \
14+
curl -O https://developer.download.nvidia.com/compute/cuda/repos/debian12/x86_64/cuda-keyring_1.1-1_all.deb; \
15+
dpkg -i cuda-keyring_1.1-1_all.deb; \
16+
apt-get update && apt-get install -y cuda-nvcc-12-6 cuda-cudart-dev-12-6 libcublas-dev-12-6 ninja-build; \
17+
fi; \
18+
rm -rf /var/lib/apt/lists/*;
1319

1420
RUN if [ "$TARGETARCH" = "arm64" ]; then \
1521
ARCH=aarch64; \
@@ -29,31 +35,49 @@ RUN if [ "$TARGETARCH" = "arm64" ]; then \
2935
CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ cmake -DHAVE_ARM8=1 -DHAVE_MPI=0 -DHAVE_TESTS=0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=. ..; \
3036
make -j $(nproc --all); \
3137
mv src/${APP} /opt/build/${APP}_arch; \
32-
touch /opt/build/${APP}_sse2 /opt/build/${APP}_avx2; \
38+
touch /opt/build/${APP}_sse41 /opt/build/${APP}_avx2; \
3339
else \
34-
mkdir -p build_sse2/src && mkdir -p build_avx2/src; \
35-
cd /opt/build/build_sse2; \
36-
cmake -DHAVE_SSE2=1 -DHAVE_MPI=0 -DHAVE_TESTS=0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=. ..; \
37-
make -j $(nproc --all); \
38-
mv src/${APP} /opt/build/${APP}_sse2; \
39-
cd /opt/build/build_avx2; \
40-
cmake -DHAVE_AVX2=1 -DHAVE_MPI=0 -DHAVE_TESTS=0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=. ..; \
41-
make -j $(nproc --all); \
42-
mv src/${APP} /opt/build/${APP}_avx2; \
43-
touch /opt/build/${APP}_arch; \
40+
if [ "$GPU" = "1" ]; then \
41+
export CUDACXX=/usr/local/cuda/bin/nvcc; \
42+
mkdir -p build_avx2/src; \
43+
cd /opt/build/build_avx2; \
44+
LIBGOMP=/usr/lib/gcc/x86_64-linux-gnu/12/; \
45+
cmake -GNinja -DHAVE_AVX2=1 -DHAVE_MPI=0 -DHAVE_TESTS=0 -DFORCE_STATIC_DEPS=1 \
46+
-DENABLE_CUDA=1 -DCMAKE_CUDA_ARCHITECTURES="75-real;80-real;86-real;89-real;90" \
47+
-DOpenMP_C_FLAGS="-fopenmp -I${LIBGOMP}" -DOpenMP_C_LIB_NAMES=gomp -DOpenMP_CXX_FLAGS="-fopenmp -I${LIBGOMP}" -DOpenMP_CXX_LIB_NAMES=gomp -DOpenMP_gomp_LIBRARY=${LIBGOMP}/libgomp.a \
48+
-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=. ..; \
49+
cmake --build . -j$(nproc --all); \
50+
mv src/${APP} /opt/build/${APP}_avx2; \
51+
touch /opt/build/${APP}_arch /opt/build/${APP}_sse41; \
52+
else \
53+
mkdir -p build_sse41/src && mkdir -p build_avx2/src; \
54+
cd /opt/build/build_sse41; \
55+
cmake -DHAVE_SSE4_1=1 -DHAVE_MPI=0 -DHAVE_TESTS=0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=. ..; \
56+
make -j $(nproc --all); \
57+
mv src/${APP} /opt/build/${APP}_sse41; \
58+
cd /opt/build/build_avx2; \
59+
cmake -DHAVE_AVX2=1 -DHAVE_MPI=0 -DHAVE_TESTS=0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=. ..; \
60+
make -j $(nproc --all); \
61+
mv src/${APP} /opt/build/${APP}_avx2; \
62+
touch /opt/build/${APP}_arch; \
63+
fi; \
4464
fi
4565

46-
FROM debian:stable-slim
66+
FROM debian:bookworm-slim
4767
ARG TARGETARCH
4868
ARG APP
69+
ARG GPU
70+
71+
COPY --from=builder /opt/build/${APP}_arch /opt/build/${APP}_sse41 /opt/build/${APP}_avx2 /usr/local/bin/
72+
ADD util/${APP}_wrapper.sh /usr/local/bin/entrypoint
4973

5074
RUN apt-get update && apt-get install -y \
5175
gawk bash grep libstdc++6 libgomp1 libatomic1 zlib1g libbz2-1.0 wget tar aria2 \
52-
&& rm -rf /var/lib/apt/lists/*
53-
54-
COPY --from=builder /opt/build/${APP}_arch /opt/build/${APP}_sse2 /opt/build/${APP}_avx2 /usr/local/bin/
55-
ADD util/${APP}_wrapper.sh /usr/local/bin/entrypoint
56-
RUN if [ "$TARGETARCH" = "arm64" ]; then rm -f /usr/local/bin/entrypoint; ln -s /usr/local/bin/${APP}_arch /usr/local/bin/entrypoint; fi
76+
&& rm -rf /var/lib/apt/lists/*; \
77+
if [ "$TARGETARCH" = "arm64" ]; then \
78+
rm -f /usr/local/bin/entrypoint; ln -s /usr/local/bin/${APP}_arch /usr/local/bin/entrypoint; \
79+
elif [ "$GPU" = "1" ]; then \
80+
rm -f /usr/local/bin/entrypoint; ln -s /usr/local/bin/${APP}_avx2 /usr/local/bin/entrypoint; \
81+
fi
5782

5883
ENTRYPOINT ["/usr/local/bin/entrypoint"]
59-

0 commit comments

Comments
 (0)