Skip to content

Commit b0519d6

Browse files
Merge branch 'master' of https://github.com/soedinglab/mmseqs2
2 parents 1e5d180 + 753e1c6 commit b0519d6

File tree

163 files changed

+48730
-4264
lines changed

Some content is hidden

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

163 files changed

+48730
-4264
lines changed

.cirrus.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ task:
3939
CXX: g++-4.9
4040
compile_script: |
4141
mkdir build && cd build
42-
cmake -DCMAKE_BUILD_TYPE=Release -DHAVE_TESTS=1 -DENABLE_WERROR=1 -DHAVE_SSE4_1=1 -DREQUIRE_OPENMP=0 ..
42+
cmake -DCMAKE_BUILD_TYPE=Release -DHAVE_TESTS=1 -DENABLE_WERROR=0 -DHAVE_SSE4_1=1 -DREQUIRE_OPENMP=0 ..
4343
make -j $(nproc --all)
4444
test_script: MMSEQS_NUM_THREADS=4 ./util/regression/run_regression.sh ./build/src/mmseqs SCRATCH SEARCH
4545

.github/workflows/docker.yml

+62-1
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 }}

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
src/workflow/time_test
3131

3232
build/
33+
build-*/
3334
.idea/
3435
cmake-build-*/
3536
BenchmarkingDatas/

CMakeLists.txt

+14-3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ set(HAVE_S390X 0 CACHE BOOL "Have s390x architecture")
1919
set(NATIVE_ARCH 1 CACHE BOOL "Assume native architecture for SIMD. Use one of the HAVE_* options or set CMAKE_CXX_FLAGS to the appropriate flags if you disable this.")
2020
set(USE_SYSTEM_ZSTD 0 CACHE BOOL "Use zstd provided by system instead of bundled version")
2121

22+
set(ENABLE_CUDA 0 CACHE BOOL "Enable CUDA")
23+
24+
set(PREFER_STATIC 0 CACHE BOOL "Prefer finding .a libs")
25+
if (PREFER_STATIC)
26+
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a" ".so")
27+
endif()
28+
2229
if (HAVE_SANITIZER)
2330
include(FindUBSan)
2431
include(FindASan)
@@ -214,16 +221,20 @@ include_directories(lib/simde)
214221

215222
include_directories(lib)
216223
include_directories(lib/simd)
217-
include_directories(lib/gzstream)
218224
include_directories(lib/alp)
219-
include_directories(lib/cacode)
220225
include_directories(lib/ksw2)
221226
include_directories(lib/xxhash)
222227
if (NOT DISABLE_IPS4O)
223228
include_directories(lib/ips4o)
224229
endif ()
225230

226-
add_subdirectory(lib/cacode)
231+
# libmarv
232+
if (ENABLE_CUDA)
233+
set(LIBRARY_ONLY 1 CACHE INTERNAL "" FORCE)
234+
include_directories(lib/libmarv/src)
235+
add_subdirectory(lib/libmarv/src EXCLUDE_FROM_ALL)
236+
endif ()
237+
227238
add_subdirectory(lib/alp)
228239
add_subdirectory(lib/ksw2)
229240
add_subdirectory(data)

Dockerfile

+49-25
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
ARG APP=mmseqs
2-
FROM --platform=$BUILDPLATFORM debian:stable-slim 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 \
9-
build-essential cmake xxd git \
10+
build-essential cmake xxd git wget \
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+
wget 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 ninja-build; \
17+
fi; \
18+
rm -rf /var/lib/apt/lists/*;
1319

1420
WORKDIR /opt/build
1521
ADD . .
@@ -22,33 +28,51 @@ RUN if [ "$TARGETARCH" = "arm64" ]; then \
2228
mv src/${APP} /opt/build/${APP}_arch; \
2329
touch /opt/build/${APP}_sse2 /opt/build/${APP}_sse41 /opt/build/${APP}_avx2; \
2430
else \
25-
mkdir -p build_sse2/src && mkdir -p build_sse41/src && mkdir -p build_avx2/src; \
26-
cd /opt/build/build_sse2; \
27-
cmake -DHAVE_SSE2=1 -DHAVE_MPI=0 -DHAVE_TESTS=0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=. ..; \
28-
make -j $(nproc --all); \
29-
mv src/${APP} /opt/build/${APP}_sse2; \
30-
cd /opt/build/build_sse41; \
31-
cmake -DHAVE_SSE4_1=1 -DHAVE_MPI=0 -DHAVE_TESTS=0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=. ..; \
32-
make -j $(nproc --all); \
33-
mv src/${APP} /opt/build/${APP}_sse41; \
34-
cd /opt/build/build_avx2; \
35-
cmake -DHAVE_AVX2=1 -DHAVE_MPI=0 -DHAVE_TESTS=0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=. ..; \
36-
make -j $(nproc --all); \
37-
mv src/${APP} /opt/build/${APP}_avx2; \
38-
touch /opt/build/${APP}_arch; \
31+
if [ "$GPU" = "1" ]; then \
32+
export CUDACXX=/usr/local/cuda/bin/nvcc; \
33+
mkdir -p build_avx2/src; \
34+
cd /opt/build/build_avx2; \
35+
cmake -GNinja -DHAVE_AVX2=1 -DHAVE_MPI=0 -DHAVE_TESTS=0 \
36+
-DPREFER_STATIC=1 -DBUILD_SHARED_LIBS=OFF \
37+
-DCMAKE_EXE_LINKER_FLAGS="-static-libgcc -static-libstdc++" \
38+
-DENABLE_CUDA=1 -DCMAKE_CUDA_ARCHITECTURES="75-real;80-real;86-real;89-real;90" \
39+
-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=. ..; \
40+
cmake --build . -j$(nproc --all); \
41+
mv src/${APP} /opt/build/${APP}_avx2; \
42+
touch /opt/build/${APP}_arch /opt/build/${APP}_sse41 /opt/build/${APP}_sse2; \
43+
else \
44+
mkdir -p build_sse2/src && mkdir -p build_sse41/src && mkdir -p build_avx2/src; \
45+
cd /opt/build/build_sse2; \
46+
cmake -DHAVE_SSE2=1 -DHAVE_MPI=0 -DHAVE_TESTS=0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=. ..; \
47+
make -j $(nproc --all); \
48+
mv src/${APP} /opt/build/${APP}_sse2; \
49+
cd /opt/build/build_sse41; \
50+
cmake -DHAVE_SSE4_1=1 -DHAVE_MPI=0 -DHAVE_TESTS=0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=. ..; \
51+
make -j $(nproc --all); \
52+
mv src/${APP} /opt/build/${APP}_sse41; \
53+
cd /opt/build/build_avx2; \
54+
cmake -DHAVE_AVX2=1 -DHAVE_MPI=0 -DHAVE_TESTS=0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=. ..; \
55+
make -j $(nproc --all); \
56+
mv src/${APP} /opt/build/${APP}_avx2; \
57+
touch /opt/build/${APP}_arch; \
58+
fi; \
3959
fi
4060

41-
FROM debian:stable-slim
61+
FROM debian:bookworm-slim
4262
ARG TARGETARCH
4363
ARG APP
44-
45-
RUN apt-get update && apt-get install -y \
46-
gawk bash grep libstdc++6 libgomp1 libatomic1 zlib1g libbz2-1.0 wget tar \
47-
&& rm -rf /var/lib/apt/lists/*
64+
ARG GPU
4865

4966
COPY --from=builder /opt/build/${APP}_arch /opt/build/${APP}_sse2 /opt/build/${APP}_sse41 /opt/build/${APP}_avx2 /usr/local/bin/
5067
ADD util/${APP}_wrapper.sh /usr/local/bin/entrypoint
51-
RUN if [ "$TARGETARCH" = "arm64" ]; then rm -f /usr/local/bin/entrypoint; ln -s /usr/local/bin/${APP}_arch /usr/local/bin/entrypoint; fi
5268

53-
ENTRYPOINT ["/usr/local/bin/entrypoint"]
69+
RUN apt-get update && apt-get install -y \
70+
gawk bash grep libstdc++6 libgomp1 libatomic1 zlib1g libbz2-1.0 wget tar aria2 \
71+
&& rm -rf /var/lib/apt/lists/*; \
72+
if [ "$TARGETARCH" = "arm64" ]; then \
73+
rm -f /usr/local/bin/entrypoint; ln -s /usr/local/bin/${APP}_arch /usr/local/bin/entrypoint; \
74+
elif [ "$GPU" = "1" ]; then \
75+
rm -f /usr/local/bin/entrypoint; ln -s /usr/local/bin/${APP}_avx2 /usr/local/bin/entrypoint; \
76+
fi
5477

78+
ENTRYPOINT ["/usr/local/bin/entrypoint"]

0 commit comments

Comments
 (0)